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

Quick Search    Search Deep

com.flexstor.common.io.xfile.webnfs
Class WebNfsFile  view WebNfsFile download WebNfsFile.java

java.lang.Object
  extended byXFile
      extended bycom.flexstor.common.io.xfile.webnfs.WebNfsFile
All Implemented Interfaces:
com.flexstor.common.io.xfile.FlexXFileI

public class WebNfsFile
extends XFile
implements com.flexstor.common.io.xfile.FlexXFileI

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  boolean bLocalFile
           
private  boolean bSolaris
           
private static java.lang.String sLocalHost
           
private  java.lang.String sLocalPath
           
private  java.lang.String sServer
           
 
Constructor Summary
WebNfsFile(java.lang.String str)
           
WebNfsFile(XFile file, java.lang.String str)
           
 
Method Summary
 boolean canRead()
           
 boolean canWrite()
           
 boolean delete()
           
protected static java.lang.String encodeURLString(java.lang.String str)
          Replace occurrencies of special characters with its % translation Make sure to call this method before passing the file path argument to the super constructor.
 boolean exists()
           
 java.lang.String[] extendedList()
           
 java.lang.String[] extendedList(com.flexstor.common.io.xfile.XFilenameFilterI filter)
           
 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 getLocalParent()
           
 java.lang.String getLocalPath()
          returns 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 getServer()
           
 java.lang.String getUNCPath()
          Returns the path of this file as a UNC (Universal Naming Convension) e.g.
 boolean isAbsolute()
           
 boolean isDirectory()
           
 boolean isFile()
           
 boolean isLocalPath()
          Returns true if the files resides in this server; false otherwise
 boolean isOSSolaris()
          Returns true if the OS is Solaris
 long lastModified()
           
 long length()
           
 java.lang.String[] list()
           
 java.lang.String[] list(com.flexstor.common.io.xfile.XFilenameFilterI filter)
           
 boolean mkdir()
           
 boolean mkdirs()
           
 boolean renameTo(com.flexstor.common.io.xfile.FlexXFileI xFile)
           
private  void setServerAndPath(java.lang.String sFile)
          Set the information for the Server DNS and local path (without the nfs://server portion)
 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
 
Methods inherited from interface com.flexstor.common.io.xfile.FlexXFileI
getAbsolutePath, getFileSystemName, getPath
 

Field Detail

sServer

private java.lang.String sServer

sLocalPath

private java.lang.String sLocalPath

bSolaris

private boolean bSolaris

bLocalFile

private boolean bLocalFile

sLocalHost

private static java.lang.String sLocalHost
Constructor Detail

WebNfsFile

public WebNfsFile(XFile file,
                  java.lang.String str)

WebNfsFile

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

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream()
                                                   throws java.io.IOException
Specified by:
getBufferedInputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedInputStream

public java.io.BufferedInputStream getBufferedInputStream(int bufferSize)
                                                   throws java.io.IOException
Specified by:
getBufferedInputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream()
                                                     throws java.io.IOException
Specified by:
getBufferedOutputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedOutputStream

public java.io.BufferedOutputStream getBufferedOutputStream(int bufferSize)
                                                     throws java.io.IOException
Specified by:
getBufferedOutputStream in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedReader

public java.io.BufferedReader getBufferedReader()
                                         throws java.io.IOException
Specified by:
getBufferedReader in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedReader

public java.io.BufferedReader getBufferedReader(int bufferSize)
                                         throws java.io.IOException
Specified by:
getBufferedReader in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedWriter

public java.io.BufferedWriter getBufferedWriter()
                                         throws java.io.IOException
Specified by:
getBufferedWriter in interface com.flexstor.common.io.xfile.FlexXFileI

getBufferedWriter

public java.io.BufferedWriter getBufferedWriter(int bufferSize)
                                         throws java.io.IOException
Specified by:
getBufferedWriter in interface com.flexstor.common.io.xfile.FlexXFileI

list

public java.lang.String[] list(com.flexstor.common.io.xfile.XFilenameFilterI filter)
Specified by:
list in interface com.flexstor.common.io.xfile.FlexXFileI

list

public java.lang.String[] list()
Specified by:
list in interface com.flexstor.common.io.xfile.FlexXFileI

mkdir

public boolean mkdir()
Specified by:
mkdir in interface com.flexstor.common.io.xfile.FlexXFileI

mkdirs

public boolean mkdirs()
Specified by:
mkdirs in interface com.flexstor.common.io.xfile.FlexXFileI

extendedList

public java.lang.String[] extendedList()
Specified by:
extendedList in interface com.flexstor.common.io.xfile.FlexXFileI

extendedList

public java.lang.String[] extendedList(com.flexstor.common.io.xfile.XFilenameFilterI filter)
Specified by:
extendedList in interface com.flexstor.common.io.xfile.FlexXFileI

getName

public java.lang.String getName()
Specified by:
getName in interface com.flexstor.common.io.xfile.FlexXFileI

getParent

public java.lang.String getParent()
Specified by:
getParent in interface com.flexstor.common.io.xfile.FlexXFileI

exists

public boolean exists()
Specified by:
exists in interface com.flexstor.common.io.xfile.FlexXFileI

canRead

public boolean canRead()
Specified by:
canRead in interface com.flexstor.common.io.xfile.FlexXFileI

canWrite

public boolean canWrite()
Specified by:
canWrite in interface com.flexstor.common.io.xfile.FlexXFileI

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in interface com.flexstor.common.io.xfile.FlexXFileI

isFile

public boolean isFile()
Specified by:
isFile in interface com.flexstor.common.io.xfile.FlexXFileI

isAbsolute

public boolean isAbsolute()
Specified by:
isAbsolute in interface com.flexstor.common.io.xfile.FlexXFileI

lastModified

public long lastModified()
Specified by:
lastModified in interface com.flexstor.common.io.xfile.FlexXFileI

length

public long length()
Specified by:
length in interface com.flexstor.common.io.xfile.FlexXFileI

delete

public boolean delete()
Specified by:
delete in interface com.flexstor.common.io.xfile.FlexXFileI

renameTo

public boolean renameTo(com.flexstor.common.io.xfile.FlexXFileI xFile)
Specified by:
renameTo in interface com.flexstor.common.io.xfile.FlexXFileI

getServer

public java.lang.String getServer()
Specified by:
getServer in interface com.flexstor.common.io.xfile.FlexXFileI

getLocalPath

public java.lang.String getLocalPath()
returns the path, without the nfs://sServer portion.

Specified by:
getLocalPath in interface com.flexstor.common.io.xfile.FlexXFileI

isLocalPath

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

Specified by:
isLocalPath in interface com.flexstor.common.io.xfile.FlexXFileI

isOSSolaris

public boolean isOSSolaris()
Returns true if the OS is Solaris


getLocalParent

public java.lang.String getLocalParent()
Specified by:
getLocalParent in interface com.flexstor.common.io.xfile.FlexXFileI

getUNCPath

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

Specified by:
getUNCPath in interface com.flexstor.common.io.xfile.FlexXFileI

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

Specified by:
getLocalUNCPath in interface com.flexstor.common.io.xfile.FlexXFileI

setServerAndPath

private void setServerAndPath(java.lang.String sFile)
Set the information for the Server DNS and local path (without the nfs://server portion)


encodeURLString

protected static java.lang.String encodeURLString(java.lang.String str)
Replace occurrencies of special characters with its % translation Make sure to call this method before passing the file path argument to the super constructor.


getFileSeparator

public java.lang.String getFileSeparator()
Specified by:
getFileSeparator in interface com.flexstor.common.io.xfile.FlexXFileI

getFileSeparator

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

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()).