AutopsySLogVizModule/src/AutopsySLogVizModule/DataContentViewerSlogViz.java
/**
    * Unzips the data of a given Content and writes it to the disk.
    * 
    * @param con the Content that has to be written to the disk
    * 
    * @see Content
    */
Unzips the data of a given Content and writes it to the disk.

@param con the Content that has to be written to the disk

@see Content
Unzips the data of a given Content and writes it to the disk . @param con the Content that has to be written to the disk @see Content
private void unzipFile(Content con) {
        String name = con.getName();
        String pathIn = SLOGVIZ_FILE_PATH + File.separator + name;
        String pathOut = SLOGVIZ_FILE_PATH + File.separator + name.substring(0, name.length()-3);
        File fileIn = new File(pathIn);
        File fileOut = new File(pathOut);
        GZIPInputStream inStream;
        FileOutputStream outStream;
        try {
            inStream = new GZIPInputStream(new FileInputStream(fileIn));
            outStream = new FileOutputStream(fileOut);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(DataContentViewerSlogViz.class.getName()).log(Level.SEVERE, null, ex);
            return;
        } catch (IOException ex) {
            Logger.getLogger(DataContentViewerSlogViz.class.getName()).log(Level.SEVERE, null, ex);
            return;
        }
        fileOut.deleteOnExit();
        try {
            int data = inStream.read();
            while(data != -1){
                outStream.write(data);
                data = inStream.read();
            }
        } catch (IOException ex) {
            Logger.getLogger(DataContentViewerSlogViz.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            outStream.flush();
            inStream.close();
            outStream.close();
        } catch (IOException ex) {
            Logger.getLogger(DataContentViewerSlogViz.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
private void unzipFile ( Content con ) { String name = con . getName ( ) ; String pathIn = SLOGVIZ_FILE_PATH + File . separator + name ; String pathOut = SLOGVIZ_FILE_PATH + File . separator + name . substring ( 0 , name . length ( ) - 3 ) ; File fileIn = new File ( pathIn ) ; File fileOut = new File ( pathOut ) ; GZIPInputStream inStream ; FileOutputStream outStream ; try { inStream = new GZIPInputStream ( new FileInputStream ( fileIn ) ) ; outStream = new FileOutputStream ( fileOut ) ; } catch ( FileNotFoundException ex ) { Logger . getLogger ( DataContentViewerSlogViz . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; return ; } catch ( IOException ex ) { Logger . getLogger ( DataContentViewerSlogViz . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; return ; } fileOut . deleteOnExit ( ) ; try { int data = inStream . read ( ) ; while ( data != - 1 ) { outStream . write ( data ) ; data = inStream . read ( ) ; } } catch ( IOException ex ) { Logger . getLogger ( DataContentViewerSlogViz . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } try { outStream . flush ( ) ; inStream . close ( ) ; outStream . close ( ) ; } catch ( IOException ex ) { Logger . getLogger ( DataContentViewerSlogViz . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } }
Unzips the data of a given Content and writes it to the disk.
Unzips the data of a given Content and writes it to the disk .