broker/FileResourceLoader: code formatter used

This commit is contained in:
Andreas Mager
2017-02-01 17:13:37 +01:00
parent 0b4c812e43
commit 03f103bcff
@@ -1,17 +1,17 @@
package io.moquette.server.config; package io.moquette.server.config;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.Reader; import java.io.Reader;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class FileResourceLoader implements IResourceLoader { public class FileResourceLoader implements IResourceLoader {
private static final Logger LOG = LoggerFactory.getLogger(FileResourceLoader.class); private static final Logger LOG = LoggerFactory.getLogger(FileResourceLoader.class);
private final File defaultFile; private final File defaultFile;
private final String parentPath; private final String parentPath;
@@ -47,15 +47,15 @@ public class FileResourceLoader implements IResourceLoader {
} }
public Reader loadResource(File f) { public Reader loadResource(File f) {
LOG.info("Loading file. Path = {}.", f.getAbsolutePath()); LOG.info("Loading file. Path = {}.", f.getAbsolutePath());
if (f.isDirectory()) { if (f.isDirectory()) {
LOG.error("The given file is a directory. Path = {}.", f.getAbsolutePath()); LOG.error("The given file is a directory. Path = {}.", f.getAbsolutePath());
throw new ResourceIsDirectoryException("File \"" + f + "\" is a directory!"); throw new ResourceIsDirectoryException("File \"" + f + "\" is a directory!");
} }
try { try {
return new FileReader(f); return new FileReader(f);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
LOG.error("The file does not exist. Path = {}.", f.getAbsolutePath()); LOG.error("The file does not exist. Path = {}.", f.getAbsolutePath());
return null; return null;
} }
} }