1 17 18 package org.alfresco.filesys.smb.server.repo.pseudo; 19 20 import java.io.File ; 21 22 import org.alfresco.filesys.server.filesys.FileInfo; 23 import org.alfresco.filesys.server.filesys.NetworkFile; 24 25 32 public class LocalPseudoFile extends PseudoFile 33 { 34 36 private String m_path; 37 38 44 public LocalPseudoFile(String name, String path) 45 { 46 super(name); 47 48 m_path = path; 49 } 50 51 56 public final String getFilePath() 57 { 58 return m_path; 59 } 60 61 66 public FileInfo getFileInfo() 67 { 68 70 if ( m_fileInfo == null) { 71 72 74 File localFile = new File ( getFilePath()); 75 if ( localFile.exists()) 76 { 77 79 m_fileInfo = new FileInfo( getFileName(), localFile.length(), getAttributes()); 80 81 83 m_fileInfo.setModifyDateTime( localFile.lastModified()); 84 m_fileInfo.setCreationDateTime( _creationDateTime); 85 m_fileInfo.setChangeDateTime( _creationDateTime); 86 87 89 m_fileInfo.setAllocationSize(( localFile.length() + 512L) & 0xFFFFFFFFFFFFFE00L); 90 } 91 } 92 93 95 return m_fileInfo; 96 } 97 98 104 public NetworkFile getFile(String netPath) 105 { 106 108 return new PseudoNetworkFile( getFileName(), getFilePath(), netPath); 109 } 110 } 111 | Popular Tags |