public class FileInfo extends Object
The FileInfo class is returned by the DiskInterface.getFileInformation () and SearchContext.nextFileInfo() methods.
DiskInterface
,
SearchContext
Modifier and Type | Field and Description |
---|---|
static int |
FlagDeleteOnClose |
static int |
FlagPseudoFile |
protected int |
m_attr |
protected String |
m_name |
protected String |
m_path |
protected String |
m_shortName |
protected long |
m_size |
static int |
SetAccessDate |
static int |
SetAllocationSize |
static int |
SetAttributes |
static int |
SetChangeDate |
static int |
SetCreationDate |
static int |
SetDeleteOnClose |
static int |
SetFileSize |
static int |
SetGid |
static int |
SetMode |
static int |
SetModifyDate |
static int |
SetUid |
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 |
---|---|
void |
copyFrom(FileInfo finfo)
Copy the file information
|
long |
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
|
long |
getChangeDateTime()
Return the inode change date/time of the file.
|
long |
getCreationDateTime()
Return the creation date/time of the file.
|
int |
getDirectoryId()
Get the parent directory identifier
|
long |
getDirectoryIdLong()
Get the parent directory identifier
|
int |
getFileAttributes()
Return the file attributes value.
|
protected int |
getFileFlags()
Return the file flags
|
int |
getFileId()
Get the file identifier
|
long |
getFileIdLong()
Get the file identifier
|
String |
getFileName()
Get the file name string
|
int |
getGid()
Return the owner group id
|
int |
getMode()
Return the Unix mode
|
long |
getModifyDateTime()
Get the files date/time of last write
|
NetworkFile |
getNetworkFile()
Return the associated network file
|
String |
getPath()
Get the file path string.
|
int |
getSetFileInformationFlags()
Return the set file information flags
|
String |
getSetFileInformationFlagsString()
Return the setter flags as a 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
|
int |
getUid()
Return the owner user id
|
boolean |
hasAccessDateTime()
Determine if the last access date/time is available.
|
boolean |
hasAttribute(int attr)
Return the specified attribute status
|
boolean |
hasChangeDateTime()
Determine if the inode change date/time details are available.
|
boolean |
hasCreationDateTime()
Determine if the creation date/time details are available.
|
boolean |
hasDeleteOnClose()
Return the delete on close flag setting
|
boolean |
hasFileAttributes()
Determine if the file attributes field has been set
|
boolean |
hasGid()
Determine if the group id field has been set
|
boolean |
hasMode()
Determine if the mode field has been set
|
boolean |
hasModifyDateTime()
Determine if the modify date/time details are available.
|
boolean |
hasNetworkFile()
Check if the associated network file is valid
|
boolean |
hasSetFlag(int flag)
Determine if the specified set file information flags is enabled
|
boolean |
hasShortName()
Check if the short (8.3) file name is available
|
boolean |
hasUid()
Determine if the user id field has been set
|
boolean |
isArchived()
Return the archived attribute status
|
boolean |
isDirectory()
Return the directory file attribute status.
|
int |
isFileType()
Return the file type
|
boolean |
isHidden()
Return the hidden file attribute status.
|
boolean |
isPseudoFile()
Check if this is a pseudo file
|
boolean |
isReadOnly()
Return the read-only file attribute status.
|
boolean |
isSystem()
Return the system file attribute status.
|
boolean |
isTemporary()
Return the temporary attribute status.
|
void |
resetInfo()
Reset all values to zero/null values.
|
void |
setAccessDateTime(long timesec)
Set the files last access date/time.
|
void |
setAllocationSize(long siz)
Set the files allocation size.
|
void |
setChangeDateTime(long timesec)
Set the inode change date/time for the file.
|
void |
setCreationDateTime(long timesec)
Set the creation date/time for the file.
|
void |
setDeleteOnClose(boolean del)
Set/clear the delete on close flag
|
void |
setDirectoryId(int id)
Set the parent directory id
|
void |
setFileAttributes(int attr)
Set the file attributes.
|
void |
setFileId(int id)
Set the file identifier
|
void |
setFileInformationFlags(int setFlags)
Set the set file information flags to indicated which values are to be set
|
void |
setFileName(String name)
Set the file name.
|
void |
setFileSize(long siz)
Set the file size in bytes
|
void |
setFileType(int typ)
Set the file type
|
void |
setGid(int id)
Set the owner group id
|
void |
setMode(int mode)
Set the file mode
|
void |
setModifyDateTime(long timesec)
Set the modification date/time for the file.
|
void |
setNetworkFile(NetworkFile netFile)
Set the associated network file
|
void |
setPath(String path)
Set the path
|
void |
setPseudoFile(boolean pseudo)
Set/clear the pseudo file flag
|
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.
|
void |
setUid(int id)
Set the owner user id
|
String |
toString()
Return the file information as a string.
|
public static final int SetFileSize
public static final int SetAllocationSize
public static final int SetAttributes
public static final int SetModifyDate
public static final int SetCreationDate
public static final int SetAccessDate
public static final int SetChangeDate
public static final int SetGid
public static final int SetUid
public static final int SetMode
public static final int SetDeleteOnClose
public static final int FlagDeleteOnClose
public static final int FlagPseudoFile
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 long getAccessDateTime()
public long getAllocationSize()
public int getAllocationSizeInt()
public long getChangeDateTime()
public long getCreationDateTime()
public final boolean hasDeleteOnClose()
public int getFileAttributes()
public final String getFileName()
public final boolean hasShortName()
public final String getShortName()
public final long getModifyDateTime()
public final String getPath()
public final long getSize()
public final int getSizeInt()
public final int getFileId()
public final long getFileIdLong()
public final int getDirectoryId()
public final long getDirectoryIdLong()
public boolean hasAccessDateTime()
public boolean hasChangeDateTime()
public boolean hasCreationDateTime()
public boolean hasModifyDateTime()
public final boolean hasFileAttributes()
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 isTemporary()
public final boolean isArchived()
public boolean isPseudoFile()
public final boolean hasGid()
public final int getGid()
public final boolean hasUid()
public final int getUid()
public final boolean hasMode()
public final int getMode()
public final int isFileType()
public final void resetInfo()
public final void copyFrom(FileInfo finfo)
finfo
- FileInfopublic void setAccessDateTime(long timesec)
timesec
- longpublic void setAllocationSize(long siz)
siz
- longpublic void setChangeDateTime(long timesec)
timesec
- longpublic void setCreationDateTime(long timesec)
timesec
- longpublic final void setDeleteOnClose(boolean del)
del
- booleanpublic final void setPseudoFile(boolean pseudo)
pseudo
- booleanpublic final void setFileAttributes(int attr)
attr
- intpublic final void setFileName(String name)
name
- java.lang.Stringpublic final void setFileSize(long siz)
siz
- longpublic void setModifyDateTime(long timesec)
timesec
- longpublic final void setFileId(int id)
id
- intpublic final void setDirectoryId(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 void setGid(int id)
id
- intpublic final void setUid(int id)
id
- intpublic final void setMode(int mode)
mode
- intpublic final void setFileType(int typ)
typ
- intpublic final void setFileInformationFlags(int setFlags)
setFlags
- intpublic final boolean hasSetFlag(int flag)
flag
- intpublic final int getSetFileInformationFlags()
public final boolean hasNetworkFile()
public final NetworkFile getNetworkFile()
public final void setNetworkFile(NetworkFile netFile)
netFile
- NetworkFileprotected final int getFileFlags()
public final String getSetFileInformationFlagsString()
Copyright © 2005–2018 Alfresco Software. All rights reserved.