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.


Constructor Index

 o FSPutil()

Method Index

 o download(FSPsession, String, OutputStream, long, long)
Downloads a file from FSP server.
 o list(FSPsession, String)
get a file list from server.
 o stat(FSPsession, String)
Gets information about file or directory.
 o statlist(FSPsession, String)
get a stat list from server.
 o statSupported(FSPsession)
check if FSP server supports CC_STAT command.
 o stringToASCIIZ(String)
Converts String to ASCIIZ byte array.

Constructors

 o FSPutil
 public FSPutil()

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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