com.spss.psapi.resource

Interface ServerFileSystem



  • public interface ServerFileSystem
    This encapsulates the functionality for representing the file system on the data mining server's host.
    Since:
    PSAPI 1.0
    Version:
    1.0
    Author:
    Julian Clinton, Rob Duncan
    Specification Status:
    Under Development
    • Method Detail

      • getPathSeparatorChar

        char getPathSeparatorChar()
        Returns the path separator character for this file system. On Windows, this ';' and on UNIX, this is ':'.
        Returns:
        the path separator character
        See Also:
        getPathSeparator()
      • getPathSeparator

        java.lang.String getPathSeparator()
        Returns a string version of the path separator character.
        Returns:
        the path separator
        See Also:
        getPathSeparatorChar()
      • getSeparatorChar

        char getSeparatorChar()
        Returns the separator character for this file system. On Windows, this '\' and on UNIX, this is '/'.
        Returns:
        the separator character
        See Also:
        getSeparator()
      • getSeparator

        java.lang.String getSeparator()
        Returns a string version of the separator character.
        Returns:
        the separator
        See Also:
        getSeparatorChar()
      • getServerFile

        ServerFile getServerFile(java.lang.String filename)
        Returns a server file for the corresponding file name.
        Parameters:
        filename - a name of a file or folder
        Returns:
        a ServerFile object.
      • getAbsoluteServerFile

        ServerFile getAbsoluteServerFile(ServerFile file)
                                         throws ServerResourceException
        Returns a file representing the absolute pathname or null if the absolute path cannot be determined.
        Parameters:
        file - a ServerFile object
        Returns:
        a file representing the absolute pathname
        Throws:
        ServerResourceException - if the server file system cannot be accessed
      • getAbsolutePath

        java.lang.String getAbsolutePath(ServerFile file)
                                         throws ServerResourceException
        Returns the absolute pathname or null if the absolute path cannot be determined.
        Parameters:
        file - a ServerFile object
        Returns:
        the absolute pathname
        Throws:
        ServerResourceException - if the server file system cannot be accessed
      • getParentDirectory

        ServerFile getParentDirectory(ServerFile file)
        Returns the parent directory of a file in the file system
        Parameters:
        file - a ServerFile object
        Returns:
        a ServerFile object representing the parent directory
      • getChild

        ServerFile getChild(ServerFile parent,
                          java.lang.String filename)
                            throws ServerResourceException
        Returns the named child in the supplied parent.
        Parameters:
        parent - a ServerFile object repesenting a directory or special folder
        filename - a name of a file or folder which exists in parent
        Returns:
        a ServerFile object.
        Throws:
        ServerResourceException - if the server file system cannot be accessed
      • directoryOrFileExists

        boolean directoryOrFileExists(ServerFile path,
                                    boolean isDirectory)
                                      throws ServerResourceException
        Returns whether a directory or file exists.
        Parameters:
        path - Pathname to check
        isDirectory - Set to true if the path to be tested should be a directory
        Returns:
        whether a directory or file exists.
        Throws:
        ServerResourceException - if the server file system cannot be accessed
      • getSize

        long getSize(ServerFile file)
                     throws ServerResourceException
        Returns the size, in bytes, of the specified file in this file system. Returns 0 if the file does not exist or is not accessible, or -1 if the file is accessible but the server does not support the file size operation. The result is undefined when the file denotes a directory.
        Parameters:
        file - the file
        Returns:
        the size of the file, in bytes
        Throws:
        ServerResourceException - if the file system cannot be accessed
        Since:
        PSAPI 15.0.0.1
      • createTemporaryFile

        ServerFile createTemporaryFile(java.lang.String name)
                                       throws ServerResourceException
        Creates a new file with a unique name in the server's temporary file space. The file is empty and can be written by the creator. The specified name will be used as the starting point for generating a unique name for the file, and if the name has an extension it will be left unchanged. The file must be deleted when it is no longer needed.
        Parameters:
        name - the suggested name of the new file
        Returns:
        a new temporary file
        Throws:
        ServerResourceException - if the file cannot be created for any reason
        Since:
        PSAPI 16.0

(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.