com.threerings.jpkg.ar
Class ArchiveStringEntry

java.lang.Object
  extended by com.threerings.jpkg.ar.ArchiveStringEntry
All Implemented Interfaces:
ArchiveEntry

public class ArchiveStringEntry
extends Object
implements ArchiveEntry

An ArchiveEntry where the entry data is a held in a string.


Constructor Summary
ArchiveStringEntry(String data, String path)
          Construct an ArchiveStringEntry with the supplied string as the entry data and the supplied path name as the entry path in the archive.
 
Method Summary
 int getGroupId()
          Returns the group id which will own this entry in the archive.
 InputStream getInputStream()
          Returns an InputStream from the data contained in this entry.
 int getMode()
          Returns the file permissions mode (e.g.
 String getPath()
          Returns the path name used to identify this entry in the archive.
 long getSize()
          Returns the size of the data contained in this entry in bytes.
 int getUserId()
          Returns the user id which will own this entry in the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveStringEntry

public ArchiveStringEntry(String data,
                          String path)
Construct an ArchiveStringEntry with the supplied string as the entry data and the supplied path name as the entry path in the archive. The entry will be owned by the root user and group and have standard permissions.

Parameters:
data - The string data for the entry.
path - The path name in the archive.
See Also:
UnixStandardPermissions.ROOT_USER, UnixStandardPermissions.ROOT_GROUP, UnixStandardPermissions.STANDARD_FILE_MODE
Method Detail

getInputStream

public InputStream getInputStream()
Description copied from interface: ArchiveEntry
Returns an InputStream from the data contained in this entry.

Specified by:
getInputStream in interface ArchiveEntry

getSize

public long getSize()
Description copied from interface: ArchiveEntry
Returns the size of the data contained in this entry in bytes. An Archive can only store data whose size can be expressed in a 32 bit integer however the interface allows size to be expressed as a long to support for example File objects. The Archive class will guarantee that the size returned by this method can be converted safely into a 32 bit integer.

Specified by:
getSize in interface ArchiveEntry

getPath

public String getPath()
Description copied from interface: ArchiveEntry
Returns the path name used to identify this entry in the archive. Must be 15 characters or less.

Specified by:
getPath in interface ArchiveEntry

getUserId

public int getUserId()
Description copied from interface: ArchiveEntry
Returns the user id which will own this entry in the archive.

Specified by:
getUserId in interface ArchiveEntry

getGroupId

public int getGroupId()
Description copied from interface: ArchiveEntry
Returns the group id which will own this entry in the archive.

Specified by:
getGroupId in interface ArchiveEntry

getMode

public int getMode()
Description copied from interface: ArchiveEntry
Returns the file permissions mode (e.g. 0644) for this entry in the archive.

Specified by:
getMode in interface ArchiveEntry


Copyright © 2007-2008 Three Rings Design, Inc. All Rights Reserved. Released under a BSD license.