Package org.armedbear.lisp
Class Pathname
- java.lang.Object
-
- org.armedbear.lisp.LispObject
-
- org.armedbear.lisp.Pathname
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
LogicalPathname,URLPathname
public class Pathname extends LispObject implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LispObjectdeviceprotected LispObjectdirectorystatic chardirectoryDelimiterThe path component separator used by internally generated path namestrings.static PrimitiveGET_INPUT_STREAMprotected LispObjecthostprotected LispObjectnameprotected LispObjecttypeA string, NIL, :WILD or :UNSPECIFIC.protected LispObjectversionA positive integer, or NIL, :WILD, :UNSPECIFIC, or :NEWEST.
-
Constructor Summary
Constructors Modifier Constructor Description protectedPathname()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LispObjectclassOf()protected static Pathnamecreate()static Pathnamecreate(java.lang.String s)static Pathnamecreate(java.lang.String s, java.lang.String host)static Pathnamecreate(Pathname p)booleanequal(LispObject obj)booleanequalp(LispObject obj)booleanequals(java.lang.Object o)LispObjectgetDevice()LispObjectgetDirectory()protected java.lang.StringgetDirectoryNamestring()static PathnamegetDirectoryPathname(java.io.File file)LispObjectgetHost()java.io.InputStreamgetInputStream()longgetLastModified()LispObjectgetName()java.lang.StringgetNamestring()LispObjectgetParts()Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject.LispObjectgetType()LispObjectgetVersion()inthashCode()booleanisAbsolute()booleanisJar()booleanisLocalFile()static booleanisSupportedProtocol(java.lang.String protocol)booleanisURL()static booleanisValidURL(java.lang.String s)booleanisWild()static PathnamemakePathname(java.io.File file)static PathnamemakePathname(LispObject args)static PathnamemergePathnames(Pathname pathname, Pathname defaultPathname)static PathnamemergePathnames(Pathname pathname, Pathname defaultPathname, LispObject defaultVersion)static LispObjectncoerce(Pathname orig, Pathname dest)Coerces type between descendents of Pathname types by copying structurestatic PathnameparseNamestring(java.lang.String s)static LispObjectparseNamestring(AbstractString namestring)static LogicalPathnameparseNamestring(AbstractString namestring, AbstractString host)java.lang.StringprintObject()PathnamesetDevice(LispObject device)PathnamesetDirectory(LispObject directory)PathnamesetHost(LispObject host)PathnamesetName(LispObject name)PathnamesetType(LispObject type)PathnamesetVersion(LispObject version)intsxhash()static LispObjecttruename(LispObject arg)static LispObjecttruename(LispObject arg, boolean errorIfDoesNotExist)static LispObjecttruename(Pathname pathname)static LispObjecttruename(Pathname pathname, boolean errorIfDoesNotExist)LispObjecttypeOf()LispObjecttypep(LispObject type)-
Methods inherited from class org.armedbear.lisp.LispObject
ABS, add, add, aref, AREF, AREF, aref_long, 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, getSlotValue_0, getSlotValue_1, getSlotValue_2, getSlotValue_3, 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, princToString, psxhash, psxhash, push, rationalp, RATIONALP, realp, REALP, resolve, reverse, RPLACA, RPLACD, SCHAR, setCallCount, setCar, setCdr, setDocumentation, setHotCount, setPropertyList, setSlotValue, setSlotValue, setSlotValue_0, setSlotValue_1, setSlotValue_2, setSlotValue_3, SIMPLE_STRING_P, SLOT_VALUE, STRING, stringp, STRINGP, subtract, subtract, SVREF, svset, SYMBOLP, truncate, unreadableString, unreadableString, VECTOR_PUSH_EXTEND, VECTOR_PUSH_EXTEND, vectorp, VECTORP, vectorPushExtend, zerop, ZEROP
-
-
-
-
Field Detail
-
host
protected LispObject host
-
device
protected LispObject device
-
directory
protected LispObject directory
-
name
protected LispObject name
-
type
protected LispObject type
A string, NIL, :WILD or :UNSPECIFIC.
-
version
protected LispObject version
A positive integer, or NIL, :WILD, :UNSPECIFIC, or :NEWEST.
-
directoryDelimiter
public static final char directoryDelimiter
The path component separator used by internally generated path namestrings.- See Also:
- Constant Field Values
-
GET_INPUT_STREAM
public static final Primitive GET_INPUT_STREAM
-
-
Method Detail
-
create
protected static Pathname create()
-
create
public static Pathname create(java.lang.String s)
-
create
public static Pathname create(java.lang.String s, java.lang.String host)
-
getHost
public LispObject getHost()
-
setHost
public Pathname setHost(LispObject host)
-
getDevice
public final LispObject getDevice()
-
setDevice
public Pathname setDevice(LispObject device)
-
getDirectory
public LispObject getDirectory()
-
setDirectory
public Pathname setDirectory(LispObject directory)
-
getName
public LispObject getName()
-
setName
public Pathname setName(LispObject name)
-
getType
public LispObject getType()
-
setType
public Pathname setType(LispObject type)
-
getVersion
public LispObject getVersion()
-
setVersion
public Pathname setVersion(LispObject version)
-
ncoerce
public static LispObject ncoerce(Pathname orig, Pathname dest)
Coerces type between descendents of Pathname types by copying structure
-
isSupportedProtocol
public static boolean isSupportedProtocol(java.lang.String protocol)
-
getParts
public LispObject getParts()
Description copied from class:LispObjectImplementing 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:
getPartsin classLispObject
-
typeOf
public LispObject typeOf()
- Overrides:
typeOfin classLispObject
-
classOf
public LispObject classOf()
- Overrides:
classOfin classLispObject
-
typep
public LispObject typep(LispObject type)
- Overrides:
typepin classLispObject
-
getNamestring
public java.lang.String getNamestring()
-
getDirectoryNamestring
protected java.lang.String getDirectoryNamestring()
-
equal
public boolean equal(LispObject obj)
- Overrides:
equalin classLispObject
-
equalp
public boolean equalp(LispObject obj)
- Overrides:
equalpin classLispObject
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
sxhash
public int sxhash()
- Overrides:
sxhashin classLispObject
-
printObject
public java.lang.String printObject()
- Overrides:
printObjectin classLispObject
-
parseNamestring
public static Pathname parseNamestring(java.lang.String s)
-
isValidURL
public static boolean isValidURL(java.lang.String s)
-
parseNamestring
public static LispObject parseNamestring(AbstractString namestring)
-
parseNamestring
public static LogicalPathname parseNamestring(AbstractString namestring, AbstractString host)
-
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 LispObject truename(Pathname pathname)
-
truename
public static LispObject truename(LispObject arg)
-
truename
public static LispObject truename(LispObject arg, boolean errorIfDoesNotExist)
-
truename
public static 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.
-
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.
-
getDirectoryPathname
public static Pathname getDirectoryPathname(java.io.File file)
-
isLocalFile
public boolean isLocalFile()
-
-