Java 8 FileNotFoundException - 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 FileNotFoundException class.

This code example shows how to use the following methods:
        } 
 
        public void renameTo(String from, String to) throws IOException {
            ByteBufferFile fromFile = files.get(from);
            if (fromFile == null)
                throw new FileNotFoundException(from);
            ByteBufferFile toFile = files.get(to);
            if (toFile != null) {
                files.remove(from);
            } 
            files.put(to, fromFile);
        } 
    } 
} 
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: getMessage
    LOG.info("Test Target Delete For listStatus");
    try { 
      fs.listStatus(TEST_PATH);
      fail("Test should fail with FileNotFoundException"); 
    } catch (FileNotFoundException e) {
      assertEquals("File " + TEST_PATH + " does not exist.", e.getMessage());
      LOG.info(StringUtils.stringifyException(e));
    } 
  } 
   
  /** Remove the target directory after the getListing RPC */ 
  @Test 
  public void testTargetDeletionForListLocatedStatus() throws Exception { 
    LOG.info("Test Target Delete For listLocatedStatus");
    RemoteIterator<LocatedFileStatus> itor = fs.listLocatedStatus(TEST_PATH);
    itor.next();
    assertFalse (itor.hasNext());
  } 
} 
Full Snippet Info
7
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
                throw new IllegalArgumentException();
             
            return fd;
        } catch(IllegalArgumentException error)
        { 
            FileNotFoundException fileError = new FileNotFoundException("Cannot assign file for URI: " + uri.toString());
            fileError.initCause(error);
            throw fileError;
        } 
    } 
 
    @Override 
    public boolean onCreate() { 
        return true; 
    } 
 
    @Override 
    public int delete(Uri uri, String s, String[] as) {
        throw new UnsupportedOperationException(
                "Delete operation is not supported by this provider"); 
Full Snippet Info
7
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 
    public void deleteFile(String name) throws IOException {
        ByteBufferFile file = files.remove(name);
        if (file == null)
            throw new FileNotFoundException(name);
        sizeInBytes.addAndGet(-file.sizeInBytes());
        file.delete();
    } 
 
    @Override 
    public long fileLength(String name) throws IOException {
        ByteBufferFile file = files.get(name);
        if (file == null)
            throw new FileNotFoundException(name);
        return file.getLength();
    } 
 
    private final static ImmutableSet<String> SMALL_FILES_SUFFIXES = ImmutableSet.of(
            "del", // 1 bit per doc 
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: getMessage, printStackTrace
        Log.e("Facebook", e.getMessage());
        e.printStackTrace();
    } 
 
    public void onFileNotFoundException(FileNotFoundException e) {
        Log.e("Facebook", e.getMessage());
        e.printStackTrace();
    } 
 
    public void onIOException(IOException e) {
        Log.e("Facebook", e.getMessage());
        e.printStackTrace();
    } 
 
    public void onMalformedURLException(MalformedURLException e) {
        Log.e("Facebook", e.getMessage());
        e.printStackTrace();
    } 
     
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Java 8 FileNotFoundException Questions & Answers:

Other Java 8 FileNotFoundException Examples

46:	
47:	        imageView.setImageBitmap(bitmap);
48:	      } catch (FileNotFoundException e) {
49:	        e.printStackTrace();
50:	      } finally {

Read More

13:				@Override
14:				public void onFileNotFoundException(FileNotFoundException e,
15:						Object state) {
16:				}
17:

Read More

30:				@Override
31:				public void onFileNotFoundException(FileNotFoundException e,
32:						Object state) {
33:				}
34:

Read More

112:				o2.inSampleSize = scale;
113:				return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);
114:			} catch (FileNotFoundException e) {
115:				e.printStackTrace();
116:			}

Read More