com.caucho.quercus.lib.file
Class FileValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.ResourceValue
          extended by com.caucho.quercus.resources.StreamResource
              extended by com.caucho.quercus.lib.file.FileValue
All Implemented Interfaces:
EnvCleanup, java.io.Serializable
Direct Known Subclasses:
FileReadValue, FileWriteValue

public class FileValue
extends StreamResource

Represents a Quercus open file

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
FileValue(Path path)
           
 
Method Summary
 void close()
          Closes the file.
 Path getPath()
          Returns the path.
 void print(java.lang.String v)
          Prints a string to a file.
 int read()
          Reads a character from a file, returning -1 on EOF.
 StringValue readLine(Env env)
          Reads a line from a file, returning null.
 java.lang.String toString()
          Converts to a string.
 void writeToStream(java.io.OutputStream os, int length)
          Read a maximum of length bytes from the file and write them to the outputStream.
 
Methods inherited from class com.caucho.quercus.resources.StreamResource
closeRead, closeWrite, flush, getPosition, isEOF, print, read, readOptionalLinefeed, write
 
Methods inherited from class com.caucho.quercus.env.ResourceValue
cleanup, printRImpl, toKey, varDumpImpl
 
Methods inherited from class com.caucho.quercus.env.Value
abs, add, add, addOne, append, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, charValueAt, checkPrivate, checkProtected, clone, cmp, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eq, eql, eqValue, findFunction, generate, geq, get, getArg, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getObject, getQuercusClass, getRef, getResourceType, getSize, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getType, getValueArray, getValueIterator, getValueType, getVar, gt, hasCurrent, hashCode, increment, initField, isA, isA, isArray, isBinary, isBoolean, isCallable, isDefault, isDouble, isDoubleConvertible, isEmpty, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isObject, isResource, isset, isset, issetField, issetThisField, isString, isUnicode, isVar, jsonEncode, key, keyExists, length, leq, lshift, lt, mod, mul, mul, neg, next, nextIndex, pop, pos, postdecr, postincr, postincr, predecr, preincr, preincr, prev, print, print, printDepth, printJavaChar, printJavaString, printR, put, put, put, putField, putField, putField, putObject, putThisField, putThisField, putVar, remove, reset, rshift, serialize, serialize, set, setCharValueAt, setFieldInit, setJavaObject, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArray, toArrayValue, toAutoArray, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBoolean, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDouble, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLong, toLongMarshalCost, toLongValue, toObject, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, valuesToArray, varDump, varExport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileValue

public FileValue(Path path)
Method Detail

getPath

public Path getPath()
Returns the path.


read

public int read()
         throws java.io.IOException
Reads a character from a file, returning -1 on EOF.

Overrides:
read in class StreamResource
Throws:
java.io.IOException

readLine

public StringValue readLine(Env env)
                     throws java.io.IOException
Reads a line from a file, returning null.

Overrides:
readLine in class StreamResource
Throws:
java.io.IOException

writeToStream

public void writeToStream(java.io.OutputStream os,
                          int length)
                   throws java.io.IOException
Read a maximum of length bytes from the file and write them to the outputStream.

Parameters:
os - the OutputStream
length - the maximum number of bytes to read
Throws:
java.io.IOException

print

public void print(java.lang.String v)
           throws java.io.IOException
Prints a string to a file.

Overrides:
print in class StreamResource
Throws:
java.io.IOException

close

public void close()
Closes the file.

Overrides:
close in class StreamResource

toString

public java.lang.String toString()
Converts to a string.

Overrides:
toString in class ResourceValue
Parameters:
env -