Java Doc for TarEntry.java in  » Build » ANT » org » apache » tools » 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 » Build » ANT » org.apache.tools.tar 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.tar.TarEntry

TarEntry
public class TarEntry implements TarConstants(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;
 


Field Summary
final public static  intDEFAULT_DIR_MODE
    
final public static  intDEFAULT_FILE_MODE
    
final public static  intMAX_NAMELEN
    
final public static  intMILLIS_PER_SECOND
    

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

Method Summary
public  booleanequals(TarEntry it)
     Determine if the two entries are equal.
public  booleanequals(Object it)
     Determine if the two entries are equal.
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  StringgetGroupName()
     Get this entry's group name.
public  StringgetLinkName()
     Get this entry's link 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  StringgetUserName()
     Get this entry's user name.
public  inthashCode()
     Hashcodes are based on entry names.
public  booleanisDescendent(TarEntry desc)
     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 this.
public  booleanisDirectory()
     Return whether or not this entry represents a directory.
public  booleanisGNULongNameEntry()
    
public  voidparseTarHeader(byte[] header)
     Parse an entry's header information from a header buffer.
public  voidsetGroupId(int groupId)
     Set this entry's group id.
public  voidsetGroupName(String groupName)
     Set this entry's group name.
public  voidsetIds(int userId, int groupId)
     Convenience method to set this entry's group and user ids.
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  voidsetNames(String userName, String groupName)
     Convenience method to set this entry's group and user names.
public  voidsetSize(long size)
     Set this entry's file size.
public  voidsetUserId(int userId)
     Set this entry's user id.
public  voidsetUserName(String userName)
     Set this entry's user name.
public  voidwriteEntryHeader(byte[] outbuf)
     Write an entry's header information to a header buffer.

Field Detail
DEFAULT_DIR_MODE
final public static int DEFAULT_DIR_MODE(Code)
Default permissions bits for directories



DEFAULT_FILE_MODE
final public static int DEFAULT_FILE_MODE(Code)
Default permissions bits for files



MAX_NAMELEN
final public static int MAX_NAMELEN(Code)
Maximum length of a user's name in the tar file



MILLIS_PER_SECOND
final public static int MILLIS_PER_SECOND(Code)
Convert millis to seconds




Constructor Detail
TarEntry
public 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 entry name



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



TarEntry
public 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
public TarEntry(byte[] headerBuf)(Code)
Construct an entry from an archive's header bytes. File is set to null.
Parameters:
  headerBuf - The header bytes from a tar archive entry.




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



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



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.



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



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



getModTime
public Date getModTime()(Code)
Set this entry's modification time. time This entry's new modification time.



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.



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



hashCode
public int hashCode()(Code)
Hashcodes are based on entry names. the entry hashcode



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 this. True if entry is a descendant of this.



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



parseTarHeader
public void parseTarHeader(byte[] header)(Code)
Parse an entry's header information from a header buffer.
Parameters:
  header - The tar entry header buffer to get information from.



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



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



setIds
public void setIds(int userId, int groupId)(Code)
Convenience method to set this entry's group and user ids.
Parameters:
  userId - This entry's new user id.
Parameters:
  groupId - This entry's new group id.



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 mode for this entry



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



setNames
public void setNames(String userName, String groupName)(Code)
Convenience method to set this entry's group and user names.
Parameters:
  userName - This entry's new user name.
Parameters:
  groupName - This entry's new group 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.



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[] outbuf)(Code)
Write an entry's header information to a header buffer.
Parameters:
  outbuf - 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.