Example usage for java.io FileNotFoundException printStackTrace

List of usage examples for java.io FileNotFoundException printStackTrace

Introduction

In this page you can find the example usage for java.io FileNotFoundException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:ktdiedrich.imagek.SegmentationCMD.java

public static String getImageIdPath(int imageId) {
    String path = null;/*from  w  w w  .j  a  v  a 2 s . co m*/
    Connection con = null;
    DbConn dbConn = new DbConn();
    try {
        con = dbConn.connect();
        Queries q = new Queries(con);
        path = q.getImagePath(imageId);
    } catch (FileNotFoundException e) {
        System.err.println(e.getMessage());
        e.printStackTrace();
    } catch (IOException e) {
        System.err.println(e.getMessage());
        e.printStackTrace();
    } catch (SQLException e) {
        System.err.println(e.getMessage());
        e.printStackTrace();
    } finally {
        try {
            con.close();
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
    }
    return path;
}

From source file:eu.sisob.uma.footils.File.FileFootils.java

public static boolean copyFile(final File toCopy, final File destFile) {
    try {//from   ww  w.j a v a2s  . c  om
        return FileFootils.copyStream(new FileInputStream(toCopy), new FileOutputStream(destFile));
    } catch (final FileNotFoundException e) {
        e.printStackTrace();
    }
    return false;
}

From source file:eu.sisob.uma.footils.File.FileFootils.java

private static boolean copyStream(final InputStream is, final File f) {
    try {/*  w  ww.  j  av a  2s.  com*/
        return FileFootils.copyStream(is, new FileOutputStream(f));
    } catch (final FileNotFoundException e) {
        e.printStackTrace();
    }
    return false;
}

From source file:ktdiedrich.imagek.SegmentationCMD.java

public static void recordDatabase(Extractor3D segmentor, int imageId, String directory) {
    Connection con = null;/*from  w ww.  j av a 2s .  c  o m*/
    DbConn dbConn = new DbConn();
    try {
        con = dbConn.connect();
        Inserts inserts = new Inserts(con);
        String name = segmentor.getSegBaseName();
        if (name.contains(File.separator)) {
            name = SegmentationCMD.parseDirectoryFileName(name)[1];
        }
        int segmentationId = inserts.insertSegmentation(segmentor.getSeedClusterMin(),
                segmentor.getClusterSizeThreshold(), segmentor.getMaxChisq(), segmentor.getZDiff(),
                segmentor.getSeedHistogramThreshold(), segmentor.getScalpDist(), segmentor.getFillHolesTimes(),
                segmentor.getHoleFillDirections(), segmentor.getHoleFillRadius(),
                segmentor.getMedianFilterSize(), segmentor.getMedFilterStdDevAbove(), imageId,
                segmentor.getBubbleFillAlgorithm(), name + ".zip", // segFileName
                directory);
        System.out.println("Recorded Segmentation_id: " + segmentationId + " Image_id: " + imageId);
    } catch (FileNotFoundException e) {
        System.err.println(e.getMessage());
        e.printStackTrace();
    } catch (IOException e) {
        System.err.println(e.getMessage());
        e.printStackTrace();
    } catch (SQLException e) {
        System.err.println(e.getMessage());
        e.printStackTrace();
    } finally {
        try {
            con.close();
        } catch (SQLException e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
    }
}

From source file:com.j2biz.pencil.Starter.java

private static void exitCauseConfigPathNotExist(final String config, CommandLine line,
        FileNotFoundException x) {
    System.out/*from ww w  . j a va  2s  .  co m*/
            .println("WARNING: the entered config-path does not exist. path == " + line.getOptionValue(config));
    x.printStackTrace();
    System.exit(-1);
}

From source file:com.theelix.libreexplorer.FileManager.java

private static void paste(File sourceFile, File destFile) throws IOException, FileNotCreatedException {
    try {/*from  w  ww.  j a  v  a  2 s  .com*/
        if (sourceFile.isDirectory()) {

            FileUtils.copyDirectory(sourceFile, destFile);
        } else {
            FileUtils.copyFile(sourceFile, destFile);
        }
        if (isMoving) {
            if (sourceFile.isDirectory()) {
                FileUtils.deleteDirectory(sourceFile);
            } else {
                sourceFile.delete();
            }
        }
    } catch (FileNotFoundException e) {
        e.printStackTrace();
        throw new FileNotCreatedException();
    }
}

From source file:de.citec.sc.matoll.utils.visualizeSPARQL.java

private static void writePatterns(List<SparqlPattern> Patterns, Language language) {
    String prefix = "\\documentclass{scrartcl}\n" + "\\usepackage{mathtools}\n" + "\\usepackage{tikz}\n"
            + "\\usetikzlibrary{trees,positioning}\n" + "\n" + "\\begin{document}\n";

    String suffix = "\\end{document}";
    String output = "";
    System.out.println("Starting visualisation");
    for (SparqlPattern pattern : Patterns) {
        String tmp = doVisual(pattern.getQuery(), pattern.getID().replace("_", "\\_")) + "\n\n\n";
        String[] triple = pattern.getQuery().split("\n");
        for (String t : triple) {
            tmp = "%" + t + "\n" + tmp;
        }/*from   w  w  w.j av a 2 s  .com*/
        if (tmp != null)
            output += tmp;
        else
            System.out.println(pattern.getID() + " could not be visualized");
    }

    PrintWriter writer;
    try {
        writer = new PrintWriter("sparql_tree_" + language.toString() + ".tex");
        writer.write(prefix + output + suffix);
        writer.close();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:dm_p2.KMEANS.java

public static void generateLinkedHashMap(String filename) {
    String filePath = new File("").getAbsolutePath();
    try {//w ww .jav a 2s  .c o m
        Scanner s = new Scanner(new File(filePath + "/src/dm_p2/" + filename));
        while (s.hasNext()) {
            String inputLine = s.nextLine();
            String[] splitData = inputLine.split("\t");
            int geneId = Integer.parseInt(splitData[0]);
            int valgeneId = Integer.parseInt(splitData[1]);
            expressionValues = new ArrayList<Double>();
            for (int i = 2; i < splitData.length; i++) {
                expressionValues.add(Double.parseDouble(splitData[i]));
            }
            linkedHashMap.put(geneId, expressionValues);
            if (valgeneId != -1) {
                validationMap.put(geneId, valgeneId);
            }
        }
        //System.out.println(linkedHashMap.entrySet());
        //System.out.println(validationMap.entrySet());
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
}

From source file:com.pieframework.runtime.core.ResourceLoader.java

public static List<File> findPath(String basePath, String query) {

    List<File> flist = new ArrayList<File>();

    if (!StringUtils.empty(basePath, query)) {
        String root = locate(basePath);
        query = FilenameUtils.separatorsToSystem(query);
        query = "*" + query + "*";

        //System.out.println(query+" "+root);
        File rootDir = new File(root);
        try {//www  . jav a2 s.c o  m
            for (File f : listFilesAndDirectories(rootDir)) {
                //System.out.println(f.getPath());
                if (FilenameUtils.wildcardMatch(f.getPath(), query)) {
                    flist.add(f);
                }
            }
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    return flist;
}

From source file:com.pieframework.runtime.core.ResourceLoader.java

public static List<File> findExactPath(File dir, String query) {

    List<File> flist = new ArrayList<File>();

    if (!StringUtils.empty(query) && dir.exists()) {
        String root = dir.getPath();
        query = FilenameUtils.separatorsToSystem(query);
        String wildCard = "*" + query + "*";
        //System.out.println(query+" "+root);
        File rootDir = new File(root);
        try {/*from ww w . ja  v  a 2s  . co  m*/
            for (File f : listFilesAndDirectories(rootDir)) {
                //System.out.println(f.getPath());

                if (FilenameUtils.wildcardMatch(f.getPath(), wildCard)) {
                    if (f.getName().equals(query)) {
                        flist.add(f);
                    }
                }
            }
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    return flist;
}