public class FileInfo extends Object
The FileInfo class is returned by the DiskSession.getFileInformation () method and contains details of the requested file.
FileInfo objects are also returned by a directory search that is started using the DiskSession.StartSearch () method. The search request creates an SearchContext object which can return either file names, via the nextFileName () method, or can return FileInfo objects for each file found, via the nextFileInfo () method.
DiskSession
Modifier and Type | Field and Description |
---|---|
protected int |
m_attr |
protected String |
m_name |
protected String |
m_path |
protected String |
m_shortName |
protected long |
m_size |
Constructor and Description |
---|
FileInfo()
Default constructor
|
FileInfo(String fname,
long fsize,
int fattr)
Construct an SMB file information object.
|
FileInfo(String fname,
long fsize,
int fattr,
int ftime)
Construct an SMB file information object.
|
FileInfo(String fname,
long fsize,
int fattr,
int fdate,
int ftime)
Construct an SMB file information object.
|
FileInfo(String fpath,
String fname,
long fsize,
int fattr)
Construct an SMB file information object.
|
FileInfo(String fpath,
String fname,
long fsize,
int fattr,
int ftime)
Construct an SMB file information object.
|
FileInfo(String fpath,
String fname,
long fsize,
int fattr,
int fdate,
int ftime)
Construct an SMB file information object.
|
Modifier and Type | Method and Description |
---|---|
SMBDate |
getAccessDateTime()
Return the files last access date/time.
|
long |
getAllocationSize()
Get the files allocated size.
|
int |
getAllocationSizeInt()
Get the files allocated size, as a 32bit value
|
SMBDate |
getCreationDateTime()
Return the creation date/time of the file.
|
int |
getFileAttributes()
Return the file attributes value.
|
int |
getFileId()
Get the file identifier
|
String |
getFileName()
Get the file name string
|
String |
getFormattedAttributes()
Return the file attributes as a formatted string.
|
SMBDate |
getModifyDateTime()
Get the files date/time of last write
|
String |
getPath()
Get the file path string.
|
String |
getShortName()
Get the short file name (8.3 format)
|
long |
getSize()
Get the file size, in bytes.
|
int |
getSizeInt()
Get the file size in bytes, as a 32bit value
|
boolean |
hasAccessDateTime()
Determine if the last access date/time is available.
|
boolean |
hasAttribute(int attr)
Return the specified attribute status
|
boolean |
hasCreationDateTime()
Determine if the creation date/time details are available.
|
boolean |
hasModifyDateTime()
Determine if the modify date/time details are available.
|
boolean |
hasShortName()
Check if the short (8.3) file name is available
|
boolean |
isArchived()
Return the archived attribute status
|
boolean |
isCompressed()
Return the compressed file status
|
boolean |
isDirectory()
Return the directory file attribute status.
|
boolean |
isEncrypted()
Return the encrypted file status
|
boolean |
isHidden()
Return the hidden file attribute status.
|
boolean |
isIndexed()
Return the indexed file status
|
boolean |
isOffline()
Return the offline file status
|
boolean |
isReadOnly()
Return the read-only file attribute status.
|
boolean |
isSystem()
Return the system file attribute status.
|
boolean |
isTemporary()
Return the temporary file status
|
void |
resetInfo()
Reset all values to zero/null values.
|
void |
setAccessDateTime(int dat,
int tim)
Set the files last access date/time.
|
void |
setAccessDateTime(SMBDate dattim)
Set the files last access date/time.
|
void |
setAllocationSize(long siz)
Set the files allocation size.
|
void |
setCreationDateTime(int dat,
int tim)
Set the creation date/time for the file.
|
void |
setCreationDateTime(SMBDate dattim)
Set the creation date/time for the file.
|
void |
setFileAttributes(int attr)
Set the file attributes.
|
void |
setFileId(int id)
Set the file identifier
|
void |
setFileName(String name)
Set the file name.
|
void |
setFileSize(long siz)
Set the file size in bytes
|
void |
setModifyDateTime(int dat,
int tim)
Set the date/time for the file.
|
void |
setModifyDateTime(SMBDate datetime)
Set the date/time file
|
void |
setPath(String path)
Set the path
|
void |
setShortName(String name)
Set the short (8.3 format) file name
|
void |
setSize(int siz)
Set the file size.
|
void |
setSize(long siz)
Set the file size.
|
String |
toString()
Return the file information as a string.
|
protected String m_name
protected String m_shortName
protected String m_path
protected long m_size
protected int m_attr
public FileInfo()
public FileInfo(String fname, long fsize, int fattr)
fname
- File name string.fsize
- File size, in bytes.fattr
- File attributes.public FileInfo(String fname, long fsize, int fattr, int ftime)
fname
- File name string.fsize
- File size, in bytes.fattr
- File attributes.ftime
- File time, in seconds since 1-Jan-1970 00:00:00public FileInfo(String fname, long fsize, int fattr, int fdate, int ftime)
fname
- File name string.fsize
- File size, in bytes.fattr
- File attributes.fdate
- SMB encoded file date.ftime
- SMB encoded file time.public FileInfo(String fpath, String fname, long fsize, int fattr)
fpath
- File path string.fname
- File name string.fsize
- File size, in bytes.fattr
- File attributes.public FileInfo(String fpath, String fname, long fsize, int fattr, int ftime)
fpath
- File path string.fname
- File name string.fsize
- File size, in bytes.fattr
- File attributes.ftime
- File time, in seconds since 1-Jan-1970 00:00:00public FileInfo(String fpath, String fname, long fsize, int fattr, int fdate, int ftime)
fpath
- File path string.fname
- File name string.fsize
- File size, in bytes.fattr
- File attributes.fdate
- SMB encoded file date.ftime
- SMB encoded file time.public SMBDate getAccessDateTime()
public long getAllocationSize()
public int getAllocationSizeInt()
public SMBDate getCreationDateTime()
public int getFileAttributes()
public final String getFileName()
public final boolean hasShortName()
public final String getShortName()
public final SMBDate getModifyDateTime()
public final String getPath()
public final long getSize()
public final int getSizeInt()
public final int getFileId()
public boolean hasAccessDateTime()
public boolean hasCreationDateTime()
public boolean hasModifyDateTime()
public final boolean hasAttribute(int attr)
attr
- intpublic final boolean isDirectory()
public final boolean isHidden()
public final boolean isReadOnly()
public final boolean isSystem()
public final boolean isArchived()
public final boolean isCompressed()
public final boolean isOffline()
public final boolean isEncrypted()
public final boolean isTemporary()
public final boolean isIndexed()
public final void resetInfo()
public void setAccessDateTime(int dat, int tim)
dat
- inttim
- intpublic void setAccessDateTime(SMBDate dattim)
dattim
- Last access date/time as an SMBDate value.public void setAllocationSize(long siz)
siz
- longpublic void setCreationDateTime(int dat, int tim)
dat
- int Creation date in SMB format.tim
- int Creation time in SMB format.public void setCreationDateTime(SMBDate dattim)
dattim
- Creation date as an SMBDate value.public final void setFileName(String name)
name
- java.lang.Stringpublic final void setFileSize(long siz)
siz
- longpublic void setModifyDateTime(int dat, int tim)
dat
- int Creation date in SMB format.tim
- int Creation time in SMB format.public final void setModifyDateTime(SMBDate datetime)
datetime
- SMBDatepublic final void setFileId(int id)
id
- intpublic final void setShortName(String name)
name
- Stringpublic final void setPath(String path)
path
- Stringpublic final void setSize(int siz)
siz
- intpublic final void setSize(long siz)
siz
- longpublic final String getFormattedAttributes()
The returned string is in the format 'RHSD' where 'R' indicates read-only, 'H' indicates hidden, 'S' indicates system and 'D' indicates directory
public String toString()
public final void setFileAttributes(int attr)
attr
- intCopyright © 2005–2017 Alfresco Software. All rights reserved.