本文整理匯總了Java中org.cubeengine.libcube.service.filesystem.FileManager類的典型用法代碼示例。如果您正苦於以下問題:Java FileManager類的具體用法?Java FileManager怎麽用?Java FileManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
FileManager類屬於org.cubeengine.libcube.service.filesystem包,在下文中一共展示了FileManager類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: RolesPermissionService
import org.cubeengine.libcube.service.filesystem.FileManager; //導入依賴的package包/類
@Inject
public RolesPermissionService(Roles module, FileManager fm, Reflector reflector, ModuleManager mm)
{
this.reflector = reflector;
this.modulePath = mm.getPathFor(Roles.class);
this.logger = mm.getLoggerFor(Roles.class);
this.config = fm.loadConfig(module, RolesConfig.class);
collections.put(SUBJECTS_DEFAULT, new FileBasedCollection(modulePath, this, reflector, SUBJECTS_DEFAULT, true));
collections.put(SUBJECTS_USER, new UserCollection(this));
collections.put(SUBJECTS_GROUP, new FileBasedCollection(modulePath, this, reflector, SUBJECTS_GROUP, true));
this.getLoadedCollections().values().stream()
.filter(c -> c instanceof FileBasedCollection)
.map(FileBasedCollection.class::cast)
.forEach(FileBasedCollection::reload);
collections.put(SUBJECTS_SYSTEM, new FileBasedCollection(modulePath,this, reflector, SUBJECTS_SYSTEM, true));
// TODO SUBJECTS_COMMAND_BLOCK
collections.put(SUBJECTS_ROLE_TEMPLATE, new FileBasedCollection(modulePath, this, reflector, SUBJECTS_ROLE_TEMPLATE, true));
}
示例2: ApiServer
import org.cubeengine.libcube.service.filesystem.FileManager; //導入依賴的package包/類
@Inject
public ApiServer(LogFactory logFactory, FileManager fm, ModuleManager mm)
{
this.logger = mm.getLoggerFor(ApiServer.class);
this.moduleFolder = mm.getPathFor(ApiServer.class);
this.tf = mm.getThreadFactory(this.getClass());
this.log = logFactory.getLog(ApiServer.class, "WebAPI");
this.mm = mm;
this.log.addTarget(
new AsyncFileTarget.Builder(LoggingUtil.getLogFile(fm, "WebAPI").toPath(),
LoggingUtil.getFileFormat(true, true)
).setAppend(true).setCycler(LoggingUtil.getCycler()).setThreadFactory(tf).build());
// TODO this.log.addTarget(new LogProxyTarget(logFactory.getParent()));
try
{
this.bindAddress.set(InetAddress.getLocalHost());
}
catch (UnknownHostException ignored)
{
this.log.warn("Failed to get the localhost!");
}
}
示例3: MySQLDatabase
import org.cubeengine.libcube.service.filesystem.FileManager; //導入依賴的package包/類
@Inject
public MySQLDatabase(Reflector reflector, ModuleManager mm, FileManager fm, LogFactory logFactory)
{
this.mm = mm;
this.mm.registerBinding(Database.class, this);
File pluginFolder = mm.getBasePath();
// Disable HikariPool Debug ConsoleSpam
((Logger)LogManager.getLogger(HikariPool.class)).setLevel(Level.INFO);
((Logger)LogManager.getLogger("com.zaxxer.hikari.pool.PoolBase")).setLevel(Level.INFO); // really? now pkg-private
((Logger)LogManager.getLogger(HikariConfig.class)).setLevel(Level.INFO);
// Setting up Logger...
this.logger = mm.getLoggerFor(Database.class);
AsyncFileTarget target =
new AsyncFileTarget.Builder(LoggingUtil.getLogFile(fm, "Database").toPath(),
LoggingUtil.getFileFormat(true, false)
).setAppend(true).setCycler(LoggingUtil.getCycler()).setThreadFactory(threadFactory).build();
target.setLevel(LogLevel.DEBUG);
logger.addTarget(target);
LogTarget parentTarget = logger.addDelegate(logFactory.getLog(LogFactory.class));
parentTarget.appendFilter(new PrefixFilter("[DB] "));
parentTarget.setLevel(LogLevel.INFO);
this.config = reflector.load(MySQLDatabaseConfiguration.class, new File(pluginFolder, "database.yml"));
}