Logo Search packages:      
Sourcecode: javamorph version File versions  Download package

static boolean javamorph::CStrings::initialize (  )  [inline, static]

Called if the application is called for the first time on one PC. Try to copy the sample data from the .jar distribution file into the working directory. Create sub directories therefore.

Returns:
trueif the copy process has been successful.

Definition at line 103 of file CStrings.java.

References DEBUGDIR, extractFiles(), HELPDIR, INPUTDIR, MESHDIR, OUTPUTDIR, POLYGONDIR, and WORKDIR.

                                      {
        try{
            File 
                work = new File(WORKDIR),
                input = new File(INPUTDIR),
                output = new File(OUTPUTDIR),
                polygon = new File(POLYGONDIR),
                mesh = new File(MESHDIR),
                help = new File(HELPDIR),
                debug = new File(DEBUGDIR);
            if(!work.exists()){
                if(JOptionPane.YES_OPTION ==
                        JOptionPane.showConfirmDialog(null, 
                        "Workdir = " + WORKDIR + " doesn't exist, create?")){
                    work.mkdir();
                    input.mkdir();
                    output.mkdir();
                    mesh.mkdir();
                    polygon.mkdir();
                    help.mkdir();
                    debug.mkdir();
                    extractFiles();
                    JOptionPane.showMessageDialog(null,
                    "Please handle app's files within the following workdir = " 
                    + WORKDIR + '!');
                    return true;
                }else{
                    JOptionPane.showMessageDialog(null, 
                            "Don't create workdir = " + WORKDIR + ", exit now");
                    return false;
                }
            }else{
                return true;
            }
        }catch(Exception e){
            System.err.println(e.getMessage());
            e.printStackTrace();
            JOptionPane.showMessageDialog(null,
            "Can't create workdir (" + WORKDIR + "), see console output!");
            return false;
        }
    }


Generated by  Doxygen 1.6.0   Back to index