// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst 
// Source File Name:   ConverterArchive.java
// Class Version:      45.3

package oracle.sql;

import java.io.*;
import java.net.URL;
import java.util.zip.*;

// flag ACC_SUPER is set
public class ConverterArchive
{
    // Constants:          225
    // Interfaces:         0
    // Fields:             6
    // Methods:            10
    // Class Attributes:   1


    private String m_izipName;
    private FileOutputStream m_ifStream;
    private ZipOutputStream m_izStream;
    private InputStream m_riStream;
    private ZipFile m_rzipFile;
    private static final String TEMPFILE = "gsstemp.zip";

    // Decompiling method: <init>  Signature: ()V
    // Max stack: 2, #locals: 1, #params: 1
    // Code length: 25 bytes, Code offset: 2902
    // Line Number Table found: 6 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 25 Range 0 24 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type V At 0 25 Range 0 24 Init 0 fixed
    public ConverterArchive()
    {
        super();
        m_ifStream = null;
        m_izStream = null;
        m_riStream = null;
        m_rzipFile = null;
        return;
    }

    // Decompiling method: closeArchiveforInsert  Signature: ()V
    // Max stack: 1, #locals: 1, #params: 1
    // Code length: 19 bytes, Code offset: 2985
    // Exception table: 1 entries
    //           start  0 end 14 handler 17 type IOException
    // Line Number Table found: 6 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 19 Range 0 18 Init 0 fixed
    // RetValue   1 added: Name <returnValue> Type V At 0 19 Range 0 18 Init 0 fixed
    public void closeArchiveforInsert()
    {
        try
        {
            m_izStream.close();
            m_ifStream.close();
        }
        catch(IOException _ex) { }
        return;
    }

    // Decompiling method: closeArchiveforRead  Signature: ()V
    // Max stack: 1, #locals: 2, #params: 1
    // Code length: 20 bytes, Code offset: 3070
    // Exception table: 1 entries
    //           start  0 end 7 handler 10 type IOException
    // Line Number Table found: 7 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 20 Range 0 19 Init 0 fixed
    // RetValue   2 added: Name <returnValue> Type V At 0 20 Range 0 19 Init 0 fixed
    // LocalVar   1 added: Name ioexception Type Ljava/io/IOException; At 10 2 Range 10 11 Init 10
    public void closeArchiveforRead()
    {
        try
        {
            m_rzipFile.close();
        }
        catch(IOException ioexception)
        {
            ioexception.printStackTrace();
            System.exit(0);
        }
        return;
    }

    // Decompiling method: insertObj  Signature: (Ljava/lang/Object;Ljava/lang/String;)V
    // Max stack: 3, #locals: 5, #params: 3
    // Code length: 58 bytes, Code offset: 3160
    // Exception table: 1 entries
    //           start  14 end 53 handler 56 type IOException
    // Line Number Table found: 12 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 58 Range 0 57 Init 0 fixed
    // Parameter  1 added: Name obj Type Ljava/lang/Object; At 0 58 Range 0 57 Init 0
    // Parameter  2 added: Name s Type Ljava/lang/String; At 0 58 Range 0 57 Init 0
    // RetValue   5 added: Name <returnValue> Type V At 0 58 Range 0 57 Init 0 fixed
    // LocalVar   3 added: Name obj1 Type A At 1 1 Range 1 1 Init 1
    // LocalVar   4 added: Name obj2 Type A At 3 2 Range 3 4 Init 3
    // LocalVar   3 added: Name zipentry Type Ljava/util/zip/ZipEntry; At 13 6 Range 13 18 Init 13
    // LocalVar   4 added: Name objectoutputstream Type Ljava/io/ObjectOutputStream; At 33 10 Range 33 42 Init 33
    // LocalVar   3 chged: Name zipentry1 Oname obj1 Type Ljava/util/zip/ZipEntry; At 1 1 Range 1 1 Init 1
    // LocalVar   3 name zipentry(Ljava/util/zip/ZipEntry;) merged out into zipentry1(Ljava/util/zip/ZipEntry;)
    public void insertObj(Object obj, String s)
    {
        ZipEntry zipentry = null;
        Object obj1 = null;
        zipentry = new ZipEntry(s);
        try
        {
            m_izStream.putNextEntry(zipentry);
            ObjectOutputStream objectoutputstream = new ObjectOutputStream(m_izStream);
            objectoutputstream.writeObject(obj);
            objectoutputstream.close();
            m_izStream.closeEntry();
        }
        catch(IOException _ex) { }
        return;
    }

    // Decompiling method: insertObjtoFile  Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V
    // Max stack: 5, #locals: 8, #params: 4
    // Code length: 182 bytes, Code offset: 3308
    // Exception table: 2 entries
    //           start  82 end 88 handler 91 type SecurityException
    //           start  102 end 135 handler 138 type FileNotFoundException
    // Line Number Table found: 21 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 182 Range 0 181 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 182 Range 0 181 Init 0
    // Parameter  2 added: Name s1 Type Ljava/lang/String; At 0 182 Range 0 181 Init 0
    // Parameter  3 added: Name obj Type Ljava/lang/Object; At 0 182 Range 0 181 Init 0
    // RetValue   8 added: Name <returnValue> Type V At 0 182 Range 0 181 Init 0 fixed
    // LocalVar   4 added: Name file Type Ljava/io/File; At 8 31 Range 8 38 Init 8
    // LocalVar   5 added: Name file1 Type Ljava/io/File; At 35 73 Range 35 107 Init 35
    // LocalVar   6 added: Name fileoutputstream Type Ljava/io/FileOutputStream; At 111 8 Range 111 118 Init 111
    // LocalVar   7 added: Name objectoutputstream Type Ljava/io/ObjectOutputStream; At 122 10 Range 122 131 Init 122
    public void insertObjtoFile(String s, String s1, Object obj)
        throws IOException
    {
        File file = new File(s);
        File file1 = new File(s + s1);
        if(!file.isDirectory())
        {
            throw new IOException("directory " + s + " doesn't exist");
        }
        if(file1.exists())
        {
            try
            {
                file1.delete();
            }
            catch(SecurityException _ex)
            {
                throw new IOException("file exist, can't overwrite file.");
            }
        }
        try
        {
            FileOutputStream fileoutputstream = new FileOutputStream(file1);
            ObjectOutputStream objectoutputstream = new ObjectOutputStream(fileoutputstream);
            objectoutputstream.writeObject(obj);
            objectoutputstream.close();
        }
        catch(FileNotFoundException _ex)
        {
            throw new IOException("file can't be created.");
        }
        System.out.print(s1 + " has been successfully stored in ");
        System.out.println(s);
        return;
    }

    // Decompiling method: insertSingleObj  Signature: (Ljava/lang/String;Ljava/lang/Object;Ljava/lang/String;)V
    // Max stack: 5, #locals: 15, #params: 4
    // Code length: 476 bytes, Code offset: 3634
    // Exception table: 9 entries
    //           start  39 end 211 handler 214 type FileNotFoundException
    //           start  39 end 211 handler 229 type StreamCorruptedException
    //           start  39 end 211 handler 244 type IOException
    //           start  39 end 211 handler 249 type ClassNotFoundException
    //           start  281 end 315 handler 315 type SecurityException
    //           start  281 end 315 handler 330 type NullPointerException
    //           start  345 end 405 handler 408 type FileNotFoundException
    //           start  345 end 405 handler 423 type StreamCorruptedException
    //           start  345 end 405 handler 438 type IOException
    // Line Number Table found: 66 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 476 Range 0 475 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 476 Range 0 475 Init 0
    // Parameter  2 added: Name obj Type Ljava/lang/Object; At 0 476 Range 0 475 Init 0
    // Parameter  3 added: Name s1 Type Ljava/lang/String; At 0 476 Range 0 475 Init 0
    // RetValue  15 added: Name <returnValue> Type V At 0 476 Range 0 475 Init 0 fixed
    // LocalVar   4 added: Name obj1 Type A At 1 2 Range 1 2 Init 1
    // LocalVar   5 added: Name obj2 Type A At 4 2 Range 4 5 Init 4
    // LocalVar   6 added: Name obj3 Type A At 7 2 Range 7 8 Init 7
    // LocalVar   7 added: Name obj4 Type A At 10 2 Range 10 11 Init 10
    // LocalVar   8 added: Name obj5 Type A At 13 2 Range 13 14 Init 13
    // LocalVar  10 added: Name obj6 Type A At 16 2 Range 16 17 Init 16
    // LocalVar  11 added: Name obj7 Type A At 19 2 Range 19 20 Init 19
    // LocalVar  12 added: Name file Type Ljava/io/File; At 29 256 Range 29 284 Init 29
    // LocalVar   4 added: Name fileinputstream Type Ljava/io/FileInputStream; At 47 8 Range 47 54 Init 47
    // LocalVar   5 added: Name zipinputstream Type Ljava/util/zip/ZipInputStream; At 58 150 Range 58 207 Init 58
    // LocalVar   6 added: Name fileoutputstream Type Ljava/io/FileOutputStream; At 69 8 Range 69 76 Init 69
    // LocalVar   7 added: Name zipoutputstream Type Ljava/util/zip/ZipOutputStream; At 80 110 Range 80 189 Init 80
    // LocalVar  13 added: Name i Type I At 87 2 Range 87 88 Init 87
    // LocalVar   8 added: Name zipentry Type Ljava/util/zip/ZipEntry; At 175 6 Range 175 180 Init 175
    // LocalVar  11 added: Name objectoutputstream Type Ljava/io/ObjectOutputStream; At 193 10 Range 193 202 Init 193
    // LocalVar  13 added: Name file1 Type Ljava/io/File; At 273 10 Range 273 282 Init 273
    // LocalVar   6 added: Name fileoutputstream1 Type Ljava/io/FileOutputStream; At 353 8 Range 353 360 Init 353
    // LocalVar   7 added: Name zipoutputstream1 Type Ljava/util/zip/ZipOutputStream; At 364 25 Range 364 388 Init 364
    // LocalVar   8 added: Name zipentry1 Type Ljava/util/zip/ZipEntry; At 374 6 Range 374 379 Init 374
    // LocalVar  11 added: Name objectoutputstream1 Type Ljava/io/ObjectOutputStream; At 392 10 Range 392 401 Init 392
    // LocalVar   8 added: Name zipentry2 Type Ljava/util/zip/ZipEntry; At 97 23 Range 97 119 Init 97
    // LocalVar  10 added: Name objectinputstream Type Ljava/io/ObjectInputStream; At 132 15 Range 132 146 Init 132
    // LocalVar  11 added: Name objectoutputstream2 Type Ljava/io/ObjectOutputStream; At 143 11 Range 143 153 Init 143
    // LocalVar   9 added: Name obj8 Type Ljava/lang/Object; At 150 6 Range 150 155 Init 150
    // LocalVar  13 added: Name filenotfoundexception Type Ljava/io/FileNotFoundException; At 214 8 Range 214 221 Init 214
    // LocalVar  13 added: Name streamcorruptedexception Type Ljava/io/StreamCorruptedException; At 229 8 Range 229 236 Init 229
    // LocalVar  13 added: Name ioexception Type Ljava/io/IOException; At 244 4 Range 244 247 Init 244
    // LocalVar  13 added: Name classnotfoundexception Type Ljava/lang/ClassNotFoundException; At 249 8 Range 249 256 Init 249
    // LocalVar  14 added: Name securityexception Type Ljava/lang/SecurityException; At 315 8 Range 315 322 Init 315
    // LocalVar  14 added: Name nullpointerexception Type Ljava/lang/NullPointerException; At 330 8 Range 330 337 Init 330
    // LocalVar  13 added: Name filenotfoundexception1 Type Ljava/io/FileNotFoundException; At 408 8 Range 408 415 Init 408
    // LocalVar  13 added: Name streamcorruptedexception1 Type Ljava/io/StreamCorruptedException; At 423 8 Range 423 430 Init 423
    // LocalVar  13 added: Name ioexception1 Type Ljava/io/IOException; At 438 4 Range 438 441 Init 438
    public void insertSingleObj(String s, Object obj, String s1)
        throws IOException
    {
        Object obj1 = null;
        Object obj2 = null;
        Object obj3 = null;
        Object obj4 = null;
        Object obj5 = null;
        Object obj7 = null;
        Object obj8 = null;
        File file = new File(s);
        if(file.isFile())
        {
            try
            {
                FileInputStream fileinputstream = new FileInputStream(s);
                ZipInputStream zipinputstream = new ZipInputStream(fileinputstream);
                FileOutputStream fileoutputstream = new FileOutputStream("gsstemp.zip");
                ZipOutputStream zipoutputstream = new ZipOutputStream(fileoutputstream);
                int i = zipinputstream.available();
                while(zipinputstream.available() != 0) 
                {
                    ZipEntry zipentry = zipinputstream.getNextEntry();
                    if(zipentry != null && !zipentry.getName().equals(s1))
                    {
                        zipoutputstream.putNextEntry(zipentry);
                        ObjectInputStream objectinputstream = new ObjectInputStream(zipinputstream);
                        ObjectOutputStream objectoutputstream = new ObjectOutputStream(zipoutputstream);
                        Object obj6 = objectinputstream.readObject();
                        objectoutputstream.writeObject(obj6);
                    }
                }
                ZipEntry zipentry1 = new ZipEntry(s1);
                zipoutputstream.putNextEntry(zipentry1);
                ObjectOutputStream objectoutputstream1 = new ObjectOutputStream(zipoutputstream);
                objectoutputstream1.writeObject(obj);
                objectoutputstream1.close();
                zipinputstream.close();
            }
            catch(FileNotFoundException filenotfoundexception)
            {
                throw new IOException(filenotfoundexception.getMessage());
            }
            catch(StreamCorruptedException streamcorruptedexception)
            {
                throw new IOException(streamcorruptedexception.getMessage());
            }
            catch(IOException ioexception)
            {
                throw ioexception;
            }
            catch(ClassNotFoundException classnotfoundexception)
            {
                throw new IOException(classnotfoundexception.getMessage());
            }
            File file1 = new File("gsstemp.zip");
            file.delete();
            try
            {
                if(!file1.renameTo(file))
                {
                    throw new IOException("can't write to target file " + s);
                }
            }
            catch(SecurityException securityexception)
            {
                throw new IOException(securityexception.getMessage());
            }
            catch(NullPointerException nullpointerexception)
            {
                throw new IOException(nullpointerexception.getMessage());
            }
        } else
        {
            try
            {
                FileOutputStream fileoutputstream1 = new FileOutputStream(s);
                ZipOutputStream zipoutputstream1 = new ZipOutputStream(fileoutputstream1);
                ZipEntry zipentry2 = new ZipEntry(s1);
                zipoutputstream1.putNextEntry(zipentry2);
                ObjectOutputStream objectoutputstream2 = new ObjectOutputStream(zipoutputstream1);
                objectoutputstream2.writeObject(obj);
                objectoutputstream2.close();
            }
            catch(FileNotFoundException filenotfoundexception1)
            {
                throw new IOException(filenotfoundexception1.getMessage());
            }
            catch(StreamCorruptedException streamcorruptedexception1)
            {
                throw new IOException(streamcorruptedexception1.getMessage());
            }
            catch(IOException ioexception1)
            {
                throw ioexception1;
            }
        }
        System.out.print(s1 + " has been successfully stored in ");
        System.out.println(s);
        return;
    }

    // Decompiling method: openArchiveforInsert  Signature: (Ljava/lang/String;)V
    // Max stack: 4, #locals: 2, #params: 2
    // Code length: 44 bytes, Code offset: 4490
    // Exception table: 2 entries
    //           start  5 end 35 handler 38 type FileNotFoundException
    //           start  5 end 35 handler 42 type IOException
    // Line Number Table found: 9 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 44 Range 0 43 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 44 Range 0 43 Init 0
    // RetValue   2 added: Name <returnValue> Type V At 0 44 Range 0 43 Init 0 fixed
    public void openArchiveforInsert(String s)
    {
        m_izipName = s;
        try
        {
            m_ifStream = new FileOutputStream(m_izipName);
            m_izStream = new ZipOutputStream(m_ifStream);
        }
        catch(FileNotFoundException _ex) { }
        catch(IOException _ex) { }
        return;
    }

    // Decompiling method: openArchiveforRead  Signature: ()V
    // Max stack: 4, #locals: 2, #params: 1
    // Code length: 28 bytes, Code offset: 4620
    // Exception table: 1 entries
    //           start  0 end 15 handler 18 type IOException
    // Line Number Table found: 7 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 28 Range 0 27 Init 0 fixed
    // RetValue   2 added: Name <returnValue> Type V At 0 28 Range 0 27 Init 0 fixed
    // LocalVar   1 added: Name ioexception Type Ljava/io/IOException; At 18 2 Range 18 19 Init 18
    public void openArchiveforRead()
    {
        try
        {
            m_rzipFile = new ZipFile(m_izipName);
        }
        catch(IOException ioexception)
        {
            ioexception.printStackTrace();
            System.exit(0);
        }
        return;
    }

    // Decompiling method: readObj  Signature: (Ljava/lang/String;)Ljava/lang/Object;
    // Max stack: 3, #locals: 6, #params: 2
    // Code length: 53 bytes, Code offset: 4718
    // Exception table: 2 entries
    //           start  15 end 46 handler 46 type IOException
    //           start  15 end 46 handler 50 type ClassNotFoundException
    // Line Number Table found: 14 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 53 Range 0 52 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 53 Range 0 52 Init 0
    // RetValue   6 added: Name <returnValue> Type Ljava/lang/Object; At 0 53 Range 0 52 Init 0 fixed
    // LocalVar   2 added: Name url Type Ljava/net/URL; At 8 8 Range 8 15 Init 8
    // LocalVar   3 added: Name inputstream Type Ljava/io/InputStream; At 19 12 Range 19 30 Init 19
    // LocalVar   4 added: Name obj Type A At 21 2 Range 21 22 Init 21
    // LocalVar   5 added: Name obj1 Type A At 24 2 Range 24 25 Init 24
    // LocalVar   4 added: Name objectinputstream Type Ljava/io/ObjectInputStream; At 34 4 Range 34 37 Init 34
    // LocalVar   5 added: Name obj2 Type Ljava/lang/Object; At 41 4 Range 41 44 Init 41
    // LocalVar   4 chged: Name objectinputstream1 Oname obj Type Ljava/io/ObjectInputStream; At 21 2 Range 21 22 Init 21
    // LocalVar   4 name objectinputstream(Ljava/io/ObjectInputStream;) merged out into objectinputstream1(Ljava/io/ObjectInputStream;)
    // LocalVar   5 chged: Name obj Oname obj1 Type Ljava/lang/Object; At 24 2 Range 24 25 Init 24
    // LocalVar   5 name obj2(Ljava/lang/Object;) merged out into obj(Ljava/lang/Object;)
    public Object readObj(String s)
    {
        URL url = getClass().getResource(s);
        if(url == null)
        {
            return null;
        }
        try
        {
            InputStream inputstream = url.openStream();
            ObjectInputStream objectinputstream = null;
            Object obj = null;
            objectinputstream = new ObjectInputStream(inputstream);
            obj = objectinputstream.readObject();
            return obj;
        }
        catch(IOException _ex) { }
        catch(ClassNotFoundException _ex) { }
        return null;
    }

    // Decompiling method: readObj  Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
    // Max stack: 3, #locals: 9, #params: 3
    // Code length: 106 bytes, Code offset: 4877
    // Exception table: 2 entries
    //           start  0 end 99 handler 99 type IOException
    //           start  0 end 99 handler 103 type ClassNotFoundException
    // Line Number Table found: 20 entries
    // Parameter  0 added: Name this Type Loracle/sql/ConverterArchive; At 0 106 Range 0 105 Init 0 fixed
    // Parameter  1 added: Name s Type Ljava/lang/String; At 0 106 Range 0 105 Init 0
    // Parameter  2 added: Name s1 Type Ljava/lang/String; At 0 106 Range 0 105 Init 0
    // RetValue   9 added: Name <returnValue> Type Ljava/lang/Object; At 0 106 Range 0 105 Init 0 fixed
    // LocalVar   3 added: Name fileinputstream Type Ljava/io/FileInputStream; At 8 6 Range 8 13 Init 8
    // LocalVar   4 added: Name zipinputstream Type Ljava/util/zip/ZipInputStream; At 17 76 Range 17 92 Init 17
    // LocalVar   5 added: Name obj Type A At 20 2 Range 20 21 Init 20
    // LocalVar   6 added: Name obj1 Type A At 23 2 Range 23 24 Init 23
    // LocalVar   7 added: Name obj2 Type A At 26 72 Range 26 97 Init 26
    // LocalVar   8 added: Name i Type I At 33 2 Range 33 34 Init 33
    // LocalVar   7 chged: Name obj2 Oname obj2 Type Ljava/lang/Object; At 96 2 Range 26 97 Init 26
    // LocalVar   5 added: Name zipentry Type Ljava/util/zip/ZipEntry; At 43 9 Range 43 51 Init 43
    // LocalVar   6 added: Name objectinputstream Type Ljava/io/ObjectInputStream; At 71 4 Range 71 74 Init 71
    public Object readObj(String s, String s1)
    {
        try
        {
            FileInputStream fileinputstream = new FileInputStream(s);
            ZipInputStream zipinputstream = new ZipInputStream(fileinputstream);
            Object obj = null;
            Object obj1 = null;
            Object obj2 = null;
            int i = zipinputstream.available();
            while(zipinputstream.available() != 0) 
            {
                ZipEntry zipentry = zipinputstream.getNextEntry();
                if(zipentry != null && zipentry.getName().equals(s1))
                {
                    ObjectInputStream objectinputstream = new ObjectInputStream(zipinputstream);
                    obj2 = objectinputstream.readObject();
                    break;
                }
            }
            zipinputstream.close();
            return obj2;
        }
        catch(IOException _ex) { }
        catch(ClassNotFoundException _ex) { }
        return null;
    }
}
