Java 8 IOException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 IOException class.

This code example shows how to use the following methods: getMessage
  { 
    try { 
      return IndexIO.loadIndex(parentDir);
    } 
    catch (IOException e) {
      log.warn(e, "Got exception!!!! Going to delete parentDir[%s]", parentDir);
      try { 
        FileUtils.deleteDirectory(parentDir);
      } 
      catch (IOException e2) {
        log.error(e, "Problem deleting parentDir[%s]", parentDir);
      } 
      throw new SegmentLoadingException(e, "%s", e.getMessage());
    } 
  } 
} 
Full Snippet Info
9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods:
    @Override 
    protected void readHeader(IndexInput in) throws IOException {
        byte[] header = new byte[LZFCompressor.LUCENE_HEADER.length];
        in.readBytes(header, 0, header.length, false);
        if (!Arrays.equals(header, LZFCompressor.LUCENE_HEADER)) {
            throw new IOException("wrong lzf compressed header [" + Arrays.toString(header) + "]");
        } 
    } 
 
    @Override 
    protected int uncompress(IndexInput in, byte[] out) throws IOException {
        return decoder.decodeChunk(new InputStreamIndexInput(in, Long.MAX_VALUE), inputBuffer, out);
    } 
 
    @Override 
    protected void doClose() throws IOException { 
        // nothing to do here... 
    } 
 
    @Override 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: toString
    df.parseExecResult(reader);
    try { 
      df.parseOutput();
      fail("Expected exception with missing line!"); 
    } catch (IOException e) {
      GenericTestUtils.assertExceptionContains( 
          "Fewer lines of output than expected", e);
      System.out.println(e.toString());
    } 
     
    reader = new BufferedReader(new StringReader(
        "Filesystem     1K-blocks     Used Available Use% Mounted on\n" + 
        " ")); 
    df.parseExecResult(reader);
    try { 
      df.parseOutput();
      fail("Expected exception with empty line!"); 
    } catch (IOException e) {
      GenericTestUtils.assertExceptionContains("Unexpected empty line", e);
      System.out.println(e.toString());

8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: initCause, setStackTrace
  throws IOException { 
    String decodedFileName = null;
    try { 
      decodedFileName = URLDecoder.decode(logFileName, "UTF-8");
    } catch (UnsupportedEncodingException uee) {
      IOException ioe = new IOException();
      ioe.initCause(uee);
      ioe.setStackTrace(uee.getStackTrace());
      throw ioe;
    } 
    return decodedFileName;
  } 
   
  static String nonOccursString(String logFileName) {
    int adHocIndex = 0;
 
    String unfoundString = "q" + adHocIndex;
 
    while (logFileName.contains(unfoundString)) {
      unfoundString = "q" + ++adHocIndex;
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: initCause
    if (writableClass != null)
      return writableClass.asSubclass(Writable.class);
    try { 
      return conf.getClassByName(name);
    } catch (ClassNotFoundException e) {
      IOException newE = new IOException("WritableName can't load class: " + name);
      newE.initCause(e);
      throw newE;
    } 
  } 
 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 IOException Questions & Answers:

Other Java 8 IOException Examples

52:	          try {
53:	            stream.close();
54:	          } catch (IOException e) {
55:	            e.printStackTrace();
56:	          }

Read More

20:	      try {
21:	        reader.close();
22:	      } catch (IOException e) {
23:	        e.printStackTrace();
24:	      }

Read More

40:	    try {
41:	      audiofile = File.createTempFile("sound", ".3gp", sampleDir);
42:	    } catch (IOException e) {
43:	      Log.e(TAG, "sdcard access error");
44:	      return;

Read More

26:				e.printStackTrace();
27:			} catch (IOException e) {
28:				e.printStackTrace();
29:			}
30:		}

Read More

15:					Log.e("Error: ", e.getMessage());
16:		            return null;
17:				} catch (IOException e) {
18:					Log.e("Error: ", e.getMessage());
19:					return null;

Read More

9:				@Override
10:				public void onIOException(IOException e, Object state) {
11:				}
12:	
13:				@Override

Read More