public abstract class URIListUtil extends Object
text/uri-list
back and forth between a stream representation and
an object representation. text/uri-list
is defined in rfc2483
5. The text/uri-list Internet Media Type Several of the resolution service requests, such as I2Ls, I2Ns, result in a list of URIs being returned to the client. The text/uri- list Internet Media Type is defined to provide a simple format for the automatic processing of such lists of URIs. This is a copy of the IANA registration of the text/uri-list Media Type. Date: Fri, 18 Apr 97 08:36:07 PDT From: Ron Daniel Jr.To: iana@iana.org, rdaniel@lanl.gov Subject: Request for MIME media type Text/IETF Tree - uri-list Name : Ron Daniel Jr. E-mail : rdaniel@lanl.gov MIME media type name : Text MIME subtype name : IETF Tree -uri-list Required parameters : none Optional parameters : charset Currently, URIs can be represented using US-ASCII. However, there are many non-standard URIs which use special character sets. Discussion of how to best achieve internationalization of URIs is underway. This registration will be updated with a discussion of the URI charsets once that discussion has concluded. Encoding considerations : Some transfer protocols, such as SMTP, place limits on the length of lines. Very long URIs might exceed those limits. Systems must therefore be prepared to use a suitable content transfer encoding. This is anticipated to be a rare occurance. Security considerations : Client software should be aware of the security considerations of URIs. For example, accessing some URIs can result in sending a death threat to a head of state, frequently prompting a visit from the relevant protective service. Accessing other URIs may result in financial obligations, or access to resources considered inappropriate by one's employer. While the legitimate provider of a uri-list could exploit these properties for good or ill, it is more likely that uri-lists will be falsified in order to exploit such characteristics of URIs. Additionally, the lookup and reverse lookup potential of the uri- list may be attractive to traffic analysts. URI lists may also reveal confidential information, such as the location of sensitive information. Because of these considerations, external confidentiality measures should be available to protect uri-list responses when appropriate. Interoperability considerations : none known Published specification : Uniform Resource Locators (URLs) and Uniform Resource Names (URNs) are two instances of the more general class of identifiers known as Uniform Resource Identifiers (URIs). URN resolution methods frequently wish to return lists of URLs for a resource so that fault-tolerance and load balancing can be achieved. The text/uri-list format is intended to be a very simple format for communicating such lists of URLs (and URNs) in a form suitable for automatic processing. The format of text/uri-list resources is: 1) Any lines beginning with the '#' character are comment lines and are ignored during processing. (Note that URIs may contain the '#' character, so it is only a comment character when it is the first character on a line.) 2) The remaining non-comment lines shall be URIs (URNs or URLs), encoded according to the URL or URN specifications (RFC2141, RFC1738 and RFC2396). Each URI shall appear on one and only one line. Very long URIs are not broken in the text/uri-list format. Content-transfer-encodings may be used to enforce line length limitations. 3) As for all text/* formats, lines are terminated with a CRLF pair. In applications where one URI has been mapped to a list of URIs, the first line of the text/uri-list response SHOULD be a comment giving the original URI. An example of the format is given below: # urn:isbn:0-201-08372-8 http://www.huh.org/books/foo.html http://www.huh.org/books/foo.pdf ftp://ftp.foo.org/books/foo.txt Applications which use this media : URN resolvers are the initial applications. Web clients and proxies are applications that are likely to support this format in the future.
Constructor and Description |
---|
URIListUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
fromURIList(Collection<URI> pURIList)
Convert the
List of URI s into a string representation conforming to the text/uri-list media
type. |
static void |
fromURIList(Collection<URI> pURIList,
Writer pWriter)
Convert the
List of URI s into a stream representation conforming to the text/uri-list media
type. |
static List<URI> |
toURIList(Reader pReader)
Convert the URI list arugument into a List
|
static List<URI> |
toURIList(String pURIListString)
Convert the
text/uri-list argument into a List |
public static List<URI> toURIList(Reader pReader) throws IOException
pReader
- The stream from which the URI list will be read.List
of URI
sIOException
- if an I/O exception occurs while reading from pReader
public static List<URI> toURIList(String pURIListString)
text/uri-list
argument into a ListpURIListString
- a string representation of an URI list, with URIs separated by CRLF pairsList
of URI
spublic static String fromURIList(Collection<URI> pURIList)
List
of URI
s into a string representation conforming to the text/uri-list
media
type.pURIList
- A list of URIs to be converted to a text/uri-list
String
containing a representation of the list of URIs conforming to RFC 2483public static void fromURIList(Collection<URI> pURIList, Writer pWriter) throws IOException
List
of URI
s into a stream representation conforming to the text/uri-list
media
type.pURIList
- A list of URIs to be converted to a text/uri-list
pWriter
- Writer
to which a representation of the list of URIs conforming to RFC 2483 will be
writtenIOException
- if an I/O exception occurs when writing to pWriter
© 1998- 2018 Stibo DX