Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.io.xfile
Class FlexXFile  view FlexXFile download FlexXFile.java

java.lang.Object
  extended bycom.flexstor.common.io.xfile.FlexXFile

public class FlexXFile
extends java.lang.Object

This subclass of XFile overwrites some methods which otherwise will fail if: - The protocol used is a NFS URL and the path specified is mounted from another server OR - The path contains some escape codes and special characters that must be preserved. Inside these overwriten methods we first determine if the path is a NFS URL; if it is, use the super class method; if that fails and the file is local to the JVM server we create a new XFile instance (not FlexXFile) with a local path as argument where all special characters have been replaced. David C. 03/01/00


Field Summary
private  FlexXFileI iFile
           
private  java.lang.String sProtocol
           
 
Constructor Summary
FlexXFile(FlexXFile file, java.lang.String str)
           
FlexXFile(java.lang.String str)
           
 
Method Summary
 boolean canRead()
           
 boolean canWrite()
           
 boolean delete()
           
 boolean exists()
           
 java.lang.String[] extendedList()
           
 java.lang.String[] extendedList(XFilenameFilter filter)
           
 java.lang.String getAbsolutePath()
           
 java.io.BufferedInputStream getBufferedInputStream()
           
 java.io.BufferedInputStream getBufferedInputStream(int bufferSize)
           
 java.io.BufferedOutputStream getBufferedOutputStream()
           
 java.io.BufferedOutputStream getBufferedOutputStream(int bufferSize)
           
 java.io.BufferedReader getBufferedReader()
           
 java.io.BufferedReader getBufferedReader(int bufferSize)
           
 java.io.BufferedWriter getBufferedWriter()
           
 java.io.BufferedWriter getBufferedWriter(int bufferSize)
           
 java.lang.String getFileSeparator()
           
static java.lang.String getFileSeparator(java.lang.String sFile)
           
 java.lang.String getFileSystemName()
           
 java.lang.String getLocalParent()
           
 java.lang.String getLocalPath()
          Returns the local path; if this is a NFS URL, it will return the path, without the nfs://sServer portion.
 java.lang.String getLocalUNCPath()
          Returns the path of this file as a UNC (Universal Naming Convension), excluding the server name.
 java.lang.String getName()
           
 java.lang.String getParent()
           
 java.lang.String getPath()
           
 java.lang.String getServer()
           
 java.lang.String getUNCPath()
          Returns the path of this file as a UNC (Universal Naming Convension) e.g.
 com.flexstor.common.io.xfile.webnfs.WebNfsFile getWebNFSFile()
           
 FlexXFileI getXFile()
           
 boolean isAbsolute()
           
 boolean isDirectory()
           
 boolean isFile()
           
 boolean isLocalPath()
          Returns true if the files resides in this server; false otherwise
 long lastModified()
           
 long length()
           
 java.lang.String[] list()
           
 java.lang.String[] list(XFilenameFilter filter)
           
 boolean mkdir()
           
 boolean mkdirs()
           
 boolean renameTo(FlexXFile xFile)
           
static java.lang.String toProper(java.lang.String sProtocol)
          Takes the protocol and capitalizes its first letter WebNfs is a special case which will be handled separate from the others since we need to capitalize both the 'W' and the 'N' and because the protocol could be either webnfs or nfs.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

iFile

private FlexXFileI iFile

sProtocol

private java.lang.String sProtocol
Constructor Detail

FlexXFile

public FlexXFile(FlexXFile file,
                 java.lang.String str)

FlexXFile

public FlexXFile(java.lang.String str)
Method Detail

extendedList

public java.lang.String[] extendedList()

extendedList

public java.lang.String[] extendedList(XFilenameFilter filter)

getXFile

public FlexXFileI getXFile()

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream()
                                                   throws java.io.IOException

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream(int bufferSize)
                                                   throws java.io.IOException

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream(int bufferSize)
                                                     throws java.io.IOException

getBufferedReader

public java.io.BufferedReader getBufferedReader(int bufferSize)
                                         throws java.io.IOException

getBufferedWriter

public java.io.BufferedWriter getBufferedWriter(int bufferSize)
                                         throws java.io.IOException

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream()
                                                     throws java.io.IOException

getBufferedReader

public java.io.BufferedReader getBufferedReader()
                                         throws java.io.IOException

getBufferedWriter

public java.io.BufferedWriter getBufferedWriter()
                                         throws java.io.IOException

getWebNFSFile

public com.flexstor.common.io.xfile.webnfs.WebNfsFile getWebNFSFile()

getPath

public java.lang.String getPath()

getFileSystemName

public java.lang.String getFileSystemName()

list

public java.lang.String[] list(XFilenameFilter filter)

list

public java.lang.String[] list()

mkdir

public boolean mkdir()

mkdirs

public boolean mkdirs()

getName

public java.lang.String getName()

getParent

public java.lang.String getParent()

exists

public boolean exists()

canRead

public boolean canRead()

canWrite

public boolean canWrite()

isDirectory

public boolean isDirectory()

isFile

public boolean isFile()

isAbsolute

public boolean isAbsolute()

lastModified

public long lastModified()

length

public long length()

delete

public boolean delete()

renameTo

public boolean renameTo(FlexXFile xFile)

getServer

public java.lang.String getServer()

getLocalPath

public java.lang.String getLocalPath()
Returns the local path; if this is a NFS URL, it will return the path, without the nfs://sServer portion.


isLocalPath

public boolean isLocalPath()
Returns true if the files resides in this server; false otherwise


getLocalParent

public java.lang.String getLocalParent()

getUNCPath

public java.lang.String getUNCPath()
Returns the path of this file as a UNC (Universal Naming Convension) e.g. \\SERVER_NAME\location\filename


getLocalUNCPath

public java.lang.String getLocalUNCPath()
Returns the path of this file as a UNC (Universal Naming Convension), excluding the server name. e.g. \location\filename


getAbsolutePath

public java.lang.String getAbsolutePath()

getFileSeparator

public static java.lang.String getFileSeparator(java.lang.String sFile)

toProper

public static java.lang.String toProper(java.lang.String sProtocol)
Takes the protocol and capitalizes its first letter WebNfs is a special case which will be handled separate from the others since we need to capitalize both the 'W' and the 'N' and because the protocol could be either webnfs or nfs.


getFileSeparator

public java.lang.String getFileSeparator()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).