Tabnine Logo
IOException.getLocalizedMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getLocalizedMessage
method
in
java.io.IOException

Best Java code snippets using java.io.IOException.getLocalizedMessage (Showing top 20 results out of 6,057)

Refine searchRefine arrow

  • SVNErrorManager.error
  • SVNErrorMessage.create
  • Logger.log
  • File.<init>
origin: jMonkeyEngine/jmonkeyengine

/**
 * Constructor. Loads the constants needed for computations. They are exactly like the ones the blender uses. Each
 * deriving class should override this method and load its own constraints.
 */
public NoiseGenerator() {
  LOGGER.fine("Loading noise constants.");
  InputStream is = NoiseGenerator.class.getResourceAsStream("noiseconstants.dat");
  try {
    ObjectInputStream ois = new ObjectInputStream(is);
    hashpntf = (float[]) ois.readObject();
    hash = (short[]) ois.readObject();
    hashvectf = (float[]) ois.readObject();
    p = (short[]) ois.readObject();
    g = (float[][]) ois.readObject();
  } catch (IOException e) {
    LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
  } catch (ClassNotFoundException e) {
    assert false : "Constants' classes should be arrays of primitive types, so they are ALWAYS known!";
  } finally {
    if (is != null) {
      try {
        is.close();
      } catch (IOException e) {
        LOGGER.log(Level.WARNING, e.getLocalizedMessage());
      }
    }
  }
}
origin: stanfordnlp/CoreNLP

private void doExportTree() {
 JFileChooser chooser = new JFileChooser();
 chooser.setSelectedFile(new File("./tree.png"));
 FileNameExtensionFilter filter = new FileNameExtensionFilter("PNG images", "png");
 chooser.setFileFilter(filter);
 int status = chooser.showSaveDialog(this);
 if (status != JFileChooser.APPROVE_OPTION)
  return;
 Dimension size = tjp.getPreferredSize();
 BufferedImage im = new BufferedImage((int) size.getWidth(),
                    (int) size.getHeight(),
                    BufferedImage.TYPE_INT_ARGB);
 Graphics2D g = im.createGraphics();
 tjp.paint(g);
 try {
  ImageIO.write(im, "png", chooser.getSelectedFile());
 } catch (IOException e) {
  JOptionPane.showMessageDialog(this, "Failed to save the tree image file.\n"
                 + e.getLocalizedMessage(), "Export Error",
                 JOptionPane.ERROR_MESSAGE);
 }
}
origin: geoserver/geoserver

  LOGGER.log(
      Level.WARNING,
      "Unable to test with this resource name: "
  LOGGER.log(
      Level.WARNING,
      "Unable to test with this resource name which does not has properties.");
try {
  properties =
      new File(testData.getDataDirectoryRoot(), ManifestLoader.PROPERTIES_FILE);
  writer.flush();
} catch (IOException e) {
  LOGGER.log(
      Level.WARNING,
      "Unable to write test data to:" + testData.getDataDirectoryRoot());
  org.junit.Assert.fail(e.getLocalizedMessage());
} finally {
  IOUtils.closeQuietly(writer);
origin: org.tmatesoft.svnkit/svnkit

public static void createFormatFile(File adminDir) throws SVNException {
  OutputStream os = null;
  try {
    os = SVNFileUtil.openFileForWriting(new File(adminDir, "format"));
    os.write(FORMAT_TEXT);
  } catch (IOException e) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage());
    SVNErrorManager.error(err, e, SVNLogType.FSFS);
  } finally {
    SVNFileUtil.closeFile(os);
  }
}
origin: geotools/geotools

      WorldImageReader.class.toString(),
      "WorldImageReader",
      ex.getLocalizedMessage(),
      ex);
  throw new DataSourceException(ex);
        path = "//" + auth + path;
      this.source = input = new File(URLDecoder.decode(path, "UTF-8"));
    } else if (sourceURL.getProtocol().equalsIgnoreCase("http")) {
    if (tempCRS != null) {
      this.crs = (CoordinateReferenceSystem) tempCRS;
      LOGGER.log(Level.WARNING, "Using forced coordinate reference system ");
    } else readCRS();
  LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
  throw new DataSourceException(e);
} catch (TransformException e) {
  LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
  throw new DataSourceException(e);
origin: org.jvnet.hudson.svnkit/svnkit

private void writeDumpData(OutputStream out, byte[] bytes) throws SVNException {
  try {
    out.write(bytes); 
  } catch (IOException ioe) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage());
    SVNErrorManager.error(err, ioe, SVNLogType.FSFS);
  }
}
origin: Netflix/Priam

@Override
public void save(BackupMetadata backupMetadata) {
  File snapshotFile = new File(filename);
  if (!snapshotFile.exists()) snapshotFile.getParentFile().mkdirs();
  // Will save entire list to file.
  try (final ObjectOutputStream out =
      new ObjectOutputStream(new FileOutputStream(filename))) {
    out.writeObject(backupMetadataMap);
    out.flush();
    logger.info(
        "Snapshot status of size {} is saved to {}",
        backupMetadataMap.size(),
        filename);
  } catch (IOException e) {
    logger.error(
        "Error while trying to persist snapshot status to {}. Error: {}",
        filename,
        e.getLocalizedMessage());
  }
}
origin: geotools/geotools

/**
 * Write the provided {@link RenderedImage} in the debug directory with the provided file name.
 *
 * @param raster the {@link RenderedImage} that we have to write.
 * @param fileName a {@link String} indicating where we should write it.
 */
static void writeRenderedImage(final RenderedImage raster, final String fileName) {
  if (DUMP_DIRECTORY == null)
    throw new NullPointerException(
        "Unable to write the provided coverage in the debug directory");
  if (DEBUG == false)
    throw new IllegalStateException(
        "Unable to write the provided coverage since we are not in debug mode");
  try {
    ImageIO.write(raster, "tiff", new File(DUMP_DIRECTORY, fileName + ".tiff"));
  } catch (IOException e) {
    LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
  }
}
origin: org.codehaus.jtstand/jtstand-svnkit

public static void createFormatFile(File adminDir) throws SVNException {
  OutputStream os = null;
  try {
    os = SVNFileUtil.openFileForWriting(new File(adminDir, "format"));
    os.write(FORMAT_TEXT);            
  } catch (IOException e) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage());
    SVNErrorManager.error(err, e, SVNLogType.FSFS);
  } finally {
    SVNFileUtil.closeFile(os);
  }
}

origin: geoserver/geoserver

    LOGGER.log(
        java.util.logging.Level.SEVERE,
        "Error loading resources file: " + e.getLocalizedMessage(),
        e);
  } finally {
LOGGER.log(
    java.util.logging.Level.SEVERE,
    "Error loading resources file: " + e.getLocalizedMessage(),
    e);
origin: org.tmatesoft.svnkit/svnkit

private void writeDumpData(OutputStream out, byte[] bytes) throws SVNException {
  try {
    out.write(bytes); 
  } catch (IOException ioe) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage());
    SVNErrorManager.error(err, ioe, SVNLogType.FSFS);
  }
}
origin: Netflix/Priam

private void init() {
  File snapshotFile = new File(filename);
  if (!snapshotFile.exists()) {
    snapshotFile.getParentFile().mkdirs();
        "Error while trying to fetch snapshot status from {}. Error: {}. If this is first time after upgrading Priam, ignore this.",
        filename,
        e.getLocalizedMessage());
    e.printStackTrace();
  } catch (Exception e) {
origin: geotools/geotools

final File prjFile = new File(prjPath);
if (prjFile.exists()) {
      LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
      LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
      LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
      } catch (IOException e) {
        if (LOGGER.isLoggable(Level.WARNING)) {
          LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
          LOGGER.log(FINE, ioe.getLocalizedMessage(), ioe);
origin: org.jvnet.hudson.svnkit/svnkit

public static void createFormatFile(File adminDir) throws SVNException {
  OutputStream os = null;
  try {
    os = SVNFileUtil.openFileForWriting(new File(adminDir, "format"));
    os.write(FORMAT_TEXT);            
  } catch (IOException e) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage());
    SVNErrorManager.error(err, e, SVNLogType.FSFS);
  } finally {
    SVNFileUtil.closeFile(os);
  }
}

origin: org.netbeans.api/org-openide-filesystems

protected void createData(String name) throws IOException {
  File f = getFile(name);
  boolean isError = true;
  IOException creationException = null;
  String annotationMsg = null;
  try {
    isError = f.createNewFile() ? false : true;
    isError = isError ? true : (!f.exists());
    if (isError) {
      annotationMsg = NbBundle.getMessage(LocalFileSystem.class, "EXC_DataAlreadyExist", f.getName(), getDisplayName(), f.getAbsolutePath());
      creationException = new SyncFailedException(annotationMsg);
    }
  } catch (IOException iex) {
    isError = true;
    creationException = iex;
    annotationMsg = iex.getLocalizedMessage();
  }
  if (isError) {
  LOG.log(Level.INFO, "Trying to create new file {0}.", f.getPath());
    ExternalUtil.annotate(creationException, annotationMsg);
    throw creationException;
  }
}
origin: org.codehaus.jtstand/jtstand-svnkit

private void writeDumpData(OutputStream out, byte[] bytes) throws SVNException {
  try {
    out.write(bytes); 
  } catch (IOException ioe) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage());
    SVNErrorManager.error(err, ioe, SVNLogType.FSFS);
  }
}
origin: ankidroid/Anki-Android

/**
 * Utility method to write to a file.
 * Throws the exception, so we can report it in syncing log
 */
private static void writeToFileImpl(InputStream source, String destination) throws IOException {
  File f = new File(destination);
  try {
    Timber.d("Creating new file... = %s", destination);
    f.createNewFile();
    long startTimeMillis = System.currentTimeMillis();
    long sizeBytes = CompatHelper.getCompat().copyFile(source, destination);
    long endTimeMillis = System.currentTimeMillis();
    Timber.d("Finished writeToFile!");
    long durationSeconds = (endTimeMillis - startTimeMillis) / 1000;
    long sizeKb = sizeBytes / 1024;
    long speedKbSec = 0;
    if (endTimeMillis != startTimeMillis) {
      speedKbSec = sizeKb * 1000 / (endTimeMillis - startTimeMillis);
    }
    Timber.d("Utils.writeToFile: Size: %d Kb, Duration: %d s, Speed: %d Kb/s", sizeKb, durationSeconds, speedKbSec);
  } catch (IOException e) {
    throw new IOException(f.getName() + ": " + e.getLocalizedMessage(), e);
  }
}
origin: geotools/geotools

final File prjFile = new File(base.toString());
if (prjFile.exists()) {
    LOGGER.log(Level.INFO, e.getLocalizedMessage(), e);
  } catch (IOException e) {
    LOGGER.log(Level.INFO, e.getLocalizedMessage(), e);
  } catch (FactoryException e) {
    LOGGER.log(Level.INFO, e.getLocalizedMessage(), e);
  } finally {
    if (projReader != null)
        LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
        LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
origin: org.tmatesoft/svn

public static void createFormatFile(File adminDir) throws SVNException {
  OutputStream os = null;
  try {
    os = SVNFileUtil.openFileForWriting(new File(adminDir, "format"));
    os.write(FORMAT_TEXT);            
  } catch (IOException e) {
    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e.getLocalizedMessage());
    SVNErrorManager.error(err, e);
  } finally {
    SVNFileUtil.closeFile(os);
  }
}
 
origin: geotools/geotools

@Override
public AbstractGridCoverage2DReader getReader(Object source, Hints hints) {
  try {
    return new MBTilesReader(source, hints);
  } catch (IOException e) {
    LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
    return null;
  }
}
java.ioIOExceptiongetLocalizedMessage

Popular methods of IOException

  • <init>
    Constructs a new instance of this class with its detail cause filled in.
  • getMessage
  • printStackTrace
  • toString
  • initCause
  • getCause
  • getStackTrace
  • addSuppressed
  • setStackTrace
  • fillInStackTrace
  • getSuppressed
  • getSuppressed

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Socket (java.net)
    Provides a client-side TCP socket.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now