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 LispObject
device
protected LispObject
directory
static char
directoryDelimiter
The path component separator used by internally generated path namestrings.static Primitive
GET_INPUT_STREAM
protected LispObject
host
protected LispObject
name
protected LispObject
type
A string, NIL, :WILD or :UNSPECIFIC.protected LispObject
version
A positive integer, or NIL, :WILD, :UNSPECIFIC, or :NEWEST.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Pathname()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LispObject
classOf()
protected static Pathname
create()
static Pathname
create(java.lang.String s)
static Pathname
create(java.lang.String s, java.lang.String host)
static Pathname
create(Pathname p)
boolean
equal(LispObject obj)
boolean
equalp(LispObject obj)
boolean
equals(java.lang.Object o)
LispObject
getDevice()
LispObject
getDirectory()
protected java.lang.String
getDirectoryNamestring()
static Pathname
getDirectoryPathname(java.io.File file)
LispObject
getHost()
java.io.InputStream
getInputStream()
long
getLastModified()
LispObject
getName()
java.lang.String
getNamestring()
LispObject
getParts()
Implementing the getParts() protocol will allow INSPECT to return information about the substructure of a descendent of LispObject.LispObject
getType()
LispObject
getVersion()
int
hashCode()
boolean
isAbsolute()
boolean
isJar()
boolean
isLocalFile()
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)
static Pathname
mergePathnames(Pathname pathname, Pathname defaultPathname)
static Pathname
mergePathnames(Pathname pathname, Pathname defaultPathname, LispObject defaultVersion)
static LispObject
ncoerce(Pathname orig, Pathname dest)
Coerces type between descendents of Pathname types by copying structurestatic Pathname
parseNamestring(java.lang.String s)
static LispObject
parseNamestring(AbstractString namestring)
static LogicalPathname
parseNamestring(AbstractString namestring, AbstractString host)
java.lang.String
printObject()
Pathname
setDevice(LispObject device)
Pathname
setDirectory(LispObject directory)
Pathname
setHost(LispObject host)
Pathname
setName(LispObject name)
Pathname
setType(LispObject type)
Pathname
setVersion(LispObject version)
int
sxhash()
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)
-
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: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 classLispObject
-
typeOf
public LispObject typeOf()
- Overrides:
typeOf
in classLispObject
-
classOf
public LispObject classOf()
- Overrides:
classOf
in classLispObject
-
typep
public LispObject typep(LispObject type)
- Overrides:
typep
in classLispObject
-
getNamestring
public java.lang.String getNamestring()
-
getDirectoryNamestring
protected java.lang.String getDirectoryNamestring()
-
equal
public boolean equal(LispObject obj)
- Overrides:
equal
in classLispObject
-
equalp
public boolean equalp(LispObject obj)
- Overrides:
equalp
in classLispObject
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
sxhash
public int sxhash()
- Overrides:
sxhash
in classLispObject
-
printObject
public java.lang.String printObject()
- Overrides:
printObject
in 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()
-
-