Skip to content

Commit

Permalink
Provide decent logging
Browse files Browse the repository at this point in the history
  • Loading branch information
gurpreet- committed Jul 10, 2020
1 parent 74f85bd commit 4c6227c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ dependencies {
testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.0.0'
testImplementation "net.jodah:concurrentunit:0.4.6"
implementation "net.java.dev.jna:jna:5.5.0"
implementation 'org.slf4j:slf4j-api:2.0.0-alpha1'
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/libly/resourceloader/Main.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Libly - Terl Tech Ltd • 24/08/2019, 16:01 • libly.co, goterl.com
* Copyright (c) Libly - Terl Tech Ltd • 10/07/2020, 23:32 • libly.co, goterl.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v2.0. If a copy of the MPL was not distributed with this
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/co/libly/resourceloader/ResourceLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


import com.sun.jna.Platform;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.net.MalformedURLException;
Expand All @@ -31,11 +33,12 @@
*/
public class ResourceLoader {

private final Logger logger = LoggerFactory.getLogger("ResourceLoader");

private final Collection<PosixFilePermission> writePerms = new ArrayList<>();
private final Collection<PosixFilePermission> readPerms = new ArrayList<>();
private final Collection<PosixFilePermission> execPerms = new ArrayList<>();


ResourceLoader() {
readPerms.add(PosixFilePermission.OWNER_READ);
readPerms.add(PosixFilePermission.OTHERS_READ);
Expand Down Expand Up @@ -100,8 +103,8 @@ private boolean isJarFile(URL jarUrl) {
if (manifest != null) {
return true;
}
} catch (IOException | SecurityException | IllegalStateException e) {
System.out.println("Exception getting JarFile object: " + e.getMessage());
} catch (IOException | IllegalStateException | SecurityException e) {
logger.debug("This is not a JAR file due to {}", e.getMessage());
}
}
return false;
Expand Down

0 comments on commit 4c6227c

Please sign in to comment.