maspack.fileutil
Class FileCacher

java.lang.Object
  extended by maspack.fileutil.FileCacher

public class FileCacher
extends java.lang.Object


Constructor Summary
FileCacher()
           
 
Method Summary
 void addAuthenticator(URIxMatcher matcher, org.apache.commons.vfs2.UserAuthenticator auth)
           
 void addIdentityRepository(URIxMatcher matcher, com.jcraft.jsch.IdentityRepository repo)
           
 java.io.File cache(URIx uri, java.io.File cacheFile)
           
 java.io.File cache(URIx uri, java.io.File cacheFile, FileTransferMonitor monitor)
           
 java.io.File cache(URIx uri, java.lang.String cachePath)
           
 long getFileSize(java.io.File file)
           
 long getFileSize(URIx uri)
          Returns the size of the specified file
 java.io.InputStream getInputStream(URIx uri)
           
 void initialize()
           
 void release()
           
static void setAuthenticator(org.apache.commons.vfs2.FileSystemOptions opts, org.apache.commons.vfs2.UserAuthenticator auth)
           
static void setDefaultFsOptions(org.apache.commons.vfs2.FileSystemOptions opts)
           
static void setIdentityFactory(org.apache.commons.vfs2.FileSystemOptions opts, org.apache.commons.vfs2.provider.sftp.IdentityRepositoryFactory factory)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileCacher

public FileCacher()
Method Detail

initialize

public void initialize()
                throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException

release

public void release()

addAuthenticator

public void addAuthenticator(URIxMatcher matcher,
                             org.apache.commons.vfs2.UserAuthenticator auth)

addIdentityRepository

public void addIdentityRepository(URIxMatcher matcher,
                                  com.jcraft.jsch.IdentityRepository repo)

setDefaultFsOptions

public static void setDefaultFsOptions(org.apache.commons.vfs2.FileSystemOptions opts)
                                throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException

setAuthenticator

public static void setAuthenticator(org.apache.commons.vfs2.FileSystemOptions opts,
                                    org.apache.commons.vfs2.UserAuthenticator auth)
                             throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException

setIdentityFactory

public static void setIdentityFactory(org.apache.commons.vfs2.FileSystemOptions opts,
                                      org.apache.commons.vfs2.provider.sftp.IdentityRepositoryFactory factory)
                               throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException

cache

public java.io.File cache(URIx uri,
                          java.lang.String cachePath)
                   throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException

getFileSize

public long getFileSize(URIx uri)
Returns the size of the specified file


getFileSize

public long getFileSize(java.io.File file)

cache

public java.io.File cache(URIx uri,
                          java.io.File cacheFile)
                   throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException

cache

public java.io.File cache(URIx uri,
                          java.io.File cacheFile,
                          FileTransferMonitor monitor)
                   throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException

getInputStream

public java.io.InputStream getInputStream(URIx uri)
                                   throws org.apache.commons.vfs2.FileSystemException
Throws:
org.apache.commons.vfs2.FileSystemException