Package org.alfresco.filesys.repo
Class TempNetworkFile
- java.lang.Object
-
- org.alfresco.jlan.server.filesys.NetworkFile
-
- org.alfresco.jlan.smb.server.disk.JavaNetworkFile
-
- org.alfresco.filesys.repo.TempNetworkFile
-
- All Implemented Interfaces:
NetworkFileLegacyReferenceCount,org.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface
public class TempNetworkFile extends org.alfresco.jlan.smb.server.disk.JavaNetworkFile implements org.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface, NetworkFileLegacyReferenceCount
Temporary Java backed network file.- Author:
- mrogers
-
-
Field Summary
-
Fields inherited from class org.alfresco.jlan.server.filesys.NetworkFile
ATTRIBUTESONLY, Created, DelayedClose, DelayedWriteError, DeleteOnClose, IOPending, m_accessDate, m_allowedAccess, m_attrib, m_closed, m_createDate, m_dirId, m_fid, m_fileSize, m_fullName, m_grantedAccess, m_modifyDate, m_name, m_streamId, m_streamName, m_uniqueId, m_writeCount, READONLY, READWRITE, WRITEONLY
-
-
Constructor Summary
Constructors Constructor Description TempNetworkFile(File file, String netPath)Create a new temporary file with no existing content.TempNetworkFile(File file, String netPath, Reader existingContent)A new temporary network file with some existing content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsOpenCloseViaNetworkFile()Tell JLAN it needs to call disk.closeFile rather than short cutting.intdecrementLagacyOpenCount()Decrement the legacy file open countFilegetFile()Access to the underlying file.org.alfresco.jlan.server.filesys.cache.FileStategetFileState()intgetLegacyOpenCount()Return the legacy open file countintincrementLegacyOpenCount()Increment the legacy file open countbooleanisChanged()booleanisModificationDateSetDirectly()intreadFile(byte[] buf, int len, int pos, long fileOff)voidsetChanged(boolean changed)voidsetFileState(org.alfresco.jlan.server.filesys.cache.FileState fileState)voidsetModificationDateSetDirectly(boolean modificationDateSetDirectly)StringtoString()voidtruncateFile(long size)voidwriteFile(byte[] buf, int len, int pos)voidwriteFile(byte[] buffer, int length, int position, long fileOffset)-
Methods inherited from class org.alfresco.jlan.smb.server.disk.JavaNetworkFile
closeFile, currentPosition, flushFile, isEndOfFile, openFile, seekFile
-
Methods inherited from class org.alfresco.jlan.server.filesys.NetworkFile
addLock, close, getAccessDate, getAccessToken, getAllowedAccess, getCreationDate, getDirectoryId, getFileAttributes, getFileId, getFileSize, getFileSizeInt, getFullName, getFullNameStream, getGrantedAccess, getGrantedAccessAsString, getLockAt, getLockList, getModifyDate, getName, getOpLock, getProtocolId, getStreamId, getStreamName, getUniqueId, getWriteCount, hasAccessDate, hasAccessToken, hasCreationDate, hasDelayedClose, hasDelayedWriteError, hasDeleteOnClose, hasIOPending, hasLocks, hasModifyDate, hasNTAttribute, hasOpLock, incrementWriteCount, isArchived, isClosed, isDirectory, isForce, isHidden, isReadOnly, isStream, isSystem, numberOfLocks, removeAllLocks, removeLock, setAccessDate, setAccessToken, setAllowedAccess, setAttributes, setClosed, setCreationDate, setDelayedClose, setDelayedWriteError, setDeleteOnClose, setDirectoryId, setFileId, setFileSize, setFileSize, setForce, setFullName, setGrantedAccess, setIOPending, setModifyDate, setName, setOpLock, setProtocolId, setStatusFlag, setStreamId, setStreamName, setUniqueId, setUniqueId, setUniqueId, wasCreated
-
-
-
-
Method Detail
-
getFile
public File getFile()
Access to the underlying file.- Returns:
- the file.
-
toString
public String toString()
- Overrides:
toStringin classorg.alfresco.jlan.server.filesys.NetworkFile
-
readFile
public int readFile(byte[] buf, int len, int pos, long fileOff) throws IOException- Overrides:
readFilein classorg.alfresco.jlan.smb.server.disk.JavaNetworkFile- Throws:
IOException
-
writeFile
public void writeFile(byte[] buf, int len, int pos) throws IOException- Overrides:
writeFilein classorg.alfresco.jlan.smb.server.disk.JavaNetworkFile- Throws:
IOException
-
writeFile
public void writeFile(byte[] buffer, int length, int position, long fileOffset) throws IOException- Overrides:
writeFilein classorg.alfresco.jlan.smb.server.disk.JavaNetworkFile- Throws:
IOException
-
truncateFile
public void truncateFile(long size) throws IOException- Overrides:
truncateFilein classorg.alfresco.jlan.smb.server.disk.JavaNetworkFile- Throws:
IOException
-
setFileState
public void setFileState(org.alfresco.jlan.server.filesys.cache.FileState fileState)
-
getFileState
public org.alfresco.jlan.server.filesys.cache.FileState getFileState()
- Specified by:
getFileStatein interfaceorg.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface
-
allowsOpenCloseViaNetworkFile
public boolean allowsOpenCloseViaNetworkFile()
Tell JLAN it needs to call disk.closeFile rather than short cutting.- Overrides:
allowsOpenCloseViaNetworkFilein classorg.alfresco.jlan.server.filesys.NetworkFile- Returns:
- boolean
-
setChanged
public void setChanged(boolean changed)
-
isChanged
public boolean isChanged()
-
isModificationDateSetDirectly
public boolean isModificationDateSetDirectly()
-
setModificationDateSetDirectly
public void setModificationDateSetDirectly(boolean modificationDateSetDirectly)
-
incrementLegacyOpenCount
public final int incrementLegacyOpenCount()
Increment the legacy file open count- Specified by:
incrementLegacyOpenCountin interfaceNetworkFileLegacyReferenceCount- Returns:
- int
-
decrementLagacyOpenCount
public final int decrementLagacyOpenCount()
Decrement the legacy file open count- Specified by:
decrementLagacyOpenCountin interfaceNetworkFileLegacyReferenceCount- Returns:
- int
-
getLegacyOpenCount
public final int getLegacyOpenCount()
Return the legacy open file count- Specified by:
getLegacyOpenCountin interfaceNetworkFileLegacyReferenceCount- Returns:
- int
-
-