public UU32FilePool(String path) { this.root = Files.createDirIfNoExists(path); }
public File createFile(String suffix) { String key = R.UU32(); File dir = new File(root, key.substring(0, 2)); Files.createDirIfNoExists(dir); return new File(dir, key.substring(2)); } public void clear() {
public void clear() { Files.deleteDir(root); this.root = Files.createDirIfNoExists(root); }
public SimpleFilePool(String homePath, long max) { if (log.isInfoEnabled()) { log.infof("Init simple-file-pool by: %s [%s]", homePath, max); } this.max = max; this.home = Files.createDirIfNoExists(homePath); this.current = 0; }
public File createDir() { if (size > 0 && cursor >= size) cursor = -1; long id = ++cursor; if (size > 0 && id >= size) Lang.makeThrow("Id (%d) is out of range (%d)", id, size); return Files.createDirIfNoExists(Pools.getFilePathById(home, id, null)); }
public NutFilePool(String homePath, long size) { if (log.isInfoEnabled()) { log.infof("Init file-pool by: %s [%s]", homePath, size); } this.size = size; this.home = Files.createDirIfNoExists(homePath); if (!home.isDirectory()) throw Lang.makeThrow( "Path error '%s'! ,You must declare a real directory as the '%s' home folder.", homePath, this.getClass().getName()); home = new File(Disks.normalize(homePath)); if (log.isDebugEnabled()) { log.debugf("file-pool.home: '%s'", home.getAbsolutePath()); } cursor = foundMax(home, home, 0); if (cursor < 0) cursor = 0; if (log.isInfoEnabled()) log.infof("file-pool.cursor: %s", cursor); }
public UU32FilePool(String path) { this.root = Files.createDirIfNoExists(path); }
public File createFile(String suffix) { String key = R.UU32(); File dir = new File(root, key.substring(0, 2)); Files.createDirIfNoExists(dir); return new File(dir, key.substring(2)); } public void clear() {
public static String mkDir(File root, String path) { if (-1 != path.indexOf(".")) { path = path.replaceAll("\\.", "/"); } log.info("mkdir : " + path); String dir = root.getAbsolutePath() + "/" + path; File mdir = Files.createDirIfNoExists(dir); if (mdir != null) { return mdir.getAbsolutePath(); } return null; }
public void clear() { Files.deleteDir(root); this.root = Files.createDirIfNoExists(root); }
public File createDir() { if (size > 0 && cursor >= size) cursor = -1; long id = ++cursor; if (size > 0 && id >= size) Lang.makeThrow("Id (%d) is out of range (%d)", id, size); return Files.createDirIfNoExists(Pools.getFilePathById(home, id, null)); }
public SimpleFilePool(String homePath, long max) { if (log.isInfoEnabled()) { log.infof("Init simple-file-pool by: %s [%s]", homePath, max); } this.max = max; this.home = Files.createDirIfNoExists(homePath); this.current = 0; }
public void init() { if (conf.has("urule.repository.dir")) { String dir = conf.get("urule.repository.dir"); dir = Files.createDirIfNoExists(dir).getAbsolutePath(); conf.set("rule.repository.di", dir); } }
private String doScan() { final StringBuilder sb = new StringBuilder(); final HashMap<String, Boolean> paths = new HashMap<String, Boolean>(); File home = Files.createDirIfNoExists(rsHome); Context context = Lang.context(); context.set(Webs.RS, rs);
public NutFilePool(String homePath, long size) { if (log.isInfoEnabled()) { log.infof("Init file-pool by: %s [%s]", homePath, size); } this.size = size; this.home = Files.createDirIfNoExists(homePath); if (!home.isDirectory()) throw Lang.makeThrow( "Path error '%s'! ,You must declare a real directory as the '%s' home folder.", homePath, this.getClass().getName()); home = new File(Disks.normalize(homePath)); if (log.isDebugEnabled()) { log.debugf("file-pool.home: '%s'", home.getAbsolutePath()); } cursor = foundMax(home, home, 0); if (cursor < 0) cursor = 0; if (log.isInfoEnabled()) log.infof("file-pool.cursor: %s", cursor); }
log.info("\n" + Json.toJson(pc)); File root = Files.createDirIfNoExists(pc.path); Files.createDirIfNoExists(root); String pkgPath = "src/" + pc.pkg; mkDir(root, "src");