protected final I itemsPut(String name, I item) { ChildNameGenerator<AbstractFolder<I>, I> childNameGenerator = childNameGenerator(); if (childNameGenerator != null) { File nameFile = new File(getRootDirFor(item), ChildNameGenerator.CHILD_NAME_FILE); String oldName; if (nameFile.isFile()) { try { oldName = StringUtils.trimToNull(FileUtils.readFileToString(nameFile, "UTF-8")); } catch (IOException e) { oldName = null; } } else { oldName = null; } if (!name.equals(oldName)) { try { FileUtils.writeStringToFile(nameFile, name, "UTF-8"); } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not create " + nameFile); } } } return items.put(name, item); }
protected final I itemsPut(String name, I item) { ChildNameGenerator<AbstractFolder<I>, I> childNameGenerator = childNameGenerator(); if (childNameGenerator != null) { File nameFile = new File(getRootDirFor(item), ChildNameGenerator.CHILD_NAME_FILE); String oldName; if (nameFile.isFile()) { try { oldName = StringUtils.trimToNull(FileUtils.readFileToString(nameFile, "UTF-8")); } catch (IOException e) { oldName = null; } } else { oldName = null; } if (!name.equals(oldName)) { try { FileUtils.writeStringToFile(nameFile, name, "UTF-8"); } catch (IOException e) { LOGGER.log(Level.WARNING, "Could not create " + nameFile); } } } return items.put(name, item); }
final ChildNameGenerator<AbstractFolder<I>,I> childNameGenerator = childNameGenerator(); items = loadChildren(this, getJobsDir(), new Function1<String,I>() { @Override
final ChildNameGenerator<AbstractFolder<I>,I> childNameGenerator = childNameGenerator(); items = loadChildren(this, getJobsDir(), new Function1<String,I>() { @Override
@Override public File getRootDirFor(I child) { ChildNameGenerator<AbstractFolder<I>,I> childNameGenerator = childNameGenerator(); if (childNameGenerator == null) { return getRootDirFor(child.getName()); } String name = childNameGenerator.dirNameFromItem(this, child); if (name == null) { name = childNameGenerator.dirNameFromLegacy(this, child.getName()); } return getRootDirFor(name); }
@Override public File getRootDirFor(I child) { ChildNameGenerator<AbstractFolder<I>,I> childNameGenerator = childNameGenerator(); if (childNameGenerator == null) { return getRootDirFor(child.getName()); } String name = childNameGenerator.dirNameFromItem(this, child); if (name == null) { name = childNameGenerator.dirNameFromLegacy(this, child.getName()); } return getRootDirFor(name); }
return configurations; final ChildNameGenerator<AbstractFolder<V>,V> childNameGenerator = parent.childNameGenerator(); Map<String,V> byDirName = new HashMap<String, V>(); if (parent.items != null) {
return configurations; final ChildNameGenerator<AbstractFolder<V>,V> childNameGenerator = parent.childNameGenerator(); Map<String,V> byDirName = new HashMap<String, V>(); if (parent.items != null) {