Java Doc for TarEntry.java in  » Library » Apache-commons-vfs-20070724-src » org » apache » commons » vfs » provider » tar » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons vfs 20070724 src » org.apache.commons.vfs.provider.tar 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.vfs.provider.tar.TarEntry

TarEntry
class TarEntry (Code)
This class represents an entry in a Tar archive. It consists of the entry's header, as well as the entry's File. Entries can be instantiated in one of three ways, depending on how they are to be used.

TarEntries that are created from the header bytes read from an archive are instantiated with the TarEntry( byte[] ) constructor. These entries will be used when extracting from or listing the contents of an archive. These entries have their header filled in using the header bytes. They also set the File to null, since they reference an archive entry not a file.

TarEntries that are created from Files that are to be written into an archive are instantiated with the TarEntry( File ) constructor. These entries have their header filled in using the File's information. They also keep a reference to the File for convenience when writing entries.

Finally, TarEntries can be constructed from nothing but a name. This allows the programmer to construct the entry by hand, for instance when only an InputStream is available for writing to the archive, and the header information is constructed from other information. In this case the header fields are set to defaults and the File is set to null.

The C structure for a Tar Entry's header is:

 struct header {
 char name[NAMSIZ];
 char mode[8];
 char uid[8];
 char gid[8];
 char size[12];
 char mtime[12];
 char chksum[8];
 char linkflag;
 char linkname[NAMSIZ];
 char magic[8];
 char uname[TUNMLEN];
 char gname[TGNMLEN];
 char devmajor[8];
 char devminor[8];
 } header;
 

author:
   Timothy Gerard Endres
author:
   Stefano Mazzocchi
author:
   Peter Donald
version:
   $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
See Also:   TarInputStream
See Also:   TarOutputStream


Field Summary
final public static  intNAMELEN
     The length of the name field in a header buffer.

Constructor Summary
 TarEntry(String name)
     Construct an entry with only a name.
 TarEntry(String name, byte linkFlag)
     Construct an entry with a name an a link flag.
 TarEntry(File file)
     Construct an entry for a file.
 TarEntry(byte[] header)
     Construct an entry from an archive's header bytes.

Method Summary
public  booleanequals(TarEntry other)
     Determine if the two entries are equal.
public  intgetCheckSum()
     Get this entry's checksum.
public  TarEntry[]getDirectoryEntries()
     If this entry represents a file, and the file is a directory, return an array of TarEntries for this entry's children.
public  FilegetFile()
     Get this entry's file.
public  intgetGroupID()
     Get this entry's group id.
public  intgetGroupId()
     Get this entry's group id.
public  StringgetGroupName()
     Get this entry's group name.
public  DategetModTime()
     Set this entry's modification time.
public  intgetMode()
     Get this entry's mode.
public  StringgetName()
     Get this entry's name.
public  longgetSize()
     Get this entry's file size.
public  intgetUserID()
     Get this entry's user id.
public  intgetUserId()
     Get this entry's user id.
public  StringgetUserName()
     Get this entry's user name.
public  booleanisDescendent(TarEntry desc)
     Determine if the given entry is a descendant of this entry.
public  booleanisDirectory()
     Return whether or not this entry represents a directory.
public  booleanisGNULongNameEntry()
    
public  voidsetGroupID(int groupId)
     Set this entry's group id.
public  voidsetGroupId(int groupId)
     Set this entry's group id.
public  voidsetGroupName(String groupName)
     Set this entry's group name.
public  voidsetModTime(long time)
     Set this entry's modification time.
public  voidsetModTime(Date time)
     Set this entry's modification time.
public  voidsetMode(int mode)
    
public  voidsetName(String name)
     Set this entry's name.
public  voidsetSize(long size)
     Set this entry's file size.
public  voidsetUserID(int userId)
     Set this entry's user id.
public  voidsetUserId(int userId)
     Set this entry's user id.
public  voidsetUserName(String userName)
     Set this entry's user name.
public  voidwriteEntryHeader(byte[] buffer)
     Write an entry's header information to a header buffer.

Field Detail
NAMELEN
final public static int NAMELEN(Code)
The length of the name field in a header buffer.




Constructor Detail
TarEntry
TarEntry(String name)(Code)
Construct an entry with only a name. This allows the programmer to construct the entry's header "by hand". File is set to null.
Parameters:
  name - the name of the entry



TarEntry
TarEntry(String name, byte linkFlag)(Code)
Construct an entry with a name an a link flag.
Parameters:
  name - Description of Parameter
Parameters:
  linkFlag - Description of Parameter



TarEntry
TarEntry(File file)(Code)
Construct an entry for a file. File is set to file, and the header is constructed from information from the file.
Parameters:
  file - The file that the entry represents.



TarEntry
TarEntry(byte[] header)(Code)
Construct an entry from an archive's header bytes. File is set to null.
Parameters:
  header - The header bytes from a tar archive entry.




Method Detail
equals
public boolean equals(TarEntry other)(Code)
Determine if the two entries are equal. Equality is determined by the header names being equal.
Parameters:
  other - Entry to be checked for equality. True if the entries are equal.



getCheckSum
public int getCheckSum()(Code)
Get this entry's checksum. This entry's checksum.



getDirectoryEntries
public TarEntry[] getDirectoryEntries()(Code)
If this entry represents a file, and the file is a directory, return an array of TarEntries for this entry's children. An array of TarEntry's for this entry's children.



getFile
public File getFile()(Code)
Get this entry's file. This entry's file.



getGroupID
public int getGroupID()(Code)
Get this entry's group id. This entry's group id.



getGroupId
public int getGroupId()(Code)
Get this entry's group id. This entry's group id.
See Also:   TarEntry.getGroupID()



getGroupName
public String getGroupName()(Code)
Get this entry's group name. This entry's group name.



getModTime
public Date getModTime()(Code)
Set this entry's modification time. The ModTime value



getMode
public int getMode()(Code)
Get this entry's mode. This entry's mode.



getName
public String getName()(Code)
Get this entry's name. This entry's name.



getSize
public long getSize()(Code)
Get this entry's file size. This entry's file size.



getUserID
public int getUserID()(Code)
Get this entry's user id. This entry's user id.



getUserId
public int getUserId()(Code)
Get this entry's user id. This entry's user id.
See Also:   TarEntry.getUserID()



getUserName
public String getUserName()(Code)
Get this entry's user name. This entry's user name.



isDescendent
public boolean isDescendent(TarEntry desc)(Code)
Determine if the given entry is a descendant of this entry. Descendancy is determined by the name of the descendant starting with this entry's name.
Parameters:
  desc - Entry to be checked as a descendent of True if entry is a descendant of



isDirectory
public boolean isDirectory()(Code)
Return whether or not this entry represents a directory. True if this entry is a directory.



isGNULongNameEntry
public boolean isGNULongNameEntry()(Code)
Indicate if this entry is a GNU long name block true if this is a long name extension provided by GNU tar



setGroupID
public void setGroupID(int groupId)(Code)
Set this entry's group id.
Parameters:
  groupId - This entry's new group id.



setGroupId
public void setGroupId(int groupId)(Code)
Set this entry's group id.
Parameters:
  groupId - This entry's new group id.
See Also:   TarEntry.setGroupID(int)



setGroupName
public void setGroupName(String groupName)(Code)
Set this entry's group name.
Parameters:
  groupName - This entry's new group name.



setModTime
public void setModTime(long time)(Code)
Set this entry's modification time. The parameter passed to this method is in "Java time".
Parameters:
  time - This entry's new modification time.



setModTime
public void setModTime(Date time)(Code)
Set this entry's modification time.
Parameters:
  time - This entry's new modification time.



setMode
public void setMode(int mode)(Code)
Set the mode for this entry
Parameters:
  mode - The new Mode value



setName
public void setName(String name)(Code)
Set this entry's name.
Parameters:
  name - This entry's new name.



setSize
public void setSize(long size)(Code)
Set this entry's file size.
Parameters:
  size - This entry's new file size.



setUserID
public void setUserID(int userId)(Code)
Set this entry's user id.
Parameters:
  userId - This entry's new user id.



setUserId
public void setUserId(int userId)(Code)
Set this entry's user id.
Parameters:
  userId - This entry's new user id.
See Also:   TarEntry.setUserID(int)



setUserName
public void setUserName(String userName)(Code)
Set this entry's user name.
Parameters:
  userName - This entry's new user name.



writeEntryHeader
public void writeEntryHeader(byte[] buffer)(Code)
Write an entry's header information to a header buffer.
Parameters:
  buffer - The tar entry header buffer to fill in.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.