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


org.apache.tools.ant.taskdefs.MatchingTask
   org.apache.tools.ant.taskdefs.Tar

Tar
public class Tar extends MatchingTask (Code)
Creates a tar archive.
since:
   Ant 1.1

Inner Class :public static class TarFileSet extends org.apache.tools.ant.types.TarFileSet
Inner Class :public static class TarLongFileMode extends EnumeratedAttribute
Inner Class :final public static class TarCompressionMethod extends EnumeratedAttribute

Field Summary
final public static  StringFAIL
    
final public static  StringGNU
    
final public static  StringOMIT
    
final public static  StringTRUNCATE
    
final public static  StringWARN
    
 FilebaseDir
    
 VectorfileSetFiles
    
 Vectorfilesets
    
 FiletarFile
    


Method Summary
public  voidadd(ResourceCollection res)
     Add a collection of resources to archive.
protected  booleanarchiveIsUpToDate(String[] files)
     Is the archive up to date in relationship to a list of files.
protected  booleanarchiveIsUpToDate(String[] files, File dir)
     Is the archive up to date in relationship to a list of files.
Parameters:
  files - the files to check
Parameters:
  dir - the base directory for the files.
protected  booleanarchiveIsUpToDate(Resource r)
     Is the archive up to date in relationship to a list of files.
protected  TarFileSetasTarFileSet(ArchiveFileSet archiveFileSet)
     Copies fullpath, prefix and permission attributes from the ArchiveFileSet to a new TarFileSet (or returns it unchanged if it already is a TarFileSet).
protected  booleancheck(ResourceCollection rc)
     Checks whether the archive is out-of-date with respect to the resources of the given collection.
protected  booleancheck(File basedir, String[] files)
    
public  TarFileSetcreateTarFileSet()
    
public  voidexecute()
    
final protected static  String[]getFileNames(FileSet fs)
     Grabs all included files and directors from the FileSet and returns them as an array of (relative) file names.
Parameters:
  fs - the fileset to operate on.
final protected static  booleanisFileFileSet(ResourceCollection rc)
     whether the given resource collection is a (subclass of) FileSet that only contains file system resources.
Parameters:
  rc - the resource collection to check.
public  voidsetBasedir(File baseDir)
     This is the base directory to look in for things to tar.
public  voidsetCompression(TarCompressionMethod mode)
     Set compression method.
public  voidsetDestFile(File destFile)
     Set is the name/location of where to create the tar file.
public  voidsetLongfile(String mode)
     Set how to handle long files, those with a path>100 chars.
public  voidsetLongfile(TarLongFileMode mode)
     Set how to handle long files, those with a path>100 chars.
public  voidsetTarfile(File tarFile)
     Set is the name/location of where to create the tar file.
protected  booleansupportsNonFileResources()
     Whether this task can deal with non-file resources.

This implementation returns true only if this task is <tar>.

protected  voidtar(ResourceCollection rc, TarOutputStream tOut)
     Adds the resources contained in this collection to the archive.
protected  voidtarFile(File file, TarOutputStream tOut, String vPath, TarFileSet tarFileSet)
    
protected  voidtarResource(Resource r, TarOutputStream tOut, String vPath, TarFileSet tarFileSet)
    

Field Detail
FAIL
final public static String FAIL(Code)



GNU
final public static String GNU(Code)



OMIT
final public static String OMIT(Code)



TRUNCATE
final public static String TRUNCATE(Code)



WARN
final public static String WARN(Code)



baseDir
File baseDir(Code)



fileSetFiles
Vector fileSetFiles(Code)



filesets
Vector filesets(Code)



tarFile
File tarFile(Code)





Method Detail
add
public void add(ResourceCollection res)(Code)
Add a collection of resources to archive.
Parameters:
  res - a resource collection to archive.
since:
   Ant 1.7



archiveIsUpToDate
protected boolean archiveIsUpToDate(String[] files)(Code)
Is the archive up to date in relationship to a list of files.
Parameters:
  files - the files to check true if the archive is up to date.



archiveIsUpToDate
protected boolean archiveIsUpToDate(String[] files, File dir)(Code)
Is the archive up to date in relationship to a list of files.
Parameters:
  files - the files to check
Parameters:
  dir - the base directory for the files. true if the archive is up to date.
since:
   Ant 1.5.2



archiveIsUpToDate
protected boolean archiveIsUpToDate(Resource r)(Code)
Is the archive up to date in relationship to a list of files.
Parameters:
  r - the files to check true if the archive is up to date.
since:
   Ant 1.7



asTarFileSet
protected TarFileSet asTarFileSet(ArchiveFileSet archiveFileSet)(Code)
Copies fullpath, prefix and permission attributes from the ArchiveFileSet to a new TarFileSet (or returns it unchanged if it already is a TarFileSet).
Parameters:
  archiveFileSet - fileset to copy attributes from, may be null a new TarFileSet.
since:
   Ant 1.7



check
protected boolean check(ResourceCollection rc)(Code)
Checks whether the archive is out-of-date with respect to the resources of the given collection.

Also checks that either all collections only contain file resources or this class supports non-file collections.

And - in case of file-collections - ensures that the archive won't contain itself.


Parameters:
  rc - the resource collection to check whether the archive is up-to-date
since:
   Ant 1.7



check
protected boolean check(File basedir, String[] files)(Code)
Checks whether the archive is out-of-date with respect to the given files, ensures that the archive won't contain itself.


Parameters:
  basedir - base directory for file names
Parameters:
  files - array of relative file names whether the archive is up-to-date
since:
   Ant 1.7



createTarFileSet
public TarFileSet createTarFileSet()(Code)
Add a new fileset with the option to specify permissions the tar fileset to be used as the nested element.



execute
public void execute() throws BuildException(Code)
do the business
throws:
  BuildException - on error



getFileNames
final protected static String[] getFileNames(FileSet fs)(Code)
Grabs all included files and directors from the FileSet and returns them as an array of (relative) file names.
Parameters:
  fs - the fileset to operate on. a list of the filenames.
since:
   Ant 1.7



isFileFileSet
final protected static boolean isFileFileSet(ResourceCollection rc)(Code)
whether the given resource collection is a (subclass of) FileSet that only contains file system resources.
Parameters:
  rc - the resource collection to check. true if the collection is a fileset.
since:
   Ant 1.7



setBasedir
public void setBasedir(File baseDir)(Code)
This is the base directory to look in for things to tar.
Parameters:
  baseDir - the base directory.



setCompression
public void setCompression(TarCompressionMethod mode)(Code)
Set compression method. Allowable values are
  • none - no compression
  • gzip - Gzip compression
  • bzip2 - Bzip2 compression

Parameters:
  mode - the compression method.



setDestFile
public void setDestFile(File destFile)(Code)
Set is the name/location of where to create the tar file.
since:
   Ant 1.5
Parameters:
  destFile - The output of the tar



setLongfile
public void setLongfile(String mode)(Code)
Set how to handle long files, those with a path>100 chars. Optional, default=warn.

Allowable values are

  • truncate - paths are truncated to the maximum length
  • fail - paths greater than the maximum cause a build exception
  • warn - paths greater than the maximum cause a warning and GNU is used
  • gnu - GNU extensions are used for any paths greater than the maximum.
  • omit - paths greater than the maximum are omitted from the archive

Parameters:
  mode - the mode string to handle long files.



setLongfile
public void setLongfile(TarLongFileMode mode)(Code)
Set how to handle long files, those with a path>100 chars. Optional, default=warn.

Allowable values are

  • truncate - paths are truncated to the maximum length
  • fail - paths greater than the maximum cause a build exception
  • warn - paths greater than the maximum cause a warning and GNU is used
  • gnu - GNU extensions are used for any paths greater than the maximum.
  • omit - paths greater than the maximum are omitted from the archive

Parameters:
  mode - the mode to handle long file names.



setTarfile
public void setTarfile(File tarFile)(Code)
Set is the name/location of where to create the tar file.
Parameters:
  tarFile - the location of the tar file.



supportsNonFileResources
protected boolean supportsNonFileResources()(Code)
Whether this task can deal with non-file resources.

This implementation returns true only if this task is <tar>. Any subclass of this class that also wants to support non-file resources needs to override this method. We need to do so for backwards compatibility reasons since we can't expect subclasses to support resources.

true for this task.
since:
   Ant 1.7



tar
protected void tar(ResourceCollection rc, TarOutputStream tOut) throws IOException(Code)
Adds the resources contained in this collection to the archive.

Uses the file based methods for file resources for backwards compatibility.


Parameters:
  rc - the collection containing resources to add
Parameters:
  tOut - stream writing to the archive.
throws:
  IOException - on error.
since:
   Ant 1.7



tarFile
protected void tarFile(File file, TarOutputStream tOut, String vPath, TarFileSet tarFileSet) throws IOException(Code)
tar a file
Parameters:
  file - the file to tar
Parameters:
  tOut - the output stream
Parameters:
  vPath - the path name of the file to tar
Parameters:
  tarFileSet - the fileset that the file came from.
throws:
  IOException - on error



tarResource
protected void tarResource(Resource r, TarOutputStream tOut, String vPath, TarFileSet tarFileSet) throws IOException(Code)
tar a resource
Parameters:
  r - the resource to tar
Parameters:
  tOut - the output stream
Parameters:
  vPath - the path name of the file to tar
Parameters:
  tarFileSet - the fileset that the file came from, may be null.
throws:
  IOException - on error
since:
   Ant 1.7



Fields inherited from org.apache.tools.ant.taskdefs.MatchingTask
protected FileSet fileset(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.taskdefs.MatchingTask
public void XsetIgnore(String ignoreString)(Code)(Java Doc)
public void XsetItems(String itemString)(Code)(Java Doc)
public void add(FileSelector selector)(Code)(Java Doc)
public void addAnd(AndSelector selector)(Code)(Java Doc)
public void addContains(ContainsSelector selector)(Code)(Java Doc)
public void addContainsRegexp(ContainsRegexpSelector selector)(Code)(Java Doc)
public void addCustom(ExtendSelector selector)(Code)(Java Doc)
public void addDate(DateSelector selector)(Code)(Java Doc)
public void addDepend(DependSelector selector)(Code)(Java Doc)
public void addDepth(DepthSelector selector)(Code)(Java Doc)
public void addDifferent(DifferentSelector selector)(Code)(Java Doc)
public void addFilename(FilenameSelector selector)(Code)(Java Doc)
public void addMajority(MajoritySelector selector)(Code)(Java Doc)
public void addModified(ModifiedSelector selector)(Code)(Java Doc)
public void addNone(NoneSelector selector)(Code)(Java Doc)
public void addNot(NotSelector selector)(Code)(Java Doc)
public void addOr(OrSelector selector)(Code)(Java Doc)
public void addPresent(PresentSelector selector)(Code)(Java Doc)
public void addSelector(SelectSelector selector)(Code)(Java Doc)
public void addSize(SizeSelector selector)(Code)(Java Doc)
public void addType(TypeSelector selector)(Code)(Java Doc)
public void appendSelector(FileSelector selector)(Code)(Java Doc)
public PatternSet.NameEntry createExclude()(Code)(Java Doc)
public PatternSet.NameEntry createExcludesFile()(Code)(Java Doc)
public PatternSet.NameEntry createInclude()(Code)(Java Doc)
public PatternSet.NameEntry createIncludesFile()(Code)(Java Doc)
public PatternSet createPatternSet()(Code)(Java Doc)
protected DirectoryScanner getDirectoryScanner(File baseDir)(Code)(Java Doc)
final protected FileSet getImplicitFileSet()(Code)(Java Doc)
public FileSelector[] getSelectors(Project p)(Code)(Java Doc)
public boolean hasSelectors()(Code)(Java Doc)
public int selectorCount()(Code)(Java Doc)
public Enumeration selectorElements()(Code)(Java Doc)
public void setCaseSensitive(boolean isCaseSensitive)(Code)(Java Doc)
public void setDefaultexcludes(boolean useDefaultExcludes)(Code)(Java Doc)
public void setExcludes(String excludes)(Code)(Java Doc)
public void setExcludesfile(File excludesfile)(Code)(Java Doc)
public void setFollowSymlinks(boolean followSymlinks)(Code)(Java Doc)
public void setIncludes(String includes)(Code)(Java Doc)
public void setIncludesfile(File includesfile)(Code)(Java Doc)
public void setProject(Project project)(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.