Package adams.core.io
Class SmbFileObject
- java.lang.Object
-
- adams.core.io.SmbFileObject
-
- All Implemented Interfaces:
FileObject
,Serializable
,Comparable<FileObject>
public class SmbFileObject extends Object implements FileObject
Wrapper for remote SMB files.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Boolean
m_Directory
whether a directory.protected jcifs.smb.SmbFile
m_File
the actual file.protected Boolean
m_Hidden
whether the file is hidden.protected Date
m_LastModified
the modified date.protected Long
m_Length
the length.
-
Constructor Summary
Constructors Constructor Description SmbFileObject(jcifs.smb.SmbFile file)
Initializes the wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(FileObject o)
Returns whether this file object is the same as the provided one.boolean
equals(Object obj)
Checks whether this object is the same as the provided one.File
getActualFile()
Returns the actual target (if possible) in case of a link.File
getFile()
Returns the wrapped file.Date
getLastModified()
Returns the date when the file was last modified.long
getLength()
Returns the size of the file.String
getName()
Returns the file name.boolean
isDirectory()
Returns whether the file represents a directory.boolean
isHidden()
Returns whether the file is hidden.boolean
isLink()
Returns whether the file represents a link.boolean
isLocal()
Returns whether the file is a local file.String
toString()
Returns the long name.
-
-
-
Field Detail
-
m_File
protected jcifs.smb.SmbFile m_File
the actual file.
-
m_Length
protected Long m_Length
the length.
-
m_Directory
protected Boolean m_Directory
whether a directory.
-
m_LastModified
protected Date m_LastModified
the modified date.
-
m_Hidden
protected Boolean m_Hidden
whether the file is hidden.
-
-
Method Detail
-
getFile
public File getFile()
Returns the wrapped file.- Specified by:
getFile
in interfaceFileObject
- Returns:
- the file as UNC path
-
getActualFile
public File getActualFile()
Returns the actual target (if possible) in case of a link.- Specified by:
getActualFile
in interfaceFileObject
- Returns:
- the actual file as UNC path
-
getName
public String getName()
Returns the file name.- Specified by:
getName
in interfaceFileObject
- Returns:
- the name
-
getLength
public long getLength()
Returns the size of the file.- Specified by:
getLength
in interfaceFileObject
- Returns:
- the size
-
isDirectory
public boolean isDirectory()
Returns whether the file represents a directory.- Specified by:
isDirectory
in interfaceFileObject
- Returns:
- true if directory
-
getLastModified
public Date getLastModified()
Returns the date when the file was last modified.- Specified by:
getLastModified
in interfaceFileObject
- Returns:
- date when last modified
-
isHidden
public boolean isHidden()
Returns whether the file is hidden.- Specified by:
isHidden
in interfaceFileObject
- Returns:
- true if hidden
-
isLink
public boolean isLink()
Returns whether the file represents a link.- Specified by:
isLink
in interfaceFileObject
- Returns:
- true if link
-
isLocal
public boolean isLocal()
Returns whether the file is a local file.- Specified by:
isLocal
in interfaceFileObject
- Returns:
- true if local
-
toString
public String toString()
Returns the long name.- Specified by:
toString
in interfaceFileObject
- Overrides:
toString
in classObject
- Returns:
- the long name, not UNC path!
-
compareTo
public int compareTo(FileObject o)
Returns whether this file object is the same as the provided one.- Specified by:
compareTo
in interfaceComparable<FileObject>
- Parameters:
o
- the file object to compare against- Returns:
- less than zero, equal to zero, greater than zero if this file object is less than, equal to, or greater than the other file object
-
equals
public boolean equals(Object obj)
Checks whether this object is the same as the provided one.- Overrides:
equals
in classObject
- Parameters:
obj
- the object to compare against- Returns:
- true if the same
- See Also:
compareTo(FileObject)
-
-