eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Archiver':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Archiver


Inheritance:

   Object
   |
   +--Archiver
      |
      +--Archiver::CompressedFile
      |
      +--Archiver::CompressedTarArchive
      |
      +--Archiver::MultiFileArchive

Package:
stx:libbasic2
Category:
System-Support-FileFormats
Version:
rev: 1.100 date: 2024/04/09 12:14:19
user: stefan
file: Archiver.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


this is a soon to be obsoleted helper class for the fileBrowser.
it wraps OS-specific command line archivers (tar, zip, rar, etc)
into a common protocol useful to display an archive's contents.

will be removed - do not use for your projects.

copyright

COPYRIGHT (c) 2002 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

classAccess
o  arArchive

o  gzipArchive

o  lzipArchive

o  tarArchive

o  tarGZipArchive

o  zipArchive

columns
o  columns

** This method must be redefined in concrete classes (subclassResponsibility) **

command strings
o  stringWithQuotedStrings: aColOfStrings
used to generate command line arguments;
if aColOfFiles is a non-empty collection,
return them as one space-separated string, with elements quoted, prefixed by a space.
Otherwise return an empty string

commandOutputReader
o  commandOutputParser

o  commandOutputParserClass

initialization
o  initializeMimeTypeMapping
abstract - special handling

instance creation
o  classForMimeType: aMimeType fileName: aFileNameOrNil
hard coded heuristics...

Usage example(s):

     self classForMimeType:nil fileName:nil   
     self classForMimeType:'application/x-tar-compressed' fileName:nil   
     self classForMimeType:'application/x-tar' fileName:nil   
     self classForMimeType:'application/x-foo' fileName:nil   
     self classForMimeType:'application/x-squeak-archive' fileName:nil  
     self classForMimeType:'application/java-archive' fileName:nil 
     'foo.sar' asFilename mimeTypeFromName               
     'foo.jar' asFilename mimeTypeFromName               
     'foo.a' asFilename mimeTypeFromName               

o  newFor: aFilename
instantiate an archiver for the given filename;
will try to extract the mime type from it first

o  with: aFilename

queries
o  canAddFiles

o  canDragnDrop

o  canExtractFiles

o  canRemoveFiles

o  canViewFile

o  hasTitleLine

o  isAbstract
(comment from inherited method)
Return if this class is an abstract class.
True is returned for Object here; false for subclasses.
Abstract subclasses must redefine this again.

o  numTitleLines


Instance protocol:

accessing
o  errorStream
return the value of the instance variable 'errorStream' (automatically generated)

o  errorStream: something
set the value of the instance variable 'errorStream' (automatically generated)

o  fileName
return the value of the instance variable 'fileName' (automatically generated)

o  fileName: something
set the value of the instance variable 'fileName' (automatically generated)

o  outStream
return the value of the instance variable 'outStream' (automatically generated)

o  outStream: something
set the value of the instance variable 'outStream' (automatically generated)

o  outStream: anOutStream errorStream: anErrorStream synchron: aBoolean

o  process
return the value of the instance variable 'process' (automatically generated)

o  process: something
set the value of the instance variable 'process' (automatically generated)

o  synchron
return the value of the instance variable 'synchron' (automatically generated)

o  synchron: something
set the value of the instance variable 'synchron' (automatically generated)

o  temporaryDirectory
return the value of the instance variable 'temporaryDirectory' (automatically generated)

o  useBuiltinArchiver
by default, we use the underlying OS's command line tools to list and extract entries.
However, under windows, if no winrar/rar is installed,
we must use our builtin zip archiver.
This flag is automatically set, if we detect that situation

o  useBuiltinArchiver: aBoolean
by default, we use the underlying OS's command line tools to list and extract entries.
However, under windows, if no winrar/rar is installed,
we must use our builtin zip archiver.
This flag is automatically set, if we detect that situation

actions
o  extractFilesTo: aDirectory

o  getCommandToListFiles: aColOfFiles

** This method must be redefined in concrete classes (subclassResponsibility) **

o  listFiles: aColOfFiles
no list command configured/found.

o  removeFilesFromArchive: aColOfFiles

** This method must be redefined in concrete classes (subclassResponsibility) **

actions-basic
o  addFilesToArchive: colOfFiles

** This method must be redefined in concrete classes (subclassResponsibility) **

o  extractFiles: aColOfFilesOrNil to: aDirectory

** This method must be redefined in concrete classes (subclassResponsibility) **

actions-private
o  removeTemporaryDirectory

o  stopProcess

command execution
o  executeCommand: cmd directory: aDirectory
do it lineWise, since outStream may be an ActorStream

o  isValidOutputLine: line
return true, if line contains a valid list-files output line

** This method must be redefined in concrete classes (subclassResponsibility) **

o  listFilesReader

command strings
o  addDoubleQuotedBaseNames: collectionOfFilenames toStream: aStream

o  addDoubleQuotedFilenames: collectionOfFilenames toStream: aStream

initialization & release
o  release
(comment from inherited method)
remove all references to objects that may refer to self.
Subclasses may redefine this method but should do a 'super release'.


Private classes:

    ArArchive
    ArchiverOutputParser
    BZ2Compressed
    CompressedFile
    CompressedTarArchive
    GZipCompressed
    LZipArchive
    MultiFileArchive
    SevenZipArchive
    TarArchive
    TarBZ2Archive
    TarGZipArchive
    XarArchive
    ZipArchive


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 14:36:47 GMT