Package org.opencms.jlan
Class CmsJlanNetworkFile
java.lang.Object
org.alfresco.jlan.server.filesys.NetworkFile
org.opencms.jlan.CmsJlanNetworkFile
This class represents a file for use by the JLAN server component. It currently just
wraps an OpenCms resource.
-
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
ConstructorsConstructorDescriptionCmsJlanNetworkFile(CmsObjectWrapper cms, CmsResource resource, String fullName) Creates a new network file instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddelete()Deletes the file.protected voidMake sure that this resource is locked.voidprotected CmsFilegetFile()Gets the CmsFile instance for this file, or null if the file contents haven'T been loaded already.org.alfresco.jlan.server.filesys.FileInfoGets the file information record.protected StringgetFullChildPath(CmsResource child) Adds the name of a child resource to this file's path.protected voidload(boolean needContent) Loads the file data from the VFS.protected booleanmatchesSearchAttributes(int attributes) Checks if this file matches the given search attributes.voidMoves this file to a different path.voidopenFile(boolean arg0) intreadFile(byte[] buffer, int length, int bufferOffset, long fileOffset) Collects all files matching the given name pattern and search attributes.longseekFile(long pos, int typ) voidsetFileInformation(org.alfresco.jlan.server.filesys.FileInfo info) Sets the file information.voidtruncateFile(long size) protected voidCopies state information from the internal CmsResource object to this object.voidwriteFile(byte[] data, int len, int pos, long offset) Methods inherited from class org.alfresco.jlan.server.filesys.NetworkFile
addLock, allowsOpenCloseViaNetworkFile, 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, toString, wasCreated
-
Constructor Details
-
CmsJlanNetworkFile
Creates a new network file instance.- Parameters:
cms- the CMS object wrapper to useresource- the actual CMS resourcefullName- the raw repository path
-
-
Method Details
-
closeFile
- Specified by:
closeFilein classorg.alfresco.jlan.server.filesys.NetworkFile- Throws:
IOException- See Also:
-
delete
Deletes the file.- Throws:
IOException- if something goes wrong
-
flushFile
- Specified by:
flushFilein classorg.alfresco.jlan.server.filesys.NetworkFile- Throws:
IOException- See Also:
-
getFileInfo
Gets the file information record.- Returns:
- the file information for this file
- Throws:
IOException- if reading the file information fails
-
moveTo
Moves this file to a different path.- Parameters:
cmsNewPath- the new path- Throws:
CmsException- if something goes wrong
-
openFile
- Specified by:
openFilein classorg.alfresco.jlan.server.filesys.NetworkFile- See Also:
-
readFile
public int readFile(byte[] buffer, int length, int bufferOffset, long fileOffset) throws IOException - Specified by:
readFilein classorg.alfresco.jlan.server.filesys.NetworkFile- Throws:
IOException- See Also:
-
search
Collects all files matching the given name pattern and search attributes.- Parameters:
name- the name patternsearchAttributes- the search attributes- Returns:
- the list of file objects which match the given parameters
- Throws:
IOException- if something goes wrong
-
seekFile
- Specified by:
seekFilein classorg.alfresco.jlan.server.filesys.NetworkFile- Throws:
IOException- See Also:
-
setFileInformation
Sets the file information.- Parameters:
info- the file information to set
-
truncateFile
- Specified by:
truncateFilein classorg.alfresco.jlan.server.filesys.NetworkFile- Throws:
IOException- See Also:
-
writeFile
- Specified by:
writeFilein classorg.alfresco.jlan.server.filesys.NetworkFile- Throws:
IOException- See Also:
-
ensureLock
Make sure that this resource is locked.- Throws:
CmsException- if something goes wrong
-
getFile
Gets the CmsFile instance for this file, or null if the file contents haven'T been loaded already.- Returns:
- the CmsFile instance
-
getFullChildPath
Adds the name of a child resource to this file's path.- Parameters:
child- the child resource- Returns:
- the path of the child
-
load
Loads the file data from the VFS.- Parameters:
needContent- true if we need the file content to be loaded- Throws:
IOException- if an IO error happensCmsException- if a CMS operation fails
-
matchesSearchAttributes
Checks if this file matches the given search attributes.- Parameters:
attributes- the search attributes- Returns:
- true if this file matches the search attributes given
-
updateFromResource
Copies state information from the internal CmsResource object to this object.
-