|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.meta.java.net.URLSugar
Untamed: A sweetener defining extra messages that may be e-sent to a URL.
Makes a URL act as if it implements
org.erights.e.elib.serial.Loader
.
Note that a URL of the form <protocol:path> grants access only to the resource named "path" starting with that protocol handler. By contrast, a URL of the form <protocol:path/> grants access to all resources whose names, starting at that protocol handler, begin with "path/". For example, <http://www.erights.org> evaluates to a URL which grants access to the erights.org home page, whereas <http://www.erights.org/> grants access to the whole website.
Note that the
fileURL__uriGetter
returns a URL
, which therefore plays by the above rules, but that
the file__uriGetter
returns a File
which doesn't.
A File always allows prefixing separated by "/" but disallowing "..".
Constructor Summary | |
private |
URLSugar()
prevent instantiation |
Method Summary | |
static void |
__printOn(URL self,
TextWriter out)
Enabled: E URIs have angle brackets around them |
static URL |
get(URL self,
String suffix)
Enabled: "implements" org.erights.e.elib.serial.Loader#get , but only if
the body of this URL ends in a "/". |
static String |
getBody(URL self)
Enabled: Everything after 'protocol:'. |
static BigInteger |
getCryptoHash(URL self)
Enabled: A SHA hash of the binary content of the URL's contents. |
static String |
getText(URL self)
Enabled: Gets the contents of the url as String, normalizing newlines into '\n's. |
static Twine |
getTwine(URL self)
Enabled: Gets the contents of the url as Twine (a text string that remembers where it came from), normalizing newlines into '\n's. |
static void |
iterate(URL self,
AssocFunc func)
Enabled: Enumerates lineNumber => String (text line) associations. |
static void |
iterate(URL self,
AssocFunc func,
boolean isLocated)
Enabled: Enumerates lineNumber => String/Twine (text line) associations. |
static Object[] |
optUncall(URL self,
Object obj)
Enabled: "implements" org.erights.e.elib.serial.Loader#optUncall ,
but only if the body of this URL ends in a "/". |
static BufferedReader |
textReader(URL self)
Enabled: Open 'self' for reading text, decoding UTF-8 and turning platform newlines into '\n's |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
private URLSugar()
Method Detail |
public static BufferedReader textReader(URL self) throws IOException
IOException
public static void iterate(URL self, AssocFunc func) throws IOException
Each text line ends with a "\n". isLocated defaults to false.
IOException
public static void iterate(URL self, AssocFunc func, boolean isLocated) throws IOException
Each text line ends with a "\n".
IOException
public static String getText(URL self) throws IOException
IOException
public static Twine getTwine(URL self) throws IOException
IOException
public static BigInteger getCryptoHash(URL self) throws NoSuchAlgorithmException, IOException
NoSuchAlgorithmException
IOException
public static String getBody(URL self)
public static URL get(URL self, String suffix)
org.erights.e.elib.serial.Loader#get
, but only if
the body of this URL ends in a "/".
self
- suffix
-
public static Object[] optUncall(URL self, Object obj)
org.erights.e.elib.serial.Loader#optUncall
,
but only if the body of this URL ends in a "/".
self
- obj
-
public static void __printOn(URL self, TextWriter out) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |