/** * Locates the NetBeans cache directory. * This may be used to store pure performance caches - files which could be safely deleted, * since they would be automatically recreated on demand. * Each module is responsible for using sufficiently unique filenames within this directory. * {@code $userdir/var/cache/} is used as a default when {@link #getUserDirectory} is configured. * As a final fallback, a location in the system temporary directory will be returned. * @return a directory location (never null but need not yet exist) * @see #getCacheSubdirectory * @see #getCacheSubfile */ public static synchronized /*@NonNull*/ File getCacheDirectory() { Places places = Lookup.getDefault().lookup(Places.class); if (places != null) { File cache = places.findCacheDirectory(); if (cache != null) { return cache; } } File userdir = getUserDirectory(); if (userdir != null) { return new File(new File(userdir, "var"), "cache"); } return new File(System.getProperty("java.io.tmpdir"), "nbcache"); }
private File getStorageRootFile() { return new File(new File(Places.getUserDirectory(), "config"), "issue-tracking"); // NOI18N }
static File getStorageRootFile() { return new File(new File(Places.getUserDirectory(), "var"), "filehistory"); // NOI18N }
private File getStorageRootFile() { File userDir = Places.getUserDirectory(); return new File(new File(new File(userDir, "var"), "bugtracking"), "dashboard"); // NOI18N }
/** Tries to set permissions on preferences storage file to -rw------- */ public static void goMinusR(Preferences p) { File props = new File(Places.getUserDirectory(), ("config/Preferences" + p.absolutePath()).replace('/', File.separatorChar) + ".properties"); if (props.isFile()) { props.setReadable(false, false); // seems to be necessary, not sure why props.setReadable(true, true); LOG.log(Level.FINE, "chmod go-r {0}", props); } else { LOG.log(Level.FINE, "no such file to chmod: {0}", props); } }
public static synchronized DictionaryImpl getUsersLocalDictionary(Locale locale) { DictionaryImpl d = locale2UsersLocalDictionary.get(locale); if (d != null) return d; File cache = new File(Places.getUserDirectory(), "private-dictionary-" + locale.toString()); locale2UsersLocalDictionary.put(locale, d = new DictionaryImpl(cache, locale)); return d; }
private static void discardCachesImpl(AtomicLong al) { File user = Places.getUserDirectory(); long now = System.currentTimeMillis(); if (user != null) { File f = new File(user, ".lastModified"); if (f.exists()) { f.setLastModified(now); } else { f.getParentFile().mkdirs(); try { f.createNewFile(); } catch (IOException ex) { LOG.log(Level.WARNING, "Cannot create " + f, ex); } } } if (al != null) { al.set(now); } }
@Messages("MSG_ShortLogTab_name=IDE Log") @Override public void actionPerformed(ActionEvent evt) { File userDir = Places.getUserDirectory(); if (userDir == null) { return; } File f = new File(userDir, "/var/log/messages.log"); LogViewerSupport p = new LogViewerSupport(f, MSG_ShortLogTab_name()); try { p.showLogViewer(); } catch (IOException e) { Logger.getLogger(LogAction.class.getName()).log(Level.INFO, "Showing IDE log action failed", e); } }
File user = Places.getUserDirectory(); if (user != null) { AtomicInteger crc = new AtomicInteger();
if (Places.getUserDirectory() != null) { stamp = new File(new File(Places.getCacheDirectory(), "lastModified"), clusterLocalStamp(cluster)); if (checkStampFile && (time = stamp.lastModified()) > 0) {
jarAliases = new HashMap<>(); Path adaptersFolder = ToolAdapterIO.getAdaptersPath(); File userDirectory = Places.getUserDirectory(); Path nbUserModulesPath = Paths.get(userDirectory != null ? userDirectory.getAbsolutePath() : "", "modules"); if (!Files.exists(nbUserModulesPath)) {
@Override public void run() { OperatorSpiRegistry spiRegistry = GPF.getDefaultInstance().getOperatorSpiRegistry(); Path jarPaths = Paths.get(Places.getUserDirectory().getAbsolutePath(), "modules"); Map<String, File> jarAdapters = Files.exists(jarPaths) ? getJarAdapters(jarPaths.toFile()) : null; if (spiRegistry != null) {
File f = new File(Places.getUserDirectory(), nbCallback.getLogFilePath()); if(f.exists()) { attachment.setAttachment(f, nbCallback.getLogFileDescription(), nbCallback.getLogFileContentType(), false); // NOI18N
taskActivityManager, synchronizationManager); String storagePath = Places.getUserDirectory().getAbsolutePath() + "/var/tasks/mylyn".replace("/", File.separator); //NOI18N taskListStorageFile = new File(storagePath, ITasksCoreConstants.DEFAULT_TASK_LIST_FILE);
File buildProperties = new File(Places.getUserDirectory(), "build.properties"); // NOI18N ep.setProperty("user.properties.file", buildProperties.getAbsolutePath()); //NOI18N