All Packages Class Hierarchy This Package Previous Next Index
Class net.fsp.FSPutil
java.lang.Object
|
+----net.fsp.FSPutil
- public class FSPutil
- extends Object
Utilities for easier working with FSP.
There are some higher level function for working with FSP.
-
FSPutil()
-
-
download(FSPsession, String, OutputStream, long, long)
- Downloads a file from FSP server.
-
list(FSPsession, String)
- get a file list from server.
-
stat(FSPsession, String)
- Gets information about file or directory.
-
statlist(FSPsession, String)
- get a stat list from server.
-
statSupported(FSPsession)
- check if FSP server supports CC_STAT command.
-
stringToASCIIZ(String)
- Converts String to ASCIIZ byte array.
FSPutil
public FSPutil()
download
public static void download(FSPsession session,
String filename,
OutputStream os,
long start_from,
long byteswanted) throws IOException
- Downloads a file from FSP server.
This procedure download a file from FSP server, file is written to
OutputStream. OutputStream is not closed at end of transfer.
- Parameters:
- session - active FSP session
- filename - filename on FSP server
- os - write file to this stream
- start_from - offset where to start dowload
- byteswanted - how many bytes to download, < 0 for all
stat
public static FSPstat stat(FSPsession ses,
String path) throws IOException
- Gets information about file or directory.
This function requests information about specific path from FSP server.
Server must support CC_STAT command, which is supported from FSP 2.8.1
Beta 11.
- Parameters:
- session - FSPsession
- path - path for getting information
- Returns:
- stat object or null if file is not found
- See Also:
- FSPstat
statSupported
public static boolean statSupported(FSPsession ses) throws IOException
- check if FSP server supports CC_STAT command.
- Parameters:
- ses - FSPsession
- Returns:
- true if CC_STAT command is supported
stringToASCIIZ
public static byte[] stringToASCIIZ(String filename)
- Converts String to ASCIIZ byte array.
- Parameters:
- filename - string to be converted
- Returns:
- converted byte array NULL terminated
list
public static String[] list(FSPsession session,
String directory)
- get a file list from server.
- Parameters:
- session - live FSPsession
- directory - directory to be listed
- Returns:
- file list or null on error
statlist
public static FSPstat[] statlist(FSPsession session,
String directory)
- get a stat list from server.
- Parameters:
- session - live FSPsession
- directory - directory to be listed
- Returns:
- stat list or null on error
All Packages Class Hierarchy This Package Previous Next Index