Static Public Member Functions
edu.tum.cs.ias.knowrob.utils.FileUtil Class Reference

List of all members.

Static Public Member Functions

static String getAbsoluteFilePath (String root, String path)
static String readTextFile (File file) throws FileNotFoundException, IOException
static String readTextFile (String filename) throws FileNotFoundException, IOException
static boolean Unzip (String zipFile, String outputDirectory)

Detailed Description

File Utils for reading text files and unzip.

Author:
Stefan Profanter

Definition at line 28 of file FileUtil.java.


Member Function Documentation

static String edu.tum.cs.ias.knowrob.utils.FileUtil.getAbsoluteFilePath ( String  root,
String  path 
) [inline, static]

Convert a file path into a File object with an absolute path relative to a passed in root. If path is absolute then a file object constructed from new File(path) is returned, otherwise a file object is returned from new File(root, path) if root is not null, otherwise null is returned.

Parameters:
rootroot file path
pathrelative file path
Returns:
the absolute path to the file or null if root is null

Definition at line 42 of file FileUtil.java.

static String edu.tum.cs.ias.knowrob.utils.FileUtil.readTextFile ( File  file) throws FileNotFoundException, IOException [inline, static]

Read a text file and return it as a String.

Parameters:
fileFile to read
Returns:
the content of the file
Exceptions:
FileNotFoundExceptionIf file not found or invalid path
IOExceptionif there was an error reading the file

Definition at line 64 of file FileUtil.java.

static String edu.tum.cs.ias.knowrob.utils.FileUtil.readTextFile ( String  filename) throws FileNotFoundException, IOException [inline, static]

Read a text file and return it as a String.

Parameters:
filenameFilename as String. File must exist otherwise a FileNotFound exception will be thrown.
Returns:
the content of the file
Exceptions:
FileNotFoundExceptionIf file not found or invalid path
IOExceptionif there was an error reading the file

Definition at line 85 of file FileUtil.java.

static boolean edu.tum.cs.ias.knowrob.utils.FileUtil.Unzip ( String  zipFile,
String  outputDirectory 
) [inline, static]

Unzip a zipped file (eg. kmz, zip) into given directory

Parameters:
zipFilezipped file to unzip
outputDirectorydestination directory for unzipped content
Returns:
true if successfully unzipped

Definition at line 98 of file FileUtil.java.


The documentation for this class was generated from the following file:


knowrob_common
Author(s): Moritz Tenorth
autogenerated on Sat Dec 28 2013 17:09:28