|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.common.util.LocationUtils
public class LocationUtils
Constructor Summary | |
---|---|
LocationUtils()
|
Method Summary | |
---|---|
static boolean |
deleteFileQuietly(String filename)
Null safe method to unconditionally attempt to delete filename without throwing an exception. |
static boolean |
exists(String location)
Null safe method for determining if location exists. |
static BufferedReader |
getBufferedReader(File file,
String encoding)
Return a BufferedReader that reads from file using the indicated encoding. |
static BufferedReader |
getBufferedReader(InputStream in,
String encoding)
Return a BufferedReader that reads from in using the indicated encoding. |
static BufferedReader |
getBufferedReader(String location)
Return a BufferedReader for the location indicated using the platform default encoding. |
static BufferedReader |
getBufferedReader(String location,
String encoding)
Return a BufferedReader for the location indicated using the encoding indicated. |
static BufferedReader |
getBufferedReaderFromString(String s)
Return a BufferedReader that reads from s |
static String |
getCanonicalPath(File file)
|
static String |
getFilename(String location)
|
static File |
getFileQuietly(String filename)
Null safe method for getting a File handle from filename . |
static InputStream |
getInputStream(String location)
Open an InputStream to location . |
static List<String> |
getLocations(List<String> locationListings)
|
static List<String> |
getLocations(List<String> locationListings,
String encoding)
|
static List<String> |
getLocations(String locationListing)
|
static List<String> |
getLocations(String location,
LocationType type)
|
static List<String> |
getLocations(String location,
LocationType type,
String encoding)
|
static List<String> |
getLocations(String locationListing,
String encoding)
|
static org.springframework.core.io.Resource |
getResource(String location)
|
static String |
getURLString(File file)
|
static Writer |
getWriter(OutputStream out,
String encoding)
Return a Writer that writes to out using the indicated encoding. |
static boolean |
isExistingFile(String location)
Null safe method for determining if location is an existing file. |
static List<String> |
readLines(String location)
Get the contents of location as a list of String's one entry per line using the platform default encoding |
static List<String> |
readLines(String location,
String encoding)
Get the contents of location as a list of String's one entry per line using the encoding indicated. |
static List<String> |
readLinesAndClose(InputStream in)
|
static List<String> |
readLinesAndClose(InputStream in,
String encoding)
|
static List<String> |
readLinesAndClose(Reader reader)
|
static List<String> |
readLinesFromString(String s)
Get the contents of s as a list of String's one entry per line |
static String |
toString(String location)
Get the contents of location as a String using the platform's default character encoding. |
static String |
toString(String location,
String encoding)
Get the contents of location as a String using the specified character encoding. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocationUtils()
Method Detail |
---|
public static final List<String> getLocations(String location, LocationType type, String encoding)
public static final List<String> getLocations(String location, LocationType type)
public static final List<String> getLocations(String locationListing)
public static final List<String> getLocations(String locationListing, String encoding)
public static final List<String> getLocations(List<String> locationListings)
public static final List<String> getLocations(List<String> locationListings, String encoding)
public static final String getURLString(File file)
public static final String getCanonicalPath(File file)
public static final boolean deleteFileQuietly(String filename)
filename
without throwing an exception. If filename
is a directory, delete it and all sub-directories.
public static final File getFileQuietly(String filename)
File
handle from filename
. If filename
is null, null is
returned.
public static final String toString(String location)
location
as a String
using the platform's default character encoding.
public static final String toString(String location, String encoding)
location
as a String
using the specified character encoding.
public static final List<String> readLinesFromString(String s)
s
as a list of String's
one entry per line
public static final List<String> readLinesAndClose(InputStream in)
public static final List<String> readLinesAndClose(InputStream in, String encoding)
public static final List<String> readLinesAndClose(Reader reader)
public static final List<String> readLines(String location)
location
as a list of String's
one entry per line using the platform default encoding
public static final List<String> readLines(String location, String encoding)
location
as a list of String's
one entry per line using the encoding indicated.
public static final BufferedReader getBufferedReader(String location) throws IOException
BufferedReader
for the location indicated using the platform default encoding.
IOException
public static final BufferedReader getBufferedReader(String location, String encoding) throws IOException
BufferedReader
for the location indicated using the encoding indicated.
IOException
public static final BufferedReader getBufferedReaderFromString(String s)
BufferedReader
that reads from s
public static final Writer getWriter(OutputStream out, String encoding) throws IOException
Writer
that writes to out
using the indicated encoding. null
means use the platform's
default encoding.
IOException
public static final BufferedReader getBufferedReader(File file, String encoding) throws IOException
BufferedReader
that reads from file
using the indicated encoding. null
means use the
platform's default encoding.
IOException
public static final BufferedReader getBufferedReader(InputStream in, String encoding) throws IOException
BufferedReader
that reads from in
using the indicated encoding. null
means use the
platform's default encoding.
IOException
public static final boolean isExistingFile(String location)
location
is an existing file.
public static final boolean exists(String location)
location
exists.
public static final InputStream getInputStream(String location) throws IOException
InputStream
to location
. If location
is the path to an existing File
on
the local file system, a FileInputStream
is returned. Otherwise Spring's resource loading framework is used to open an
InputStream
to location
.
IOException
public static final org.springframework.core.io.Resource getResource(String location)
public static final String getFilename(String location)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |