|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.excalibur.source.SourceUtil
Utility class for source resolving.
Constructor Summary | |
SourceUtil()
|
Method Summary | |
static String |
appendParameters(String uri,
Parameters parameters)
Append parameters to the uri. |
static String |
appendParameters(String uri,
SourceParameters parameters)
Append parameters to the uri Each parameter is appended to the uri with "parameter=value", the parameters are separated by "&". |
static void |
copy(InputStream in,
OutputStream out)
Copy the contents of an InputStream to an OutputStream . |
static void |
copy(Source source,
Source destination)
Copy the source to a specified destination. |
static String |
encode(String s)
Translates a string into x-www-form-urlencoded format. |
static String |
encodeBASE64(byte[] octetString)
BASE 64 encoding. |
static String |
encodeBASE64(String s)
BASE 64 encoding. |
static File |
getFile(Source source)
Return a File object associated with the Source object. |
static String |
getScheme(String uri)
Get the scheme of an absolute URI. |
static String |
getSpecificPart(String uri)
Get the scheme-specific part of an absolute URI. |
static int |
indexOfSchemeColon(String uri)
Get the position of the scheme-delimiting colon in an absolute URI, as specified by RFC 2396, appendix A. |
static void |
move(Source source,
Source destination)
Move the source to a specified destination. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SourceUtil()
Method Detail |
public static String appendParameters(String uri, Parameters parameters)
public static String appendParameters(String uri, SourceParameters parameters)
public static String encodeBASE64(String s)
public static String encodeBASE64(byte[] octetString)
public static String encode(String s)
x-www-form-urlencoded
format.
s
- String
to be translated.
String
.public static File getFile(Source source)
File
object associated with the Source
object.
File
object or null if the
Source
object does not point to a file URI.public static void move(Source source, Source destination) throws SourceException
source
- Source of the source.destination
- Destination of the source.
SourceException
- If an exception occurs during
the move.public static int indexOfSchemeColon(String uri)
Source
implementors that want to separate
the scheme part from the specific part of an URI.
Use this method when you need both the scheme and the scheme-specific part of an URI,
as calling successively getScheme(String)
and getSpecificPart(String)
will call this method twice, and as such won't be efficient.
uri
- the URI
-1
if not found.public static String getScheme(String uri)
uri
- the absolute URI
public static String getSpecificPart(String uri)
uri
- the absolute URI
public static void copy(Source source, Source destination) throws SourceException
source
- Source of the source.destination
- Destination of the source.
SourceException
- If an exception occurs during
the copy.public static void copy(InputStream in, OutputStream out) throws IOException
InputStream
to an OutputStream
.
in
- out
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |