jmri.util
Class FileUtil

Show UML class diagram
java.lang.Object
  extended by jmri.util.FileUtil

public class FileUtil
extends Object

Common utility methods for working with Files.

We needed a place to refactor common File-processing idioms in JMRI code, so this class was created. It's more of a library of procedures than a real class, as (so far) all of the operations have needed no state information.

In particular, this is intended to provide Java 2 functionality on a Java 1.1.8 system, or at least try to fake it.


Constructor Summary
FileUtil()
           
 
Method Summary
static String getExternalFilename(String pName)
          Find the resource file corresponding to a name.
static String getPortableFilename(File file)
          Convert a File object to our preferred storage form.
static String getPortableFilename(String filename)
          Convert a filename string to our preferred storage form.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

getExternalFilename

public static String getExternalFilename(String pName)
Find the resource file corresponding to a name. There are five cases: In any case, absolute pathnames will work.

Parameters:
pName - The name string, possibly starting with file: or resource:
Returns:
Absolute file name to use, or null.
Since:
2.7.2

getPortableFilename

public static String getPortableFilename(File file)
Convert a File object to our preferred storage form. This is the inverse of getExternalFilename(String pName). Deprecated forms are not created.

Parameters:
file - File to be represented
Since:
2.7.2

getPortableFilename

public static String getPortableFilename(String filename)
Convert a filename string to our preferred storage form. This is the inverse of getExternalFilename(String pName). Deprecated forms are not created.

Parameters:
filename - Filename to be represented
Since:
2.7.2


Copyright © 1997 - 2010 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads