Skip to content

Commit

Permalink
Undo placing cached jar with Paperclip
Browse files Browse the repository at this point in the history
This is no longer needed, as both Java 8 and Java 9 implementations
handle adding classpath entries properly, without requiring on fragile
jar manifest entries. While it is not needed anymore, keeping the cache
directory with the Paperclip jar could cause several issues, especially:

 * In cases where the user does not have write access to the Paperclip
   jar itself, such as a hosted server.

 * In cases where a user is starting up multiple Paperclip servers on
   the same machine using the same Paperclip jar at the same time.

I don't imagine the second point to actually be a common problem, but it
is technically an issue.
  • Loading branch information
DenWav committed Sep 28, 2017
1 parent 5914c0e commit d0395f6
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions java8/src/main/java/com/destroystokyo/paperclip/Paperclip.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,12 @@

class Paperclip {

private final static File cache;
private final static File cache = new File("cache");
private static MessageDigest digest;
private final static File customPatchInfo = new File("paperclip.json");

static File paperJar;

static {
try {
cache = new File(new File(Paperclip.class.getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile(), "cache");
} catch (final URISyntaxException e) {
System.err.println("Error finding jar location to set cache directory");
e.printStackTrace();
System.exit(1);
// Make compiler happy
throw new RuntimeException();
}
}

static void run(final String[] args) {
try {
digest = MessageDigest.getInstance("SHA-256");
Expand Down

0 comments on commit d0395f6

Please sign in to comment.