class: ResourceUtil

public class: ResourceUtil
Author: franke (initial creation)
Project: Phase: 1.0; Status: Proposed; Version: $Revision: 1568 $ $LastChangedDate: 2009-02-16 22:; Complexity: 1
Dates: Created: 16.07.2009 15:12:28; Modified: 16.07.2009 15:12:28;
Flags: Active: false; IsRoot: false; IsLeaf: false;
Extension Points:
UUID: {E2F9D0A1-FD84-4fc5-A133-A95B439A10D5}
Utility class to deal with resources such as files and directories. Either on the file system or in jar files.
 

Goto: Custom Properties, Fields, Methods

Appears in: utils

Custom Properties
 
ResourceUtil Attributes
Attribute Details
public static const String
  CITATIONSTYLES_DIRECTORY
Initial: "CitationStyles/"
public static const String
  CLASS_DIRECTORY
Initial: "target/classes/"
public static const String
  DATASOURCES_DIRECTORY
Initial: "DataSources/"
public static const String
  EXPLAIN_FILE
Initial: "explain-styles.xml"
public static const String
  FONTSTYLES_FILENAME
Initial: "FontStyles"
private static const Logger
  logger
Initial: Logger.getLogger(ResourceUtil.class)
public static const String
  RESOURCES_DIRECTORY_JAR
Initial: ""
Notes: public final static String RESOURCES_DIRECTORY_JAR = "resources/";
public static const String
  RESOURCES_DIRECTORY_LOCAL
Initial: "src/main/resources/"
public static const String
  SCHEMAS_DIRECTORY
Initial: "Schemas/"
public static const String
  SORTINGS_DIRECTORY
Initial: "Transformations/"
 
ResourceUtil Methods
Operation Details
public static
copyFileToFile(
   File in,
   File out):void
Sequential
Tags: throws=IOException
Notes: Copies one bin file to other
public static
createNewCitationStyle(
   ProcessCitationStyles pcs,
   String templName,
   String newName):void
Sequential
Tags: throws=JRException,IOException,CitationStyleManagerException,SAXException,CitationStyleManagerException
Notes: Creates new CitationStyle directory on hand of existende CitationStyle
public static
createNewCitationStyle(
   ProcessCitationStyles pcs,
   String newName):void
Sequential
Tags: throws=JRException,CitationStyleManagerException,IOException,SAXException,CitationStyleManagerException
Notes: Creates new CitationStyle directory on hand of DefaultCitationStyle XMLs
@param templName A name of template CitationStyle
public static
deleteCitationStyleBundle(
   String name):void
Sequential
Tags: throws=IllegalArgumentException,CitationStyleManagerException,IOException
Notes: Deletes CitationStyleBundle
@param path
public static
getCitationStylesList():String
Sequential
Tags: throws=IllegalArgumentException,IOException
Notes: Returns list of Citation Styles according to the content of the <code>CitaionStyles</code> directory
@param root
@return list of Citation Styles
public static
getPathToCitationStyles():String
Sequential
Tags: throws=IOException
Notes: Returns path to the Citation Styles directory
@return path
public static
getPathToClasses():String
Sequential
Tags: throws=IOException
Notes: Returns path to the directory of the classes depending on the run context (TOBE implemented further)
@return path
public static
getPathToDataSources():String
Sequential
Tags: throws=IOException
Notes: Returns path to the Data Sources directory
@return path
public static
getPathToResources():String
Sequential
Tags: throws=IOException
Notes: Returns path to the resources directory
@return path
public static
getPathToSchemas():String
Sequential
Tags: throws=IOException
Notes: Returns path to the Schemas directory
@return path
public static
getPathToTransformations():String
Sequential
Tags: throws=IOException
Notes: Returns path to the Transformations directory
@return path
public static
getProperties(
   String path,
   String fileName):Properties
Sequential
Tags: throws=FileNotFoundException,IOException
Notes: Load citman properties
@return properties
public static
getProperties(
   String fileName):Properties
Sequential
Tags: throws=FileNotFoundException,IOException
Notes: Load citman properties
@return properties
public static
getResourceAsFile(
   String fileName):File
Sequential
Tags: throws=FileNotFoundException
Notes: Gets a resource as InputStream.
@return The resource as InputStream.
public static
getResourceAsStream(
   String fileName):InputStream
Sequential
Tags: throws=FileNotFoundException
Notes: Gets a resource as InputStream.
@return The resource as InputStream.
public static
getResourceAsString(
   String fileName):String
Sequential
Tags: throws=IOException
Notes: Gets a resource as String.
@return The resource as String.
public static
getUriToResources():String
Sequential
Tags: throws=IOException
Notes: Gets URI to the resources
@return uri to the resources