Java Doc for TarEntry.java in  » Swing-Library » jEdit » installer » 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 » Swing Library » jEdit » installer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   installer.TarEntry

TarEntry
public class TarEntry extends Object (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;
 

See Also:   TarHeader


Field Summary
protected  Filefile
     If this entry represents a File, this references it.
protected  TarHeaderheader
     This is the entry's header information.

Constructor Summary
public  TarEntry(String name)
     Construct an entry with only a name.
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  voidadjustEntryName(byte[] outbuf, String newName)
     Convenience method that will modify an entry's name directly in place in an entry header buffer byte array.
public  longcomputeCheckSum(byte[] buf)
     Compute the checksum of a tar entry header.
Parameters:
  buf - The tar entry's header buffer.
public  booleanequals(TarEntry 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  voidgetFileTarHeader(TarHeader hdr, File file)
     Fill in a TarHeader with information from a File.
public  intgetGroupId()
     Get this entry's group id.
public  StringgetGroupName()
     Get this entry's group name.
public  TarHeadergetHeader()
     Get this entry's header.
public  DategetModTime()
     Set this entry's modification time.
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  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  voidnameTarHeader(TarHeader hdr, String name)
     Fill in a TarHeader given only the entry's name.
public  voidparseTarHeader(TarHeader hdr, byte[] header)
     Parse an entry's TarHeader 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  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
file
protected File file(Code)
If this entry represents a File, this references it.



header
protected TarHeader header(Code)
This is the entry's header information.




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.



TarEntry
public TarEntry(File file) throws InvalidHeaderException(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) throws InvalidHeaderException(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
adjustEntryName
public void adjustEntryName(byte[] outbuf, String newName)(Code)
Convenience method that will modify an entry's name directly in place in an entry header buffer byte array.
Parameters:
  outbuf - The buffer containing the entry header to modify.
Parameters:
  newName - The new name to place into the header buffer.



computeCheckSum
public long computeCheckSum(byte[] buf)(Code)
Compute the checksum of a tar entry header.
Parameters:
  buf - The tar entry's header buffer. The computed checksum.



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



getDirectoryEntries
public TarEntry[] getDirectoryEntries() throws InvalidHeaderException(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.



getFileTarHeader
public void getFileTarHeader(TarHeader hdr, File file) throws InvalidHeaderException(Code)
Fill in a TarHeader with information from a File.
Parameters:
  hdr - The TarHeader to fill in.
Parameters:
  file - The file from which to get the header information.



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.



getHeader
public TarHeader getHeader()(Code)
Get this entry's header. This entry's TarHeader.



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



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.



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.



nameTarHeader
public void nameTarHeader(TarHeader hdr, String name)(Code)
Fill in a TarHeader given only the entry's name.
Parameters:
  hdr - The TarHeader to fill in.
Parameters:
  name - The tar entry name.



parseTarHeader
public void parseTarHeader(TarHeader hdr, byte[] header) throws InvalidHeaderException(Code)
Parse an entry's TarHeader information from a header buffer.
Parameters:
  hdr - The TarHeader to fill in from the buffer information.
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.



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.