broker/FileResourceLoader: code formatter used
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
|
||||
package io.moquette.server.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.Reader;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
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 String parentPath;
|
||||
|
||||
@@ -47,15 +47,15 @@ public class FileResourceLoader implements IResourceLoader {
|
||||
}
|
||||
|
||||
public Reader loadResource(File f) {
|
||||
LOG.info("Loading file. Path = {}.", f.getAbsolutePath());
|
||||
LOG.info("Loading file. Path = {}.", f.getAbsolutePath());
|
||||
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!");
|
||||
}
|
||||
try {
|
||||
return new FileReader(f);
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user