twcsckernel.projectbase.io
Class FileFactoryImpl

java.lang.Object
  extended by twcsckernel.projectbase.io.FileFactoryImpl
All Implemented Interfaces:
java.rmi.Remote, FileFactory

public class FileFactoryImpl
extends java.lang.Object
implements FileFactory


Constructor Summary
FileFactoryImpl(FileSecurityManager defaultSecManager, java.util.Collection<LocalFsChangeListener> listeners)
           
 
Method Summary
 boolean canRead(int fileID)
           
 boolean canWrite(int fileID)
           
 boolean createNewFile(int fileID)
           
 boolean delete(int fileID)
           
 boolean disposeFileHandle(int fileID)
           
 boolean exists(int fileID)
           
 FileDescriptor getDescriptor(int fileID)
           
static FileDescriptor getFileDescriptor(java.io.File file)
           
 java.lang.String getName(int fileID)
           
 java.lang.String getParent(int fileID)
           
 java.lang.String getPath(int fileID)
           
 java.lang.String getPathSeparator()
           
 char getPathSeparatorChar()
           
 java.lang.String getSeparator()
           
 char getSeparatorChar()
           
 boolean isDirectory(int fileID)
           
 boolean isFile(int fileID)
           
 boolean isHidden(int fileID)
           
 long lastModified(int fileID)
           
 long length(int fileID)
           
 FileDescriptor[] list(int fileID)
           
 boolean mkdir(int fileID)
           
 boolean mkdirs(int fileID)
           
 RemoteFile newRemoteFile(java.lang.String path)
           
 RemoteFile newRemoteFile(java.lang.String path, FileSecurityManager secManager)
           
 void releaseAllResources()
           
 boolean renameTo(int fileID, java.lang.String newName)
           
 boolean setLastModified(int fileID, long time)
           
 boolean setReadOnly(int fileID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileFactoryImpl

public FileFactoryImpl(FileSecurityManager defaultSecManager,
                       java.util.Collection<LocalFsChangeListener> listeners)
                throws java.lang.NullPointerException
Throws:
java.lang.NullPointerException
Method Detail

newRemoteFile

public RemoteFile newRemoteFile(java.lang.String path)
                         throws java.lang.SecurityException,
                                java.rmi.RemoteException,
                                java.io.IOException
Throws:
java.lang.SecurityException
java.rmi.RemoteException
java.io.IOException

newRemoteFile

public RemoteFile newRemoteFile(java.lang.String path,
                                FileSecurityManager secManager)
                         throws java.lang.SecurityException,
                                java.io.IOException
Throws:
java.lang.SecurityException
java.io.IOException

disposeFileHandle

public boolean disposeFileHandle(int fileID)
                          throws java.rmi.RemoteException
Specified by:
disposeFileHandle in interface FileFactory
Throws:
java.rmi.RemoteException

getSeparatorChar

public char getSeparatorChar()
                      throws java.rmi.RemoteException
Specified by:
getSeparatorChar in interface FileFactory
Throws:
java.rmi.RemoteException

getSeparator

public java.lang.String getSeparator()
                              throws java.rmi.RemoteException
Specified by:
getSeparator in interface FileFactory
Throws:
java.rmi.RemoteException

getPathSeparatorChar

public char getPathSeparatorChar()
                          throws java.rmi.RemoteException
Specified by:
getPathSeparatorChar in interface FileFactory
Throws:
java.rmi.RemoteException

getPathSeparator

public java.lang.String getPathSeparator()
                                  throws java.rmi.RemoteException
Specified by:
getPathSeparator in interface FileFactory
Throws:
java.rmi.RemoteException

getName

public java.lang.String getName(int fileID)
                         throws java.rmi.RemoteException,
                                java.lang.SecurityException,
                                ItemNotFoundException
Specified by:
getName in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

getParent

public java.lang.String getParent(int fileID)
                           throws java.rmi.RemoteException,
                                  java.lang.SecurityException,
                                  ItemNotFoundException
Specified by:
getParent in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

getPath

public java.lang.String getPath(int fileID)
                         throws java.rmi.RemoteException,
                                java.lang.SecurityException,
                                ItemNotFoundException
Specified by:
getPath in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

canRead

public boolean canRead(int fileID)
                throws java.rmi.RemoteException,
                       java.lang.SecurityException,
                       ItemNotFoundException
Specified by:
canRead in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

canWrite

public boolean canWrite(int fileID)
                 throws java.rmi.RemoteException,
                        java.lang.SecurityException,
                        ItemNotFoundException
Specified by:
canWrite in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

exists

public boolean exists(int fileID)
               throws java.rmi.RemoteException,
                      java.lang.SecurityException,
                      ItemNotFoundException
Specified by:
exists in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

isDirectory

public boolean isDirectory(int fileID)
                    throws java.rmi.RemoteException,
                           java.lang.SecurityException,
                           ItemNotFoundException
Specified by:
isDirectory in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

isFile

public boolean isFile(int fileID)
               throws java.rmi.RemoteException,
                      java.lang.SecurityException,
                      ItemNotFoundException
Specified by:
isFile in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

isHidden

public boolean isHidden(int fileID)
                 throws java.rmi.RemoteException,
                        java.lang.SecurityException,
                        ItemNotFoundException
Specified by:
isHidden in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

lastModified

public long lastModified(int fileID)
                  throws java.rmi.RemoteException,
                         java.lang.SecurityException,
                         ItemNotFoundException
Specified by:
lastModified in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

length

public long length(int fileID)
            throws java.rmi.RemoteException,
                   java.lang.SecurityException,
                   ItemNotFoundException
Specified by:
length in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

createNewFile

public boolean createNewFile(int fileID)
                      throws java.rmi.RemoteException,
                             java.lang.SecurityException,
                             ItemNotFoundException,
                             java.io.IOException
Specified by:
createNewFile in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException
java.io.IOException

delete

public boolean delete(int fileID)
               throws java.rmi.RemoteException,
                      java.lang.SecurityException,
                      ItemNotFoundException
Specified by:
delete in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

list

public FileDescriptor[] list(int fileID)
                      throws java.rmi.RemoteException,
                             java.lang.SecurityException,
                             ItemNotFoundException
Specified by:
list in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

mkdir

public boolean mkdir(int fileID)
              throws java.rmi.RemoteException,
                     java.lang.SecurityException,
                     ItemNotFoundException
Specified by:
mkdir in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

mkdirs

public boolean mkdirs(int fileID)
               throws java.rmi.RemoteException,
                      java.lang.SecurityException,
                      ItemNotFoundException
Specified by:
mkdirs in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

renameTo

public boolean renameTo(int fileID,
                        java.lang.String newName)
                 throws java.rmi.RemoteException,
                        java.lang.SecurityException,
                        ItemNotFoundException
Specified by:
renameTo in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

setLastModified

public boolean setLastModified(int fileID,
                               long time)
                        throws java.rmi.RemoteException,
                               java.lang.SecurityException,
                               ItemNotFoundException
Specified by:
setLastModified in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

setReadOnly

public boolean setReadOnly(int fileID)
                    throws java.rmi.RemoteException,
                           java.lang.SecurityException,
                           ItemNotFoundException
Specified by:
setReadOnly in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

getDescriptor

public FileDescriptor getDescriptor(int fileID)
                             throws java.rmi.RemoteException,
                                    java.lang.SecurityException,
                                    ItemNotFoundException
Specified by:
getDescriptor in interface FileFactory
Throws:
java.rmi.RemoteException
java.lang.SecurityException
ItemNotFoundException

releaseAllResources

public void releaseAllResources()

getFileDescriptor

public static FileDescriptor getFileDescriptor(java.io.File file)


Copyright © 2005-2006 CS@PUT. All Rights Reserved.