org.xmlecho.palomar.broker
Class Files

java.lang.Object
  extended byorg.xmlecho.palomar.broker.Files

public class Files
extends java.lang.Object

Provides locations in the file system.


Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
protected Files()
          have a protected constructor so that no one outside the package can new IrisFileProxy.
 
Method Summary
 void clearCacheDir()
          delete all files in the cache dir
 java.io.File createNewTempDir(java.lang.String local)
          create a new, uniquely named directory for temporary usage by a single thread
 java.io.File createTempFile()
          construct a new, unique File in the tmp directory
static java.lang.String createUniqueFilename(java.lang.String userId)
          construct a phony fiile name that is unique (almost).
static void deleteDir(java.lang.String path)
          delete a directory and all of its included files.
 java.lang.String getCacheDir()
           
 java.lang.String getDtdBase()
           
 java.lang.String getRootPath()
          get the root path of the server
 java.lang.String getTempDir()
           
 java.lang.String getTextIndexDir()
           
 java.lang.String getXfsDir()
           
 void setWebPathBase(java.lang.String webPathBase)
          A servlet will need to call this on init() with info from the ServletConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

Files

protected Files()
have a protected constructor so that no one outside the package can new IrisFileProxy. the only way to get a file proxy is thru resource broker.

Method Detail

getRootPath

public java.lang.String getRootPath()
get the root path of the server


getTextIndexDir

public java.lang.String getTextIndexDir()
Returns:
the path of directory

getXfsDir

public java.lang.String getXfsDir()
Returns:
the path of the XFS file system image

getTempDir

public java.lang.String getTempDir()
Returns:
temporary directory in the file system. temp dir is in $rootPath/$tempSubpath.

createTempFile

public java.io.File createTempFile()
construct a new, unique File in the tmp directory


createNewTempDir

public java.io.File createNewTempDir(java.lang.String local)
create a new, uniquely named directory for temporary usage by a single thread

Parameters:
local - any string -- will become part of the dirname

getDtdBase

public java.lang.String getDtdBase()
Returns:
the path of the DTD directory. the dtd base path is in $rootPath/dtds.

getCacheDir

public java.lang.String getCacheDir()
Returns:
the path of the query cache directory. it stores cached files for all canned queries.

createUniqueFilename

public static java.lang.String createUniqueFilename(java.lang.String userId)
construct a phony fiile name that is unique (almost). the format is: user id + "_" + current time in millisecond + "_" + random float number

Parameters:
userId - user id
Returns:
a unique file name

clearCacheDir

public void clearCacheDir()
delete all files in the cache dir


setWebPathBase

public void setWebPathBase(java.lang.String webPathBase)
A servlet will need to call this on init() with info from the ServletConfig


deleteDir

public static void deleteDir(java.lang.String path)
                      throws java.lang.Exception
delete a directory and all of its included files.

Parameters:
path - directory path
Throws:
java.lang.Exception