jSyncManager

org.jSyncManager.API.Protocol.Util.VFS
Class FileReference

java.lang.Object
  extended byorg.jSyncManager.API.Protocol.Util.VFS.FileReference

public class FileReference
extends java.lang.Object

A representation of a file reference for use with VFS on a device. This class is used by nearly all VFS functions that do any sort of file I/O. It provides a mechanism for identifying the file being worked on.

Version:
$Revision: 1.7 $
Author:
Brad BARCLAY <bbarclay@jsyncmanager.org>
Last modified by: $Author: yaztromo $ on $Date: 2004/08/11 05:21:52 $.

Field Summary
static char OPEN_EXCLUSIVE_MODE_FLAG
          A flag to denote that the file should be opened in Exclusive mode.
static char OPEN_READ_MODE_FLAG
          A flag to denote that the file should be opened for Read access.
static char OPEN_READ_WRITE_MODE_FLAG
          A flag to denote that the file should be opened for Read/Write access.
static char OPEN_WRITE_MODE_FLAG
          A flag to denote that the file should be opened for Write access.
static char SEEK_ORIGIN_BEGINNING
          A flag to denote we wish to seek from the beginning of the file.
static char SEEK_ORIGIN_CURRENT_POSITION
          A flag to denote we wish to seek from the current position in the file.
static char SEEK_ORIGIN_END
          A flag to denote we wish to seek from the end of the file.
static int VFS_FILE_ARCHIVE
          A flag to denote that the file has the archive attribute set.
static int VFS_FILE_HIDDEN
          A flag to denote that the file is hidden.
static int VFS_FILE_IS_DIRECTORY
          A flag to denote that the file is a directory.
static int VFS_FILE_IS_LINK
          A flag to denote that the file is a link.
static int VFS_FILE_READ_ONLY
          A flag to denote that the file is read only (or a directory).
static int VFS_FILE_SYSTEM
          A flag to denote that the file has the system attribute.
static int VFS_FILE_VOLUME_LABEL
          A flag to denote that the file is a volume label.
 
Constructor Summary
FileReference(int i)
          Constructs a new file reference object.
 
Method Summary
 int getFileReferenceAsInt()
          Retreives the integer representing this file reference.
 void putToByteArray(byte[] buffer)
          Puts the file reference into an array of bytes.
 void putToByteArray(byte[] buffer, int position)
          Puts the file reference into an array of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN_EXCLUSIVE_MODE_FLAG

public static final char OPEN_EXCLUSIVE_MODE_FLAG
A flag to denote that the file should be opened in Exclusive mode.

See Also:
Constant Field Values

OPEN_READ_MODE_FLAG

public static final char OPEN_READ_MODE_FLAG
A flag to denote that the file should be opened for Read access.

See Also:
Constant Field Values

OPEN_WRITE_MODE_FLAG

public static final char OPEN_WRITE_MODE_FLAG
A flag to denote that the file should be opened for Write access.

See Also:
Constant Field Values

OPEN_READ_WRITE_MODE_FLAG

public static final char OPEN_READ_WRITE_MODE_FLAG
A flag to denote that the file should be opened for Read/Write access.

See Also:
Constant Field Values

VFS_FILE_READ_ONLY

public static final int VFS_FILE_READ_ONLY
A flag to denote that the file is read only (or a directory).

See Also:
Constant Field Values

VFS_FILE_HIDDEN

public static final int VFS_FILE_HIDDEN
A flag to denote that the file is hidden.

See Also:
Constant Field Values

VFS_FILE_SYSTEM

public static final int VFS_FILE_SYSTEM
A flag to denote that the file has the system attribute.

See Also:
Constant Field Values

VFS_FILE_VOLUME_LABEL

public static final int VFS_FILE_VOLUME_LABEL
A flag to denote that the file is a volume label.

See Also:
Constant Field Values

VFS_FILE_IS_DIRECTORY

public static final int VFS_FILE_IS_DIRECTORY
A flag to denote that the file is a directory.

See Also:
Constant Field Values

VFS_FILE_ARCHIVE

public static final int VFS_FILE_ARCHIVE
A flag to denote that the file has the archive attribute set.

See Also:
Constant Field Values

VFS_FILE_IS_LINK

public static final int VFS_FILE_IS_LINK
A flag to denote that the file is a link.

See Also:
Constant Field Values

SEEK_ORIGIN_BEGINNING

public static final char SEEK_ORIGIN_BEGINNING
A flag to denote we wish to seek from the beginning of the file.

See Also:
Constant Field Values

SEEK_ORIGIN_CURRENT_POSITION

public static final char SEEK_ORIGIN_CURRENT_POSITION
A flag to denote we wish to seek from the current position in the file.

See Also:
Constant Field Values

SEEK_ORIGIN_END

public static final char SEEK_ORIGIN_END
A flag to denote we wish to seek from the end of the file.

See Also:
Constant Field Values
Constructor Detail

FileReference

public FileReference(int i)
Constructs a new file reference object.

Parameters:
i - the file reference number.
Method Detail

getFileReferenceAsInt

public int getFileReferenceAsInt()
Retreives the integer representing this file reference.

Returns:
the integer representing this file reference.

putToByteArray

public void putToByteArray(byte[] buffer,
                           int position)
Puts the file reference into an array of bytes.

Parameters:
buffer - the byte array to write the file reference to.
position - the location to write to in the array.

putToByteArray

public void putToByteArray(byte[] buffer)
Puts the file reference into an array of bytes. This method puts the file reference into the specified array starting at index 0.

Parameters:
buffer - the byte array to write the file reference to.

jSyncManager

Copyright (c) 1999 - 2004 Brad BARCLAY and others. All Rights Reserved.