Class LhaFile

java.lang.Object
jp.gr.java_conf.dangan.util.lha.LhaFile

public class LhaFile extends Object
LHA?????t?@?C???????G???g???f?[?^???????o?? InputStream???????????????[?e?B???e?B?N???X?B
java.util.zip.ZipFile ?????? ?C???^?[?t?F?C?X???????????????????B CRC16?????????`?F?b?N???s??????B
 -- revision history --
 $Log: LhaFile.java,v $
 Revision 1.1  2002/12/08 00:00:00  dangan
 [maintenance]
     LhaConstants ???? CompressMethod ?????N???X???????X???????????C???B

 Revision 1.0  2002/08/05 00:00:00  dangan
 add to version control
 [improvement]
     ?G???g?????????? Hashtable ???g?p??????????????
     ???????G???g???????????????G???g???J?n???u??
     ??????????????????????????????B
 [change]
     ?R???X?g???N?^???? ?????? String encode ?????????????p?~?A
     Properties ???????????????????????B
 [maintanance]
     ?\?[?X????
     ?^?u?p?~
     ???C?Z???X????C??

 
Version:
$Revision: 1.1 $
Author:
$Author: dangan $
  • Constructor Summary

    Constructors
    Constructor
    Description
    LhaFile(File filename)
    filename ???w?????????t?@?C???????????f?[?^???????}??LhaFile???\?z?????B
    ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
    LhaFile(File filename, Properties property)
    filename ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
    file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
    ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
    LhaFile(RandomAccessFile file, boolean rescueMode)
    file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
    ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
    file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
    LhaFile(RandomAccessFile file, Properties property, boolean rescueMode)
    file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
    LhaFile(String filename)
    filename ???w?????????t?@?C???????????f?[?^???????}??LhaFile???\?z?????B
    ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
    LhaFile(String filename, Properties property)
    filename ???w?????????t?@?C???????????f?[?^???????}??LhaFile???\?z?????B
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    ?}?? LHA?????t?@?C??????????B ???????A?}??LhaFile?????s?????S???? InputStream??????I????????????B
    ?}?? LhaFile ?????G???g???? LhaHeader ???????q???????B
    ?t?@?C???????G???g?????????????z?????????B
    name???w???????????O???????G???g???? ???e???????????????????}???????X?g???[?????????B
    header ???w?????????G???g???? ???e???????????????????}???????X?g???[?????????B
    name???w???????????O???????G???g???? ???e?????????????????}???????X?g???[?????????B
    header???w?????????G???g???????e?? ???????????????}???????X?g???[?????????B
    int
    ?}?? LhaFile ?????G???g?????????????B

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LhaFile

      public LhaFile(String filename) throws IOException
      filename ???w?????????t?@?C???????????f?[?^???????}??LhaFile???\?z?????B
      ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
      Parameters:
      filename - LHA?????t?@?C???????O
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
    • LhaFile

      public LhaFile(String filename, Properties property) throws IOException
      filename ???w?????????t?@?C???????????f?[?^???????}??LhaFile???\?z?????B
      Parameters:
      filename - LHA?????t?@?C???????O
      property - ?e???k?`?????????????????????????????????????v???p?e?B
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      UnsupportedEncodingException - property.getProperty( "lha.encoding" ) ?????????? ?G???R?[?f?B???O?????T?|?[?g???????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
    • LhaFile

      public LhaFile(File filename) throws IOException
      filename ???w?????????t?@?C???????????f?[?^???????}??LhaFile???\?z?????B
      ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
      Parameters:
      filename - LHA?????t?@?C??
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
    • LhaFile

      public LhaFile(File filename, Properties property) throws IOException
      filename ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
      Parameters:
      filename - LHA?????t?@?C??
      property - ?e???k?`?????????????????????????????????????v???p?e?B
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      UnsupportedEncodingException - property.getProperty( "lha.encoding" ) ?????????? ?G???R?[?f?B???O?????T?|?[?g???????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
    • LhaFile

      public LhaFile(RandomAccessFile file) throws IOException
      file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
      ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
      Parameters:
      file - LHA?????t?@?C??
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
    • LhaFile

      public LhaFile(RandomAccessFile file, boolean rescueMode) throws IOException
      file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
      ?e???k?`?????????????????????????????????v???p?e?B???? LhaProperty.getProperties() ???????????v???p?e?B???g?p???????B
      Parameters:
      file - LHA?????t?@?C??
      rescueMode - true ?????????????????????f?[?^?? ?????????????????????[?h???G???g?????????????B
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
    • LhaFile

      public LhaFile(RandomAccessFile file, Properties property) throws IOException
      file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
      Parameters:
      file - LHA?????t?@?C??
      property - ?e???k?`?????????????????????????????????????v???p?e?B
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
    • LhaFile

      public LhaFile(RandomAccessFile file, Properties property, boolean rescueMode) throws IOException
      file ???w?????????t?@?C???????????f?[?^???????}?? LhaFile ???\?z?????B
      Parameters:
      file - LHA?????t?@?C??
      property - ?e???k?`?????????????????????????????????????v???p?e?B
      rescueMode - true ?????????????????????f?[?^?? ?????????????????????[?h???G???g?????????????B
      Throws:
      IOException - ???o???G???[?????????????
      FileNotFoundException - ?t?@?C???????????????????
      SecurityException - ?Z?L?????e?B?}?l?[?W?????t?@?C?????????????????????????
      See Also:
  • Method Details

    • getInputStream

      public InputStream getInputStream(LhaHeader header)
      header ???w?????????G???g???? ???e???????????????????}???????X?g???[?????????B
      Parameters:
      header - ?w?b?_
      Returns:
      header???w?????????w?b?_???????G???g???? ???e???????}???????X?g???[???B
      ?G???g????????????????????? null?B
    • getInputStream

      public InputStream getInputStream(String name)
      name???w???????????O???????G???g???? ???e???????????????????}???????X?g???[?????????B
      Parameters:
      name - ?G???g???????O
      Returns:
      name???w???????????O???????G???g???? ???e???????????????????}???????X?g???[???B
      ?G???g????????????????????? null?B
    • getInputStreamWithoutExtract

      public InputStream getInputStreamWithoutExtract(LhaHeader header)
      header???w?????????G???g???????e?? ???????????????}???????X?g???[?????????B
      Parameters:
      header - ?w?b?_
      Returns:
      header???w?????????G???g???????e?? ???????????????}???????X?g???[???B
      ?G???g????????????????????? null?B
    • getInputStreamWithoutExtract

      public InputStream getInputStreamWithoutExtract(String name)
      name???w???????????O???????G???g???? ???e?????????????????}???????X?g???[?????????B
      Parameters:
      name - ?G???g???????O
      Returns:
      name???w???????????O???????G???g???? ???e?????????????????}???????X?g???[???B
      ?G???g????????????????????? null?B
    • size

      public int size()
      ?}?? LhaFile ?????G???g?????????????B
      Returns:
      ?t?@?C???????G???g??????
    • entries

      public Enumeration entries()
      ?}?? LhaFile ?????G???g???? LhaHeader ???????q???????B
      Returns:
      LhaHeader ???????q
      Throws:
      IllegalStateException - LhaFile ?? close() ???????????????????B
    • getEntries

      public LhaHeader[] getEntries()
      ?t?@?C???????G???g?????????????z?????????B
      Returns:
      ?t?@?C???????G???g?????????????z??
    • close

      public void close() throws IOException
      ?}?? LHA?????t?@?C??????????B ???????A?}??LhaFile?????s?????S???? InputStream??????I????????????B
      Throws:
      IOException - ???o???G???[?????????????