Overview | Package | Class | Tree | Deprecated | Index | Help
| Protege 3.5 alpha
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.stanford.smi.protege.util
Class FileUtilities

    java.lang.Object
      edu.stanford.smi.protege.util.FileUtilities

    public class FileUtilities

extends Object

A utility class for working with files.

Author:
  Ray Fergerson

Field Summary
`static char` | `EXTENSION_SEPARATOR`

Constructor Summary
`FileUtilities()`

Method Summary
`static void` | `close(InputStream stream)`
`static void` | `close(Reader reader)`
`static void` | `close(Writer writer)`
`static BufferedReader` | `createBufferedReader(File file)`
`static BufferedReader` | `createBufferedReader(InputStream is)`
`static BufferedReader` | `createBufferedReader(String filename)`
`static BufferedWriter` | `createBufferedWriter(File file)`
`static BufferedWriter` | `createBufferedWriter(File file, boolean append)`
`static BufferedWriter` | `createBufferedWriter(String filename)`
`static PrintWriter` | `createPrintWriter(File file, boolean autoFlush)`
`static File` | `createTempFile(File file)`
`static void` | `deleteDirectory(File directory)`
`static String` | `ensureExtension(String path, String extension)`
`static String` | `getAbsolutePath(String filename)`
`static String` | `getAbsolutePath(String filename, Project p)`
`static String` | `getBaseName(File file)`
`static String` | `getBaseName(String s)`
`static String` | `getEncoding()`
`static String` | `getName(String s)`
`static String` | `getReadEncoding()`
`static String` | `getReadEncodingOverride()`
`static Reader` | `getReader(String filename)`
`static Reader` | `getResourceReader(Class clas, String path)`
`static Reader` | `getResourceReader(Class clas, String directory, String name)`
`static InputStream` | `getResourceStream(Class clas, String path)`
`static InputStream` | `getResourceStream(Class clas, String directory, String name)`
`static String` | `getWriteEncoding()`
`static Writer` | `getWriter(String filename)`
`static void` | `makeTempFilePermanent(File tmpFile)`
`static String` | `replaceExtension(String name, String extension)`
`static void` | `replaceFile(File tmpFile, File file)`
`static String` | `replaceFileName(String path, String newName)`
`static boolean` | `savePropertiesFile(File propFile, Properties properties)`
`static void` | `setReadEncodingOverride(String s)`
`static void` | `setWriteEncodingOverride(String s)`
`static URL` | `toURL(File file)`
`static String` | `urlDecode(String s)`
`static String` | `urlEncode(String s)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### EXTENSION_SEPARATOR

    public static final char EXTENSION_SEPARATOR

See Also:
  Constant Field Values

Constructor Detail

### FileUtilities

    public FileUtilities()

Method Detail

### createTempFile

    public static File createTempFile(File file)
                               throws IOException

  Throws:
    `IOException`

### getAbsolutePath

    public static String getAbsolutePath(String filename)

### getAbsolutePath

    public static String getAbsolutePath(String filename,
                                         Project p)

### getName

    public static String getName(String s)

### getBaseName

    public static String getBaseName(String s)

### getBaseName

    public static String getBaseName(File file)

### replaceExtension

    public static String replaceExtension(String name,
                                          String extension)

### ensureExtension

    public static String ensureExtension(String path,
                                         String extension)

### createBufferedReader

    public static BufferedReader createBufferedReader(String filename)

### createBufferedReader

    public static BufferedReader createBufferedReader(File file)

### createBufferedWriter

    public static BufferedWriter createBufferedWriter(File file,
                                                      boolean append)

### createBufferedWriter

    public static BufferedWriter createBufferedWriter(String filename)

### createBufferedWriter

    public static BufferedWriter createBufferedWriter(File file)

### createBufferedReader

    public static BufferedReader createBufferedReader(InputStream is)

### createPrintWriter

    public static PrintWriter createPrintWriter(File file,
                                                boolean autoFlush)

### getWriter

    public static Writer getWriter(String filename)

### getReader

    public static Reader getReader(String filename)

### getResourceReader

    public static Reader getResourceReader(Class clas,
                                           String path)

### getResourceReader

    public static Reader getResourceReader(Class clas,
                                           String directory,
                                           String name)

### getResourceStream

    public static InputStream getResourceStream(Class clas,
                                                String path)

### getResourceStream

    public static InputStream getResourceStream(Class clas,
                                                String directory,
                                                String name)

### makeTempFilePermanent

    public static void makeTempFilePermanent(File tmpFile)
                                      throws IOException

  Throws:
    `IOException`

### replaceFile

    public static void replaceFile(File tmpFile,
                                   File file)
                            throws IOException

  Throws:
    `IOException`

### setReadEncodingOverride

    public static void setReadEncodingOverride(String s)

### setWriteEncodingOverride

    public static void setWriteEncodingOverride(String s)

### getReadEncodingOverride

    public static String getReadEncodingOverride()

### getReadEncoding

    public static String getReadEncoding()

### getWriteEncoding

    public static String getWriteEncoding()

### getEncoding

    public static String getEncoding()

### replaceFileName

    public static String replaceFileName(String path,
                                         String newName)

### deleteDirectory

    public static void deleteDirectory(File directory)

### toURL

    public static URL toURL(File file)

### urlEncode

    public static String urlEncode(String s)

### urlDecode

    public static String urlDecode(String s)

### close

    public static void close(InputStream stream)

### close

    public static void close(Reader reader)

### close

    public static void close(Writer writer)

### savePropertiesFile

    public static boolean savePropertiesFile(File propFile,
                                             Properties properties)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Protege 3.5 alpha
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2012 Stanford University.