/** * Convenience method to get a particular subdirectory within {@link #getCacheDirectory}. * The directory will be created if it does not yet exist (but a warning logged if permissions do not allow this). * @param path a subdirectory path such as {@code stuff} or {@code mymodule/stuff} ({@code /} permitted even on Windows) * @return a directory of that name within the general cache directory */ public static /*@NonNull*/ File getCacheSubdirectory(String path) { File d = new File(getCacheDirectory(), path); if (!d.isDirectory() && !d.mkdirs()) { LOG.log(Level.WARNING, "could not create {0}", d); } return d; }
/** * Convenience method to get a particular file within {@link #getCacheDirectory}. * The parent directory will be created if it does not yet exist (but a warning logged if permissions do not allow this); * the file itself will not be automatically created. * @param path a file path such as {@code stuff.ser} or {@code mymodule/stuff.ser} ({@code /} permitted even on Windows) * @return a file of that name within the general cache directory */ public static /*@NonNull*/ File getCacheSubfile(String path) { File f = new File(getCacheDirectory(), path); File d = f.getParentFile(); if (!d.isDirectory() && !d.mkdirs()) { LOG.log(Level.WARNING, "could not create {0}", d); } return f; }
@Override public FileObject getCacheDirectory() throws IOException { synchronized (lock) { if (cacheDirectory == null) { File cacheFile = getCacheLocation(projectDirectory); if (cacheFile == null) { // TODO: find more elegant soluition than duplicating "cnd.repository.cache.path" in CacheLocation and MakeProject // What we can do is our own Places impl. that delegates to the next Places impl. if this property is not set; is it worth doing? String path = System.getProperty("cnd.repository.cache.path"); if (path == null) { cacheFile = Places.getCacheDirectory(); } else { cacheFile = new File(path); } } cacheDirectory = FileUtil.createFolder(cacheFile); } return cacheDirectory; } }
public boolean store(AtomicInteger delay) { assert os == null; File cacheDir = Places.getCacheDirectory(); if (!cacheDir.isDirectory()) { LOG.log(Level.WARNING, "Nonexistent cache directory: {0}", cacheDir); // NOI18N
sb.append("branding=").append(NbBundle.getBranding()).append('\n'); File checkSum = new File(Places.getCacheDirectory(), "lastModified/all-checksum.txt"); if (!compareAndUpdateFile(checkSum, sb.toString(), result)) { discardCachesImpl(result);
File cache = Places.getCacheDirectory(); String[] children = cache.list(); if (children != null && children.length > 0) {
stamp = new File(new File(Places.getCacheDirectory(), "lastModified"), clusterLocalStamp(cluster)); if (checkStampFile && (time = stamp.lastModified()) > 0) { if (time > result.longValue()) {
initComponents(); imageLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); description.setText(LBL_description(getProductVersionValue(), getJavaValue(), getVMValue(), getOperatingSystemValue(), getEncodingValue(), getSystemLocaleValue(), getUserDirValue(), Places.getCacheDirectory().getAbsolutePath(), "", FONT_SIZE, getJavaRuntime())); description.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); RequestProcessor.getDefault().post(new Runnable() {