Package java.io

Examples of java.io.File.canRead()


    {
      return catalogUrl;
    }

    final File resolvedFile = new File(contextAsFile.getParentFile(), catalogUrl);
    if (resolvedFile.isFile() && resolvedFile.canRead())
    {
      return resolvedFile.getAbsolutePath();
    }

    return catalogUrl;
View Full Code Here


    public void init(final String initarg) {
        if (bluelist == null) {
            // here, the init arg is used to load a list of blue-listed words
            bluelist = new ArrayList<String>();
            final File f = new File(initarg);
            if (f.canRead()) {
                try {
                    final BufferedReader r = new BufferedReader(new FileReader(f));
                    String s;
                    while ((s = r.readLine()) != null) {
                        if (s.length() > 0 && s.charAt(0) != '#') bluelist.add(s.toLowerCase());
View Full Code Here

     */
    public static void main(final String[] args) {
        if (args.length > 0 && args[0].length() > 0) {
            // file
            final File pdfFile = new File(args[0]);
            if(pdfFile.canRead()) {

                System.out.println(pdfFile.getAbsolutePath());
                final long startTime = System.currentTimeMillis();

                // parse
View Full Code Here

        }
    }

    public boolean processSurrogate(final String s) {
        final File infile = new File(this.surrogatesInPath, s);
        if (!infile.exists() || !infile.canWrite() || !infile.canRead()) return false;
        final File outfile = new File(this.surrogatesOutPath, s);
        //if (outfile.exists()) return false;
        boolean moved = false;
        if (s.endsWith("xml.zip")) {
            // open the zip file with all the xml files in it
View Full Code Here

            File inputFile = new File(inputFileName);
            if (false==inputFile.exists()) {
                consoleUI.showErrorDialog("File "+inputFileName+" does not exist.");
                return true;
            }
            if (false==inputFile.canRead()) {
                consoleUI.showErrorDialog("File "+inputFileName+" is not readable.");
                return true;                   
            }

            Platform.getJobManager().setProgressProvider(null);
View Full Code Here

            int stripPos = logPattern.lastIndexOf(File.separatorChar);
            if (!new File(logPattern).isAbsolute()) logPattern = new File(dataPath, logPattern).getAbsolutePath();
            if (stripPos < 0) stripPos = logPattern.lastIndexOf(File.separatorChar);
            File log = new File(logPattern.substring(0, stripPos));
            if (!log.isAbsolute()) log = new File(dataPath, log.getPath());
            if (!log.canRead()) log.mkdir();

            // generating the root logger
            final Logger logger = Logger.getLogger("");
            logger.setUseParentHandlers(false);
View Full Code Here

                progressDialog.dispose();
                TagEditorFrame.updatePourcentage("",1);
                TagEditorFrame.updatePourcentage(dossier,0);
                SqlProvider.DossierAct=null;
                File dest = new File(dirChooser.getPath());
                if (dest != null && dest.isDirectory() && dest.canRead())
                  navigator.reload();
                navigator.fireDirectoryChange(NavigatorListener.EVENT_RELOAD);
              }
            }, LangageManager.getProperty("miage.updatingfolder")).start();
            progressDialog.setVisible(true);
View Full Code Here

        if (getSettings().isSaveRun() && errors) {
            return -1;
        }
        while (iterator.hasNext() && !progressListener.abort()) {
            File current = (File) iterator.next();
            if (!current.canRead()) {
                progressListener.errorOccured(LangageManager
                        .getProperty("trackenum.processor.readaccesserror")
                        + "\"" + current.getAbsolutePath() + "\"");
                continue;
            }
View Full Code Here

    public void actionPerformed(ActionEvent e) {
        int row = table.getSelectedRow();
        if (row < 0 || row >= table.getRowCount())
            return;
        File dest = model.getFileAt(row);
        if (dest != null && dest.isDirectory() && dest.canRead()) {
            navi.browseInto(dest);
        }
    }

}
View Full Code Here

   */
  private class RootSelectionListener implements ItemListener {
    public void itemStateChanged(ItemEvent e) {
      File selectedRoot = (File) e.getItem();

      if (selectedRoot.canRead()) {
        TagEditorFrame.this.dirChooser.setDirectory(selectedRoot);

        PreferencesManager.putInt("tageditor.tageditorframe.roots",roots.getSelectedIndex());

        TagEditorFrame.this.navigator.setDirectory(selectedRoot);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.