|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.starla.smb.SMBSession | +--com.starla.smb.SMBDiskSession
The SMBDiskSession class provides disk, directory and file related methods on a remote disk share.
The disk session maintains a current working directory, initially set from the PCShare object that was used to open the disk session. Methods such as CreateDirectory (), DeleteDirectory (), OpenFile () etc. will prepend the working directory string to the specified file or directory string, unless the specified file or directory contains a path. The current working directory can be changed using the setWorkingDirectory () method.
A disk session is created using the SMBSessionFactory OpenDiskSession () method. The SMBSessionFactory negotiates the appropriate SMB dialect with the remote server and creates the appropriate SMBDiskSession derived object.
Field Summary | |
static int |
Attributes
Set the file attributes, via the setFileInformation () method |
static int |
WriteDate
Set the file write date, via the setFileInformation () method |
static int |
WriteTime
Set the file write time, via the setFileInformation () method |
Fields inherited from class com.starla.smb.SMBSession |
DBGDumpPacket,
DBGHexDump,
DBGPacketType,
DEFAULT_BUFSIZE,
EncryptPass,
RawRead,
RawWrite,
UserMode |
Method Summary | |
abstract void |
CloseSession()
Close this connection with the remote server share. |
abstract boolean |
CreateDirectory(java.lang.String dir)
Createa new directory on the remote file server. |
abstract boolean |
DeleteDirectory(java.lang.String dir)
Delete the specified directory on the remote file server. |
void |
DeleteFile(java.lang.String fname)
Delete the specified file on the remote file server. |
abstract void |
DeleteFile(java.lang.String fname,
int attr)
Delete the specified file on the remote file server. |
boolean |
FileExists(java.lang.String fname)
Check if a file exists on the remote file server. |
abstract SMBDiskInfo |
getDiskInformation()
Get disk information for this remote disk. |
abstract SMBFileInfo |
getFileInformation(java.lang.String fname)
Get file information for the specified file. |
java.lang.String |
getWorkingDirectory()
Get the current working directory, relative to the share that is being accessed. |
boolean |
isClosed()
Detemine if the disk session has been closed. |
abstract boolean |
isDirectory(java.lang.String dir)
Check if the specified file name is a directory. |
abstract SMBFile |
OpenFile(java.lang.String fname,
int flags)
Open a file on the remote file server. |
SMBInputStream |
OpenInputStream(java.lang.String fname,
int flags)
Open a file as an input stream. |
SMBOutputStream |
OpenOutputStream(java.lang.String fname,
int flags)
Open a file as an output stream. |
boolean |
RenameFile(java.lang.String curnam,
java.lang.String newnam)
Rename a file, or set of files, on the remote file server. |
abstract boolean |
RenameFile(java.lang.String curnam,
java.lang.String newnam,
int attr)
Rename a file, or set of files, on the remote file server. |
abstract void |
setFileInformation(java.lang.String fname,
SMBFileInfo finfo,
int flags)
Set file information for the specified file. |
void |
setWorkingDirectory(java.lang.String wd)
Set the current working directory, relative to the share that is being accessed. |
abstract SMBSearchContext |
StartSearch(java.lang.String dir,
int attr)
Start a search of the specified directory returning information for each file/directory found. |
Methods inherited from class com.starla.smb.SMBSession |
getDeviceType,
getDialect,
getDomain,
getEncryptionKey,
getLANManagerType,
getMaximumPacketSize,
getOperatingSystem,
getPassword,
getServer,
getSessionFlag,
getSessionId,
getShareName,
getUserId,
getUserName,
hasDebugOption,
isActive,
isDebug,
print,
println,
println,
setDebug,
setEncryptionKey,
setRawMode,
setSecurityMode,
toString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int Attributes
public static final int WriteTime
public static final int WriteDate
Method Detail |
public abstract void CloseSession() throws java.io.IOException
public abstract boolean CreateDirectory(java.lang.String dir) throws java.io.IOException
dir
- Directory name string. If the directory name does not have
a leading '\' the current working directory for this session
will be prepended to the string.public abstract boolean DeleteDirectory(java.lang.String dir) throws java.io.IOException
dir
- Directory name string. If the directory name does not have
a leading '\' the current working directory for this session
will be preprended to the string.public void DeleteFile(java.lang.String fname) throws java.io.IOException
fname
- File name of the remote file to delete. If the file name does
not have a leading '\' the current working directory for this
session will be prepended to the string. The string may contain
wildcard characters to delete multiple files. '?' matches a single
character and '*' matches none, one or more characters.public abstract void DeleteFile(java.lang.String fname, int attr) throws java.io.IOException
fname
- File name of the remote file to delete. If the file name does
not have a leading '\' the current working directory for this
session will be prepended to the string. The string may contain
wildcard characters to delete multiple files. '?' matches a single
character and '*' matches none, one or more characters.attr
- File attributes of the file(s) to delete.public boolean FileExists(java.lang.String fname)
fname
- File name to test for on the remote file server. If the file
name does not start with a '\' then the working directory is
prepended to the file name string.public abstract SMBDiskInfo getDiskInformation() throws java.io.IOException
public abstract SMBFileInfo getFileInformation(java.lang.String fname) throws java.io.IOException, java.io.FileNotFoundException
fname
- File name of the file to return information for.public final java.lang.String getWorkingDirectory()
public final boolean isClosed()
public abstract boolean isDirectory(java.lang.String dir) throws java.io.IOException
dir
- Directory name string. If the directory name does not have
a leading '\' the current working directory for this session
will be preprended to the string.public abstract SMBFile OpenFile(java.lang.String fname, int flags) throws java.io.IOException
fname
- Remote file name string.flags
- File open option flags.public SMBInputStream OpenInputStream(java.lang.String fname, int flags) throws java.io.IOException
fname
- Remote file name string.flags
- File open option flags.public SMBOutputStream OpenOutputStream(java.lang.String fname, int flags) throws java.io.IOException
fname
- Remote file name string.flags
- File open option flags.public boolean RenameFile(java.lang.String curnam, java.lang.String newnam) throws java.io.IOException
curnam
- Current file name string, may contain wildcards.newnam
- New file name.attr
- Search attributes, to determine which file(s) to rename.public abstract boolean RenameFile(java.lang.String curnam, java.lang.String newnam, int attr) throws java.io.IOException
curnam
- Current file name string, may contain wildcards.newnam
- New file name.attr
- Search attributes, to determine which file(s) to rename.public abstract void setFileInformation(java.lang.String fname, SMBFileInfo finfo, int flags) throws java.io.IOException
fname
- File name of the file to set information for.finfo
- File information containing the new values.flags
- Bit mask of the information to set.public final void setWorkingDirectory(java.lang.String wd)
wd
- Working directory path string.public abstract SMBSearchContext StartSearch(java.lang.String dir, int attr) throws java.io.IOException
dir
- Directory/file name string, which may contain wildcards. If the
directory string does not start with a '\' then the directory
name is prepended with the current working directory.attr
- Search attributes, to determine the types of files/directories
returned.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |