Guest User

Untitled

a guest
Jul 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. boolean has = false;
  2.         JarFile f = null;
  3.         try {
  4.             f = new JarFile(directory + path);
  5.             JarEntry entry = f.getJarEntry(file);
  6.             has = entry != null;
  7.         } catch (IOException e) {
  8.             // TODO Auto-generated catch block
  9.             e.printStackTrace();
  10.         }
  11.         finally{
  12.             if(f != null)
  13.                 try {
  14.                     f.close();
  15.                 } catch (IOException e) {
  16.                     // TODO Auto-generated catch block
  17.                     e.printStackTrace();
  18.                 }
  19.            
  20.         }
  21.         return has;
Add Comment
Please, Sign In to add comment