当前位置: 首页>>代码示例>>Java>>正文


Java Places.getCacheSubdirectory方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:DefaultCacheFolderProvider.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:CatalogRepoProvider.java

示例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");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:MavenCommandLineExecutor.java

示例4: getCacheStore

import org.openide.modules.Places; //导入方法依赖的package包/类
public static File getCacheStore() throws IOException {
    return Places.getCacheSubdirectory("welcome"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:Utils.java

示例5: resetCacheLocation

import org.openide.modules.Places; //导入方法依赖的package包/类
private static void resetCacheLocation() {
    cacheLocation = Places.getCacheSubdirectory(CACHE_PATH);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:PlatformLayersCacheManager.java

示例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");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:Netigso.java

示例7: getCacheFolder

import org.openide.modules.Places; //导入方法依赖的package包/类
private static synchronized File getCacheFolder () {
    if (cacheFolder == null) {
        cacheFolder = Places.getCacheSubdirectory("sindex/1.0");
    }
    return cacheFolder;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:Index.java

示例8: getCacheRoot

import org.openide.modules.Places; //导入方法依赖的package包/类
private static File getCacheRoot() {
    return Places.getCacheSubdirectory("remotefiles"); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:RemoteFilesCache.java

示例9: initCacheStore

import org.openide.modules.Places; //导入方法依赖的package包/类
private void initCacheStore() {
    cacheStore = Places.getCacheSubdirectory(CACHE_DIRECTORY);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:DiskMapTurboProvider.java

示例10: getBaseFolder

import org.openide.modules.Places; //导入方法依赖的package包/类
private File getBaseFolder() {
    return Places.getCacheSubdirectory("vcshistory"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:StorageManager.java

示例11: getDefaultIndexLocation

import org.openide.modules.Places; //导入方法依赖的package包/类
private File getDefaultIndexLocation() {
    return Places.getCacheSubdirectory("mavenindex");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:NexusRepositoryIndexerImpl.java

示例12: gortCacheDirectory

import org.openide.modules.Places; //导入方法依赖的package包/类
@Override
public FileObject gortCacheDirectory() {
    File gortCacheDirectoryFile = Places.getCacheSubdirectory(GORT_CACHE_DIRECTORY_NAME);
    return FileUtil.toFileObject(gortCacheDirectoryFile);
}
 
开发者ID:samini,项目名称:gort-public,代码行数:6,代码来源:GortCacheDirectoryService.java

示例13: LuceneIndexing

import org.openide.modules.Places; //导入方法依赖的package包/类
LuceneIndexing() {
    File vaadinFolder =
            Places.getCacheSubdirectory(AbstractRetriever.VAADIN);
    myIndexDir = new File(vaadinFolder, ADD_ON_INDEX);
}
 
开发者ID:vaadin,项目名称:netbeans-plugin,代码行数:6,代码来源:LuceneIndexing.java

示例14: getCachedFile

import org.openide.modules.Places; //导入方法依赖的package包/类
protected File getCachedFile() {
    File cache = Places.getCacheSubdirectory(VAADIN);
    File versionsFile = new File(cache, getCachedFileName());
    return versionsFile;
}
 
开发者ID:vaadin,项目名称:netbeans-plugin,代码行数:6,代码来源:AbstractRetriever.java


注:本文中的org.openide.modules.Places.getCacheSubdirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。