org.armedbear.lisp
Class Pathname

java.lang.Object
  extended by org.armedbear.lisp.LispObject
      extended by org.armedbear.lisp.Pathname
Direct Known Subclasses:
LogicalPathname

public class Pathname
extends LispObject


Field Summary
protected  LispObject device
           
protected  LispObject directory
           
protected  LispObject host
           
static EqualHashTable LOGICAL_PATHNAME_TRANSLATIONS
           
protected  LispObject name
           
protected  LispObject type
           
protected  LispObject version
           
 
Constructor Summary
protected Pathname()
           
protected Pathname(Pathname p)
          Copy constructor which shares no structure with the original.
  Pathname(java.lang.String s)
           
  Pathname(java.net.URL url)
           
 
Method Summary
protected  java.lang.String asEntryPath()
           
 LispObject classOf()
           
 boolean equal(LispObject obj)
           
 boolean equalp(LispObject obj)
           
 LispObject getDevice()
           
protected  java.lang.String getDirectoryNamestring()
           
protected static java.lang.String getHostString(java.lang.String s)
           
 java.io.InputStream getInputStream()
           
 long getLastModified()
           
 java.lang.String getNamestring()
           
 LispObject getParts()
          Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject.
 void invalidateNamestring()
          The protocol for changing any instance field (i.e.
 boolean isAbsolute()
           
 boolean isJar()
           
static boolean isSupportedProtocol(java.lang.String protocol)
           
 boolean isURL()
           
static boolean isValidURL(java.lang.String s)
           
 boolean isWild()
           
static Pathname makePathname(java.io.File file)
           
static Pathname makePathname(LispObject args)
           
protected static java.net.URL makeURL(Pathname pathname)
           
static Pathname mergePathnames(Pathname pathname, Pathname defaultPathname)
           
static Pathname mergePathnames(Pathname pathname, Pathname defaultPathname, LispObject defaultVersion)
           
static Pathname parseNamestring(AbstractString namestring)
           
static LogicalPathname parseNamestring(AbstractString namestring, AbstractString host)
           
static Pathname parseNamestring(java.lang.String s)
           
 int sxhash()
           
 java.lang.String toString()
           
static java.net.URL toURL(Pathname p)
           
static LispObject truename(LispObject arg)
           
static LispObject truename(LispObject arg, boolean errorIfDoesNotExist)
           
static LispObject truename(Pathname pathname)
           
static LispObject truename(Pathname pathname, boolean errorIfDoesNotExist)
           
 LispObject typeOf()
           
 LispObject typep(LispObject type)
           
 java.lang.String writeToString()
           
 
Methods inherited from class org.armedbear.lisp.LispObject
ABS, add, add, aref_long, aref, AREF, AREF, aset, aset, aset, ash, ash, atom, ATOM, caddr, cadr, car, cddr, cdr, CHAR, characterp, CHARACTERP, chars, COMPLEXP, constantp, CONSTANTP, copyToArray, decr, DENOMINATOR, dispatch, divideBy, doubleValue, elt, endp, ENDP, EQ, eql, eql, eql, EQL, equal, EQUAL, equalp, evenp, EVENP, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, floatp, FLOATP, floatValue, getBooleanValue, getCallCount, getDescription, getDocumentation, getFixnumSlotValue, getHotCount, getInstance, getPropertyList, getSlotValue_0, getSlotValue_1, getSlotValue_2, getSlotValue_3, getSlotValue, getSlotValueAsBoolean, getStringChars, getStringValue, getSymbolFunction, getSymbolFunctionOrDie, getSymbolSetfFunction, getSymbolSetfFunctionOrDie, getSymbolValue, incr, incrementCallCount, incrementHotCount, integerp, INTEGERP, intValue, IS_E, IS_GE, IS_GT, IS_LE, IS_LT, IS_NE, isEqualTo, isEqualTo, isGreaterThan, isGreaterThan, isGreaterThanOrEqualTo, isGreaterThanOrEqualTo, isLessThan, isLessThan, isLessThanOrEqualTo, isLessThanOrEqualTo, isNotEqualTo, isNotEqualTo, isSpecialOperator, isSpecialVariable, javaInstance, javaInstance, LDB, length, LENGTH, listp, LISTP, lockableInstance, LOGAND, LOGAND, LOGIOR, LOGIOR, LOGNOT, LOGXOR, LOGXOR, longValue, minusp, MINUSP, MOD, MOD, multiplyBy, multiplyBy, negate, noFillPointer, NOT, nreverse, NTH, NTH, nthcdr, numberp, NUMBERP, NUMERATOR, oddp, ODDP, plusp, PLUSP, psxhash, psxhash, push, rationalp, RATIONALP, realp, REALP, resolve, reverse, RPLACA, RPLACD, SCHAR, setCallCount, setCar, setCdr, setDocumentation, setHotCount, setPropertyList, setSlotValue_0, setSlotValue_1, setSlotValue_2, setSlotValue_3, setSlotValue, setSlotValue, SIMPLE_STRING_P, SLOT_VALUE, STRING, stringp, STRINGP, subtract, subtract, SVREF, svset, SYMBOLP, truncate, unreadableString, unreadableString, unreadableString, unreadableString, VECTOR_PUSH_EXTEND, VECTOR_PUSH_EXTEND, vectorp, VECTORP, vectorPushExtend, zerop, ZEROP
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

host

protected LispObject host

device

protected LispObject device

directory

protected LispObject directory

name

protected LispObject name

type

protected LispObject type

version

protected LispObject version

LOGICAL_PATHNAME_TRANSLATIONS

public static EqualHashTable LOGICAL_PATHNAME_TRANSLATIONS
Constructor Detail

Pathname

protected Pathname()

Pathname

protected Pathname(Pathname p)
Copy constructor which shares no structure with the original.


Pathname

public Pathname(java.lang.String s)

Pathname

public Pathname(java.net.URL url)
Method Detail

invalidateNamestring

public void invalidateNamestring()
The protocol for changing any instance field (i.e. 'host', 'type', etc.) is to call this method after changing the field to recompute the namestring. We could do this with setter/getters, but that choose not to in order to avoid the performance indirection penalty. Although, given the number of bugs that crop up when this protocol is not adhered to, maybe we should consider it.


isSupportedProtocol

public static boolean isSupportedProtocol(java.lang.String protocol)

getParts

public LispObject getParts()
Description copied from class: LispObject
Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject. The protocol is to return a List of Cons pairs, where the car of each pair contains a decriptive string, and the cdr returns a subobject for inspection.

Overrides:
getParts in class LispObject

typeOf

public LispObject typeOf()
Overrides:
typeOf in class LispObject

classOf

public LispObject classOf()
Overrides:
classOf in class LispObject

typep

public LispObject typep(LispObject type)
Overrides:
typep in class LispObject

getDevice

public final LispObject getDevice()

getNamestring

public java.lang.String getNamestring()

getDirectoryNamestring

protected java.lang.String getDirectoryNamestring()

asEntryPath

protected java.lang.String asEntryPath()
Returns:
The representation of this pathname suitable for referencing an entry in a Zip/JAR file

equal

public boolean equal(LispObject obj)
Overrides:
equal in class LispObject

equalp

public boolean equalp(LispObject obj)
Overrides:
equalp in class LispObject

sxhash

public int sxhash()
Overrides:
sxhash in class LispObject

writeToString

public java.lang.String writeToString()
Overrides:
writeToString in class LispObject

parseNamestring

public static Pathname parseNamestring(java.lang.String s)

isValidURL

public static boolean isValidURL(java.lang.String s)

toURL

public static java.net.URL toURL(Pathname p)

parseNamestring

public static Pathname parseNamestring(AbstractString namestring)

parseNamestring

public static LogicalPathname parseNamestring(AbstractString namestring,
                                              AbstractString host)

getHostString

protected static java.lang.String getHostString(java.lang.String s)

makePathname

public static final Pathname makePathname(LispObject args)

makePathname

public static final Pathname makePathname(java.io.File file)

isAbsolute

public boolean isAbsolute()

isJar

public boolean isJar()

isURL

public boolean isURL()

isWild

public boolean isWild()

mergePathnames

public static final Pathname mergePathnames(Pathname pathname,
                                            Pathname defaultPathname)

mergePathnames

public static final Pathname mergePathnames(Pathname pathname,
                                            Pathname defaultPathname,
                                            LispObject defaultVersion)

truename

public static final LispObject truename(Pathname pathname)

truename

public static final LispObject truename(LispObject arg)

truename

public static final LispObject truename(LispObject arg,
                                        boolean errorIfDoesNotExist)

truename

public static final LispObject truename(Pathname pathname,
                                        boolean errorIfDoesNotExist)
Returns:
The canonical TRUENAME as a Pathname if the pathname exists, otherwise returns NIL or possibly a subtype of LispError if there are logical problems with the input.

makeURL

protected static java.net.URL makeURL(Pathname pathname)

getInputStream

public java.io.InputStream getInputStream()

getLastModified

public long getLastModified()
Returns:
Time in milliseconds since the UNIX epoch at which the resource was last modified, or 0 if the time is unknown.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object