本文整理汇总了Java中org.openide.modules.Places.getCacheSubdirectory方法的典型用法代码示例。如果您正苦于以下问题:Java Places.getCacheSubdirectory方法的具体用法?Java Places.getCacheSubdirectory怎么用?Java Places.getCacheSubdirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.modules.Places
的用法示例。
在下文中一共展示了Places.getCacheSubdirectory方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCacheFolder
import org.openide.modules.Places; //导入方法依赖的package包/类
@NonNull
synchronized FileObject getCacheFolder() {
if (cacheFolder == null) {
File cache = Places.getCacheSubdirectory("index"); // NOI18N
if (!cache.isDirectory()) {
throw new IllegalStateException("Indices cache folder " + cache.getAbsolutePath() + " is not a folder"); //NOI18N
}
if (!cache.canRead()) {
throw new IllegalStateException("Can't read from indices cache folder " + cache.getAbsolutePath()); //NOI18N
}
if (!cache.canWrite()) {
throw new IllegalStateException("Can't write to indices cache folder " + cache.getAbsolutePath()); //NOI18N
}
cacheFolder = FileUtil.toFileObject(cache);
if (cacheFolder == null) {
throw new IllegalStateException("Can't convert indices cache folder " + cache.getAbsolutePath() + " to FileObject"); //NOI18N
}
}
return cacheFolder;
}
示例2: getArchetypes
import org.openide.modules.Places; //导入方法依赖的package包/类
@Override
public List<Archetype> getArchetypes() {
File root = Places.getCacheSubdirectory("mavenarchetypes"); //NOI18N
ArrayList<Archetype> toRet = new ArrayList<Archetype>();
MavenEmbedder embedder = EmbedderFactory.getOnlineEmbedder();
SettingsDecryptionResult settings = embedder.lookupComponent(SettingsDecrypter.class).decrypt(new DefaultSettingsDecryptionRequest(embedder.getSettings()));
for (RepositoryInfo info : RepositoryPreferences.getInstance().getRepositoryInfos()) {
if (info.isRemoteDownloadable()) {
File catalog = new File(new File( root, info.getId()), "archetype-catalog.xml"); //NOI18N
boolean download = false;
if (!catalog.exists()) {
download = true;
} else {
long lastM = catalog.lastModified();
if (lastM == 0) {
download = true;
} else if (lastM - System.currentTimeMillis() > ARCHETYPE_TIMEOUT) {
download = true;
}
}
if (download) {
download(info.getId(), info.getRepositoryUrl(), catalog, settings, embedder);
}
if (catalog.exists()) {
try {
toRet.addAll(CatalogRepoProvider.getArchetypes(Utilities.toURI(catalog).toURL(), info.getRepositoryUrl()));
} catch (MalformedURLException ex) {
LOG.log(Level.INFO, null, ex);
}
}
}
}
return toRet;
}
示例3: getAltMavenLocation
import org.openide.modules.Places; //导入方法依赖的package包/类
private File getAltMavenLocation() {
if (MavenSettings.getDefault().isUseBestMavenAltLocation()) {
String s = MavenSettings.getDefault().getBestMavenAltLocation();
if (s != null && s.trim().length() > 0) {
return FileUtil.normalizeFile(new File(s));
}
}
return Places.getCacheSubdirectory("downloaded-mavens");
}
示例4: getCacheStore
import org.openide.modules.Places; //导入方法依赖的package包/类
public static File getCacheStore() throws IOException {
return Places.getCacheSubdirectory("welcome"); // NOI18N
}
示例5: resetCacheLocation
import org.openide.modules.Places; //导入方法依赖的package包/类
private static void resetCacheLocation() {
cacheLocation = Places.getCacheSubdirectory(CACHE_PATH);
}
示例6: getNetigsoCache
import org.openide.modules.Places; //导入方法依赖的package包/类
private File getNetigsoCache() throws IllegalStateException {
// Explicitly specify the directory to use for caching bundles.
return Places.getCacheSubdirectory("netigso");
}
示例7: getCacheFolder
import org.openide.modules.Places; //导入方法依赖的package包/类
private static synchronized File getCacheFolder () {
if (cacheFolder == null) {
cacheFolder = Places.getCacheSubdirectory("sindex/1.0");
}
return cacheFolder;
}
示例8: getCacheRoot
import org.openide.modules.Places; //导入方法依赖的package包/类
private static File getCacheRoot() {
return Places.getCacheSubdirectory("remotefiles"); //NOI18N
}
示例9: initCacheStore
import org.openide.modules.Places; //导入方法依赖的package包/类
private void initCacheStore() {
cacheStore = Places.getCacheSubdirectory(CACHE_DIRECTORY);
}
示例10: getBaseFolder
import org.openide.modules.Places; //导入方法依赖的package包/类
private File getBaseFolder() {
return Places.getCacheSubdirectory("vcshistory"); // NOI18N
}
示例11: getDefaultIndexLocation
import org.openide.modules.Places; //导入方法依赖的package包/类
private File getDefaultIndexLocation() {
return Places.getCacheSubdirectory("mavenindex");
}
示例12: gortCacheDirectory
import org.openide.modules.Places; //导入方法依赖的package包/类
@Override
public FileObject gortCacheDirectory() {
File gortCacheDirectoryFile = Places.getCacheSubdirectory(GORT_CACHE_DIRECTORY_NAME);
return FileUtil.toFileObject(gortCacheDirectoryFile);
}
示例13: LuceneIndexing
import org.openide.modules.Places; //导入方法依赖的package包/类
LuceneIndexing() {
File vaadinFolder =
Places.getCacheSubdirectory(AbstractRetriever.VAADIN);
myIndexDir = new File(vaadinFolder, ADD_ON_INDEX);
}
示例14: getCachedFile
import org.openide.modules.Places; //导入方法依赖的package包/类
protected File getCachedFile() {
File cache = Places.getCacheSubdirectory(VAADIN);
File versionsFile = new File(cache, getCachedFileName());
return versionsFile;
}