Skip to content

Instantly share code, notes, and snippets.

@hgadre
Created February 11, 2016 02:30
Show Gist options
  • Save hgadre/efd959ad1d0f1793b8b2 to your computer and use it in GitHub Desktop.
Save hgadre/efd959ad1d0f1793b8b2 to your computer and use it in GitHub Desktop.
Check jar function
public void checkJar() {
java.io.File jarFile = null;
try {
jarFile = new java.io.File("/var/lib/solr/tomcat-deployment/webapps/solr/WEB-INF/lib/antlr-runtime-3.5.jar");
System.out.println("^^^^^^^^jar exists = " + jarFile.exists());
System.out.println("^^^^^^^^jar canRead = " + jarFile.canRead());
} catch ( Exception e ) {
e.printStackTrace();
}
}
// After ServletFilter init(...) method,
// ^^^^^^^^jar exists = true
// ^^^^^^^^jar canRead = true
// After ServletFilter destroy(...) method,
// ^^^^^^^^jar exists = false
// ^^^^^^^^jar canRead = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment