public class FileSegmentInfo extends Object
Contains the details of a file segment that may be shared by many users/sessions.
Modifier and Type | Field and Description |
---|---|
static int |
Available |
static int |
Error |
static int |
Initial |
static int |
Loading |
static int |
LoadWait |
static int |
Saved |
static int |
SaveWait |
static int |
Saving |
Constructor and Description |
---|
FileSegmentInfo()
Default constructor
|
FileSegmentInfo(String tempFile)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
void |
deleteTemporaryFile()
Delete the temporary file used by the file segment
|
long |
getFileLength()
Return the temporary file length
|
long |
getReadableLength()
Return the readable file data length
|
String |
getTemporaryFile()
Return the temporary file path
|
boolean |
hasDeleteOnStore()
Check if the associated temporary file should be deleted once the data store
has completed successfully.
|
int |
hasStatus()
Return the segment status
|
boolean |
isDataAvailable()
Check if the file data is available
|
boolean |
isQueued()
Check if the segment has a file request queued
|
boolean |
isUpdated()
Check if the segment has been updated
|
void |
setDeleteOnStore()
Set the delete on store flag so that the temporary file is deleted as soon as the
data store has completed successfully.
|
protected void |
setFlag(int flag,
boolean sts)
Set/clear the specified flag
|
void |
setQueued(boolean qd)
Set/clear the request queued flag
|
void |
setReadableLength(long readable)
Set the readable data length for the file, used during data loading to allow the file to be read before
the file load completes.
|
void |
setStatus(int sts)
Set the segment load/update status
|
void |
setTemporaryFile(String tempFile)
Set the temporary file that is used to hold the local copy of the file data
|
void |
setUpdated(boolean sts)
Set/clear the updated segment flag
|
void |
signalDataAvailable()
Signal that the file data is available, any threads using the waitForData() method
will return so that the threads can access the file data.
|
String |
toString()
Return the file segment details as a string
|
void |
waitForData(long tmo)
Wait for another thread to load the file data
|
public static final int Initial
public static final int LoadWait
public static final int Loading
public static final int Available
public static final int SaveWait
public static final int Saving
public static final int Saved
public static final int Error
public FileSegmentInfo()
public FileSegmentInfo(String tempFile)
tempFile
- Stringpublic final String getTemporaryFile()
public final boolean isUpdated()
public final boolean isQueued()
public final boolean isDataAvailable()
public final boolean hasDeleteOnStore()
public final void deleteTemporaryFile() throws IOException
IOException
public final int hasStatus()
public final long getFileLength() throws IOException
IOException
public final long getReadableLength()
public final void setReadableLength(long readable)
readable
- longpublic final void setStatus(int sts)
sts
- intpublic final void setTemporaryFile(String tempFile)
tempFile
- Stringpublic final void setUpdated(boolean sts)
sts
- booleanpublic final void setQueued(boolean qd)
qd
- booleanpublic final void setDeleteOnStore()
protected final void setFlag(int flag, boolean sts)
flag
- intsts
- booleanpublic final void waitForData(long tmo)
tmo
- longpublic final void signalDataAvailable()
Copyright © 2005–2017 Alfresco Software. All rights reserved.