|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.filesys.state.FileState
public class FileState
File State Class
Keeps track of file state across all sessions on the server, to keep track of file sharing modes, file locks and also for synchronizing access to files/folders.
| Nested Class Summary | |
|---|---|
static class |
FileState.FileStateStatus
|
| Field Summary | |
|---|---|
static long |
DefTimeout
|
static long |
NoTimeout
|
static long |
RenameTimeout
|
| Constructor Summary | |
|---|---|
FileState(java.lang.String fname,
boolean isdir)
Class constructor |
|
| Method Summary | |
|---|---|
void |
addLock(org.alfresco.jlan.locking.FileLock lock)
Add a lock to this file |
void |
addPseudoFile(org.alfresco.jlan.server.filesys.pseudo.PseudoFile pfile)
Add a pseudo file to this folder |
boolean |
allowsOpen(org.alfresco.jlan.server.filesys.FileOpenParams params)
Check if the file can be opened depending on any current file opens and the sharing mode of the first file open |
boolean |
canReadFile(long offset,
long len,
int pid)
Check if the file is readable for the specified section of the file and process id |
boolean |
canWriteFile(long offset,
long len,
int pid)
Check if the file is writeable for the specified section of the file and process id |
int |
decrementOpenCount()
Decrement the file open count |
boolean |
exists()
Determine if the file/folder exists |
long |
getAccessDateTime()
Return the access date/time |
long |
getChangeDateTime()
Return the change date/time |
FileState.FileStateStatus |
getFileStatus()
Return the file status |
long |
getModifyDateTime()
Return the modify date/time |
NodeRef |
getNodeRef()
Return the associated node |
int |
getOpenCount()
Return the file open count |
java.lang.String |
getPath()
Return the file name/path |
org.alfresco.jlan.server.filesys.pseudo.PseudoFileList |
getPseudoFileList()
Return the pseudo file list |
FileState |
getRenameState()
Return the associated rename state |
long |
getSecondsToExpire(long curTime)
Return the number of seconds left before the file state expires |
int |
getSharedAccess()
Return the shared access mode |
boolean |
hasAccessDateTime()
Check if the access date/time has been set |
boolean |
hasActiveLocks()
Check if there are active locks on this file |
boolean |
hasChangeDateTime()
Check if the change date/time has been set |
boolean |
hasExpired(long curTime)
Check if the file state has expired |
boolean |
hasModifyDateTime()
Check if the modification date/time has been set |
boolean |
hasNodeRef()
Determine if the associated node has been set |
boolean |
hasNoTimeout()
Check if this file state does not expire |
boolean |
hasPseudoFiles()
Determine if a folder has pseudo files associated with it |
boolean |
hasRenameState()
Determine if the file state has an associated rename state |
int |
incrementOpenCount()
Increment the file open count |
boolean |
isDirectory()
Return the directory state |
static java.lang.String |
normalizePath(java.lang.String path)
Normalize the path to uppercase the directory names and keep the case of the file name. |
int |
numberOfLocks()
Return the count of active locks on this file |
void |
removeLock(org.alfresco.jlan.locking.FileLock lock)
Remove a lock on this file |
void |
setExpiryTime(long expire)
Set the file state expiry time |
void |
setFileStatus(FileState.FileStateStatus status)
Set the file status |
void |
setFileStatus(int fsts)
Set the file status |
void |
setNodeRef(NodeRef nodeRef)
Set the node ref for the file/folder |
void |
setPath(java.lang.String path)
Set the file path |
void |
setRenameState(FileState fstate)
Set the associated file state when a file is renamed, this is the link to the new file state |
void |
setSharedAccess(int mode)
Set the shared access mode, from the first file open |
java.lang.String |
toString()
Return the file state as a string |
void |
updateAccessDateTime()
Update the access date/time |
void |
updateChangeDateTime()
Update the change date/time |
void |
updateModifyDateTime()
Update the modify date/time |
void |
updateModifyDateTime(long modTime)
Update the modify date/time |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long NoTimeout
public static final long DefTimeout
public static final long RenameTimeout
| Constructor Detail |
|---|
public FileState(java.lang.String fname,
boolean isdir)
fname - Stringisdir - boolean| Method Detail |
|---|
public final java.lang.String getPath()
public final FileState.FileStateStatus getFileStatus()
public final boolean exists()
public final boolean isDirectory()
public final boolean hasNodeRef()
public final NodeRef getNodeRef()
public final int getOpenCount()
public final int getSharedAccess()
public final boolean hasActiveLocks()
public final boolean hasNoTimeout()
public final boolean allowsOpen(org.alfresco.jlan.server.filesys.FileOpenParams params)
params - FileOpenParams
public final int incrementOpenCount()
public final int decrementOpenCount()
public final boolean hasExpired(long curTime)
curTime - long
public final long getSecondsToExpire(long curTime)
curTime - long
public final boolean hasRenameState()
public final FileState getRenameState()
public final boolean hasPseudoFiles()
public final org.alfresco.jlan.server.filesys.pseudo.PseudoFileList getPseudoFileList()
public final void addPseudoFile(org.alfresco.jlan.server.filesys.pseudo.PseudoFile pfile)
pfile - PseudoFilepublic final void setFileStatus(FileState.FileStateStatus status)
status - FileStateStatuspublic final void setFileStatus(int fsts)
fsts - intpublic final void setExpiryTime(long expire)
expire - longpublic final void setNodeRef(NodeRef nodeRef)
nodeRef - NodeRefpublic final void setRenameState(FileState fstate)
fstate - FileStatepublic final void setSharedAccess(int mode)
mode - intpublic final void setPath(java.lang.String path)
path - Stringpublic final int numberOfLocks()
public final void addLock(org.alfresco.jlan.locking.FileLock lock)
throws org.alfresco.jlan.locking.LockConflictException
lock - FileLock
org.alfresco.jlan.locking.LockConflictException
public final void removeLock(org.alfresco.jlan.locking.FileLock lock)
throws org.alfresco.jlan.locking.NotLockedException
lock - FileLock
org.alfresco.jlan.locking.NotLockedExceptionpublic final boolean hasAccessDateTime()
public final long getAccessDateTime()
public final void updateAccessDateTime()
public final boolean hasChangeDateTime()
public final long getChangeDateTime()
public final void updateChangeDateTime()
public final boolean hasModifyDateTime()
public final long getModifyDateTime()
public final void updateModifyDateTime()
public final void updateModifyDateTime(long modTime)
modTime - long
public final boolean canReadFile(long offset,
long len,
int pid)
offset - longlen - longpid - int
public final boolean canWriteFile(long offset,
long len,
int pid)
offset - longlen - longpid - int
public static final java.lang.String normalizePath(java.lang.String path)
path - String
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||