mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-12-11 19:36:46 +01:00
Merge pull request #921 from ExpDev07/1.6.x
Removed duplicate/unnececary code in DiscUtil.
This commit is contained in:
commit
190908b181
@ -59,7 +59,6 @@ public class DiscUtil {
|
||||
private static HashMap<String, Lock> locks = new HashMap<String, Lock>();
|
||||
|
||||
public static boolean writeCatch(final File file, final String content, boolean sync) {
|
||||
final byte[] bytes = utf8(content);
|
||||
String name = file.getName();
|
||||
final Lock lock;
|
||||
|
||||
@ -75,9 +74,7 @@ public class DiscUtil {
|
||||
if (sync) {
|
||||
lock.lock();
|
||||
try {
|
||||
FileOutputStream out = new FileOutputStream(file);
|
||||
out.write(bytes);
|
||||
out.close();
|
||||
write(file, content);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
@ -89,9 +86,7 @@ public class DiscUtil {
|
||||
public void run() {
|
||||
lock.lock();
|
||||
try {
|
||||
FileOutputStream out = new FileOutputStream(file);
|
||||
out.write(bytes);
|
||||
out.close();
|
||||
write(file, content);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user