public class File4D extends RandomAccessStream implements FileStates
Modifier and Type | Field and Description |
---|---|
static int |
ATTR_ARCHIVE |
static int |
ATTR_HIDDEN |
static int |
ATTR_READ_ONLY |
static int |
ATTR_SYSTEM |
static int |
CLOSED |
protected java.lang.String |
path |
static byte |
TIME_ACCESSED |
static byte |
TIME_ALL |
static byte |
TIME_CREATED |
static byte |
TIME_MODIFIED |
static java.lang.String[] |
winceVols |
pos, SEEK_CUR, SEEK_END, SEEK_SET
skipBuffer
CREATE, CREATE_EMPTY, DONT_OPEN, INVALID, READ_ONLY, READ_WRITE
Constructor and Description |
---|
File4D(java.lang.String path) |
File4D(java.lang.String path,
int mode) |
File4D(java.lang.String path,
int mode,
int slot) |
Modifier and Type | Method and Description |
---|---|
int |
chmod(int mod) |
void |
close()
Closes this I/O connection, releasing any associated resources.
|
static void |
copy(java.lang.String src,
java.lang.String dst) |
void |
copyTo(File dest) |
void |
createDir() |
void |
delete() |
static void |
deleteDir(java.lang.String dir) |
boolean |
exists() |
protected void |
finalize() |
void |
flush() |
int |
getAttributes() |
static java.lang.String |
getCardSerialNumber(int slot) |
static File |
getCardVolume() |
File |
getParent() |
java.lang.String |
getPath() |
int |
getPos()
Returns the current offset in this stream.
|
int |
getSize() |
int |
getSlot() |
Time |
getTime(byte whichTime) |
static boolean |
isCardInserted(int slot) |
boolean |
isDir() |
boolean |
isEmpty() |
java.lang.String[] |
listFiles() |
static java.lang.String[] |
listFiles(java.lang.String dir) |
static java.lang.String[] |
listFiles(java.lang.String dir,
boolean recursive) |
static java.lang.String[] |
listRoots() |
static void |
move(java.lang.String src,
java.lang.String dst) |
void |
moveTo(File dest) |
byte[] |
read()
Deprecated.
|
byte[] |
readAndClose()
Deprecated.
|
byte[] |
readAndDelete()
Deprecated.
|
int |
readBytes(byte[] b,
int off,
int len)
Reads bytes from the stream.
|
void |
rename(java.lang.String path) |
void |
setAttributes(int attr) |
void |
setPos(int pos)
Sets the file pointer for read and write operations to the given position.
|
void |
setPos(int offset,
int origin)
Sets the file pointer for read and write operations to a new position defined by adding offset to a reference
position specified by origin.
|
void |
setSize(int newSize) |
void |
setTime(byte whichTime,
Time time) |
void |
writeAndClose(byte[] bytes)
Deprecated.
|
int |
writeBytes(byte[] b,
int off,
int len)
Writes bytes to the stream.
|
asInputStream, asOutputStream, asStream, asStream, skipBytes, wrapInputStream, wrapInputStreamToStream, write, writeBytes, writeBytes, writeBytes
protected java.lang.String path
public static final int CLOSED
public static final byte TIME_ALL
public static final byte TIME_CREATED
public static final byte TIME_MODIFIED
public static final byte TIME_ACCESSED
public static final int ATTR_ARCHIVE
public static final int ATTR_HIDDEN
public static final int ATTR_READ_ONLY
public static final int ATTR_SYSTEM
public static java.lang.String[] winceVols
public File4D(java.lang.String path, int mode, int slot) throws IllegalArgumentIOException, FileNotFoundException, IOException
public File4D(java.lang.String path, int mode) throws IllegalArgumentIOException, FileNotFoundException, IOException
public File4D(java.lang.String path) throws IllegalArgumentIOException, IOException
public void close() throws IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
IOException
- If an I/O error occurs.public java.lang.String getPath()
public int getPos() throws IOException
RandomAccessStream
getPos
in class RandomAccessStream
IOException
- if an I/O error has occurred.public void setPos(int offset, int origin) throws IOException
RandomAccessStream
setPos
in class RandomAccessStream
offset
- number of bytes to offset from origin.origin
- position from where offset is added. It is specified by one of the SEEK_* constants.IOException
- if the new position is negative or if an I/O error occurs.public static boolean isCardInserted(int slot) throws IllegalArgumentIOException
IllegalArgumentIOException
public void createDir() throws IOException
IOException
public void delete() throws FileNotFoundException, IOException
FileNotFoundException
IOException
public boolean exists() throws IOException
IOException
public int getSize() throws IOException
IOException
public boolean isDir() throws IOException
IOException
public java.lang.String[] listFiles() throws IOException
IOException
public int readBytes(byte[] b, int off, int len) throws IOException
Stream
readBytes
in class Stream
b
- the byte array to read data intooff
- the start position in the arraylen
- the number of bytes to readIOException
public void rename(java.lang.String path) throws IllegalArgumentIOException, IOException
public void setPos(int pos) throws IOException
RandomAccessStream
setPos
in class RandomAccessStream
pos
- the offset position, measured in bytes from the beginning of the file, at which to set the file pointer.IOException
- if pos is negative or if an I/O error occurs.public int writeBytes(byte[] b, int off, int len) throws IOException
Stream
IOException
if an error prevented the write
operation from occurring.writeBytes
in class Stream
b
- the byte array to write data fromoff
- the start position in the byte arraylen
- the number of bytes to writeIOException
public void setAttributes(int attr) throws IllegalArgumentIOException, IOException
public int getAttributes() throws IOException
IOException
public void setTime(byte whichTime, Time time) throws IllegalArgumentIOException, IOException
public Time getTime(byte whichTime) throws IllegalArgumentIOException, IOException
public void setSize(int newSize) throws IOException
IOException
public static java.lang.String getCardSerialNumber(int slot) throws IllegalArgumentIOException, IOException
public boolean isEmpty() throws IOException
IOException
public File getParent() throws IOException
IOException
public static File getCardVolume() throws IOException
IOException
public void flush() throws IOException
IOException
protected void finalize()
finalize
in class java.lang.Object
public int getSlot()
public static java.lang.String[] listFiles(java.lang.String dir) throws IOException
IOException
public static java.lang.String[] listFiles(java.lang.String dir, boolean recursive) throws IOException
IOException
public static void deleteDir(java.lang.String dir) throws IOException
IOException
public static java.lang.String[] listRoots()
public void copyTo(File dest) throws IOException
IOException
public void moveTo(File dest) throws IOException
IOException
public int chmod(int mod) throws IOException
IOException
public static void copy(java.lang.String src, java.lang.String dst) throws IOException
IOException
public static void move(java.lang.String src, java.lang.String dst) throws IOException
IOException
@Deprecated public byte[] readAndClose() throws IOException
IOException
@Deprecated public byte[] readAndDelete() throws IOException
IOException
@Deprecated public byte[] read() throws IOException
IOException
@Deprecated public void writeAndClose(byte[] bytes) throws IOException
IOException