Class AR

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class AR
    extends java.lang.Object
    implements java.lang.AutoCloseable
    The AR class is used for parsing standard XCOFF32 archive (ar) files. Each object within the archive is represented by an ARHeader class. Each of of these objects can then be turned into an XCOFF32 object for performing XCOFF32 class operations.
    See Also:
    AR.MemberHeader
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  AR.ARHeader
      Content of an archive in AIX XCOFF32 format
      class  AR.MemberHeader
      The ARHeader class is used to store the per-object file archive headers.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String filename  
    • Constructor Summary

      Constructors 
      Constructor Description
      AR​(java.lang.String filename)
      Creates a new AR object from the contents of the given file.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void dispose()  
      java.lang.String[] extractFiles​(java.lang.String outdir)  
      java.lang.String[] extractFiles​(java.lang.String outdir, java.lang.String[] names)  
      protected void finalize()  
      AR.MemberHeader[] getHeaders()
      Get an array of all the object file headers for this archive.
      protected java.io.RandomAccessFile getRandomAccessFile()  
      static boolean isARHeader​(byte[] ident)  
      static void main​(java.lang.String[] args)  
      protected java.lang.String removeBlanks​(java.lang.String str)
      Remove the padding from the archive header strings.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • filename

        protected java.lang.String filename
    • Constructor Detail

      • AR

        public AR​(java.lang.String filename)
           throws java.io.IOException
        Creates a new AR object from the contents of the given file.
        Parameters:
        filename - The file to process.
        Throws:
        java.io.IOException - The file is not a valid archive.
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • dispose

        public void dispose()
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • isARHeader

        public static boolean isARHeader​(byte[] ident)
      • getHeaders

        public AR.MemberHeader[] getHeaders()
                                     throws java.io.IOException
        Get an array of all the object file headers for this archive.
        Returns:
        An array of headers, one for each object within the archive.
        Throws:
        java.io.IOException - Unable to process the archive file.
        See Also:
        AR.ARHeader
      • extractFiles

        public java.lang.String[] extractFiles​(java.lang.String outdir,
                                               java.lang.String[] names)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • removeBlanks

        protected java.lang.String removeBlanks​(java.lang.String str)
        Remove the padding from the archive header strings.
      • extractFiles

        public java.lang.String[] extractFiles​(java.lang.String outdir)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • getRandomAccessFile

        protected java.io.RandomAccessFile getRandomAccessFile()
                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)