java.io.FileNotFoundException.toString()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中java.io.FileNotFoundException.toString()方法的一些代码示例,展示了FileNotFoundException.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileNotFoundException.toString()方法的具体详情如下:
包路径:java.io.FileNotFoundException
类名称:FileNotFoundException
方法名:toString

FileNotFoundException.toString介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

private boolean primeNextFile() {
 try {
  if(curPathIter.hasNext() || (primeNextPath() && curPathIter.hasNext())) {
   currentFile = curPathIter.next();
   currentFilename = currentFile.getAbsolutePath();
   if(PRINT_FILENAMES) log.info(currentFile);
   if (tr != null) { tr.close(); }
   tr = treeReaderFactory().newTreeReader(IOUtils.readerFromFile(currentFile, encoding()));
   curLineId = 1;
   return true;
  }
 } catch (UnsupportedEncodingException e) {
  System.err.printf("%s: Filesystem does not support encoding:%n%s%n", this.getClass().getName(), e.toString());
  throw new RuntimeException(e);
 } catch (FileNotFoundException e) {
  System.err.printf("%s: File does not exist:%n%s%n", this.getClass().getName(),e.toString());
  throw new RuntimeException(e);
 } catch (IOException e) {
  System.err.printf("%s: Unable to close open tree reader:%n%s%n", this.getClass().getName(),currentFile.getPath());
  throw new RuntimeException(e);
 }
 return false;
}

代码示例来源:origin: crazycodeboy/TakePhoto

public void compress(String imagePath, CompressListener listener) {
  if (config.isEnablePixelCompress()) {
    try {
      compressImageByPixel(imagePath, listener);
    } catch (FileNotFoundException e) {
      listener.onCompressFailed(imagePath, String.format("图片压缩失败,%s", e.toString()));
      e.printStackTrace();
    }
  } else {
    compressImageByQuality(BitmapFactory.decodeFile(imagePath), imagePath, listener);
  }
}

代码示例来源:origin: knightliao/disconf

logger.warn(e.toString());

代码示例来源:origin: javamelody/javamelody

throw new IllegalStateException(message + '\n' + e.toString(), e);
} catch (final StreamCorruptedException e) {
  final String message = I18N.getFormattedString("reponse_non_comprise", appUrls);

代码示例来源:origin: apache/drill

throw new HiveException(e.toString());
} catch (IOException e) {
 LOG.info("show indexes: " + stringifyException(e));

代码示例来源:origin: pentaho/pentaho-kettle

} catch ( FileNotFoundException fnfe ) {
 logError( BaseMessages.getString( PKG, "JoinRows.Log.UnableToOpenOutputstream" )
  + data.file[data.filenr].toString() + "] : " + fnfe.toString() );
 stopAll();
 setErrors( 1 );

代码示例来源:origin: apache/geode

logger.warning(String.format(
  "The cacheserver status file could not be recreated due to the following exception: %s",
  e.toString()));
loggedWarning = true;

代码示例来源:origin: graphhopper/jsprit

private BufferedReader getReader(String solomonFile) {
  BufferedReader reader = null;
  try {
    reader = new BufferedReader(new FileReader(solomonFile));
  } catch (FileNotFoundException e1) {
    e1.printStackTrace();
    logger.error(e1.toString());
    System.exit(1);
  }
  return reader;
}

代码示例来源:origin: pentaho/pentaho-kettle

} catch ( FileNotFoundException fnfe ) {
 logError( BaseMessages.getString( PKG, "JoinRows.Log.UnableToFindOrOpenTemporaryFile" )
  + data.file[filenr] + "] : " + fnfe.toString() );
 setErrors( 1 );
 stopAll();

代码示例来源:origin: apache/cloudstack

public void refresh() {
  File f = new File(MEMINFO_FILE);
  try (Scanner scanner = new Scanner(f,"UTF-8")) {
    parseFromScanner(scanner);
  } catch (FileNotFoundException ex) {
    throw new RuntimeException("File " + MEMINFO_FILE + " not found:" + ex.toString());
  }
}

代码示例来源:origin: ukanth/afwall

protected String getFileSignature(File f)
{
  String signature = "";
  try
  {
    signature = getStreamSignature(new FileInputStream(f));
  }
  catch (FileNotFoundException ex)
  {
    Log.e(LOG_TAG, ex.toString());
  }
  return signature;
}

代码示例来源:origin: Stericson/RootTools

protected String getFileSignature(File f)
{
  String signature = "";
  try
  {
    signature = getStreamSignature(new FileInputStream(f));
  }
  catch (FileNotFoundException ex)
  {
    Log.e(LOG_TAG, ex.toString());
  }
  return signature;
}

代码示例来源:origin: apache/cloudstack

private UptimeStats getUptimeAndCpuIdleTime() {
  UptimeStats uptime = new UptimeStats(0d, 0d);
  File f = new File(_uptimeFile);
  try (Scanner scanner = new Scanner(f,"UTF-8");) {
    String[] stats = scanner.useDelimiter("\\Z").next().split("\\s+");
    uptime = new UptimeStats(Double.parseDouble(stats[0]), Double.parseDouble(stats[1]));
  } catch (FileNotFoundException ex) {
    s_logger.warn("File " + _uptimeFile + " not found:" + ex.toString());
  }
  return uptime;
}

代码示例来源:origin: kingthy/TVRemoteIME

Log.i(TAG,"FilNotFoundException, ex: " + fne.toString());
} catch(Exception ex) {
  Log.i(TAG,"Exception, ex: " + ex.toString());

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

System.out.println(e.toString());

代码示例来源:origin: apache/cloudstack

public long getTemplateVirtualSize(String templatePath, String templateName) throws InternalErrorException {
  long virtualSize = 0;
  String templateFileFullPath = templatePath.endsWith(File.separator) ? templatePath : templatePath + File.separator;
  templateFileFullPath += templateName.endsWith(ImageFormat.VMDK.getFileExtension()) ? templateName : templateName + "." + ImageFormat.VMDK.getFileExtension();
  try (
      FileReader fileReader = new FileReader(templateFileFullPath);
      BufferedReader bufferedReader = new BufferedReader(fileReader);
    ) {
    Pattern regex = Pattern.compile("(RW|RDONLY|NOACCESS) (\\d+) (FLAT|SPARSE|ZERO|VMFS|VMFSSPARSE|VMFSDRM|VMFSRAW)");
    String line = null;
    while((line = bufferedReader.readLine()) != null) {
      Matcher m = regex.matcher(line);
      if (m.find( )) {
        long sectors = Long.parseLong(m.group(2));
        virtualSize = sectors * 512;
        break;
      }
    }
  } catch(FileNotFoundException ex) {
    String msg = "Unable to open file '" + templateFileFullPath + "' " + ex.toString();
    s_logger.error(msg);
    throw new InternalErrorException(msg);
  } catch(IOException ex) {
    String msg = "Unable read open file '" + templateFileFullPath + "' " + ex.toString();
    s_logger.error(msg);
    throw new InternalErrorException(msg);
  }
  s_logger.debug("vmdk file had size="+virtualSize);
  return virtualSize;
}

代码示例来源:origin: jline/jline

private static Properties initProperties() {
  URL url = determineUrl();
  Properties props = new Properties();
  try {
    loadProperties(url, props);
  }
  catch (FileNotFoundException e) {
    // debug here and no stack trace, as this can happen normally if default jline.rc file is missing
    Log.debug("Unable to read configuration: ", e.toString());
  }
  catch (IOException e) {
    Log.warn("Unable to read configuration from: ", url, e);
  }
  return props;
}

代码示例来源:origin: Stericson/RootTools

Log.e(LOG_TAG, ex.toString());

代码示例来源:origin: apache/cloudstack

} catch (final FileNotFoundException e) {
  result = "File" + sshpubkeypath + "is not found:"
      + e.toString();
  s_logger.debug(result);
} catch (final IOException e) {
  result = "File" + sshprvkeypath + "is not found:" + e.toString();
  s_logger.debug(result);
} catch (final IOException e) {

代码示例来源:origin: apache/cloudstack

} catch (final FileNotFoundException e) {
  s_logger.error("Failed to open " + snapshotDestPath + ". The error was: " + e.getMessage());
  return new CopyCmdAnswer(e.toString());
} catch (final IOException e) {
  s_logger.error("Failed to create " + snapshotDestPath + ". The error was: " + e.getMessage());

相关文章