本文整理汇总了Java中com.intellij.openapi.util.io.FileUtil.PATH_HASHING_STRATEGY属性的典型用法代码示例。如果您正苦于以下问题:Java FileUtil.PATH_HASHING_STRATEGY属性的具体用法?Java FileUtil.PATH_HASHING_STRATEGY怎么用?Java FileUtil.PATH_HASHING_STRATEGY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.util.io.FileUtil
的用法示例。
在下文中一共展示了FileUtil.PATH_HASHING_STRATEGY属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAndClearDeletedPaths
public Set<String> getAndClearDeletedPaths() {
lockData();
try {
try {
final THashSet<String> _paths = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
_paths.addAll(myDeletedPaths);
return _paths;
}
finally {
myDeletedPaths.clear();
}
}
finally {
unlockData();
}
}
示例2: addFileToProcess
private static void addFileToProcess(TIntObjectHashMap<Set<String>> filesToProcess,
final int rootIndex,
final String path,
Collection<String> deletedFiles) {
if (deletedFiles.contains(path)) {
return;
}
Set<String> paths = filesToProcess.get(rootIndex);
if (paths == null) {
paths = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
filesToProcess.put(rootIndex, paths);
}
paths.add(path);
}
示例3: outputRootWasDeleted
public boolean outputRootWasDeleted(CompileContext context) throws IOException {
List<String> nonexistentOutputRoots = new SmartList<String>();
final Collection<File> targetRoots = myTarget.getOutputRoots(context);
synchronized (ALL_DELETED_ROOTS_KEY) {
Set<File> allDeletedRoots = ALL_DELETED_ROOTS_KEY.get(context);
for (File outputRoot : targetRoots) {
boolean wasDeleted = allDeletedRoots != null && allDeletedRoots.contains(outputRoot);
if (!wasDeleted) {
wasDeleted = !outputRoot.exists();
if (wasDeleted) {
if (allDeletedRoots == null) { // lazy init
allDeletedRoots = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
ALL_DELETED_ROOTS_KEY.set(context, allDeletedRoots);
}
allDeletedRoots.add(outputRoot);
}
}
if (wasDeleted) {
nonexistentOutputRoots.add(outputRoot.getAbsolutePath());
}
}
}
if (nonexistentOutputRoots.isEmpty()) {
return false;
}
Set<String> storedNonExistentOutputs;
File file = getNonexistentOutputsFile();
if (!file.exists()) {
storedNonExistentOutputs = Collections.emptySet();
}
else {
List<String> lines = StringUtil.split(FileUtil.loadFile(file), "\n");
storedNonExistentOutputs = new THashSet<String>(lines, FileUtil.PATH_HASHING_STRATEGY);
}
return !storedNonExistentOutputs.containsAll(nonexistentOutputRoots);
}
示例4: read
public Collection<String> read(@NotNull DataInput in) throws IOException {
final Set<String> result = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
final DataInputStream stream = (DataInputStream)in;
while (stream.available() > 0) {
final String str = IOUtil.readUTF(stream);
result.add(str);
}
return result;
}
示例5: BuilderRegistry
private BuilderRegistry() {
for (BuilderCategory category : BuilderCategory.values()) {
myModuleLevelBuilders.put(category, new ArrayList<ModuleLevelBuilder>());
}
Set<String> compilableFileExtensions = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
for (BuilderService service : JpsServiceManager.getInstance().getExtensions(BuilderService.class)) {
myTargetBuilders.addAll(service.createBuilders());
final List<? extends ModuleLevelBuilder> moduleLevelBuilders = service.createModuleLevelBuilders();
for (ModuleLevelBuilder builder : moduleLevelBuilders) {
List<String> extensions = builder.getCompilableFileExtensions();
if (extensions == null) {
LOG.info(builder.getClass().getName() + " builder returns 'null' from 'getCompilableFileExtensions' method so files for module-level builders won't be filtered");
compilableFileExtensions = null;
}
else if (compilableFileExtensions != null) {
compilableFileExtensions.addAll(extensions);
}
myModuleLevelBuilders.get(builder.getCategory()).add(builder);
}
}
if (compilableFileExtensions == null) {
myModuleBuilderFileFilter = FileUtilRt.ALL_FILES;
}
else {
final Set<String> finalCompilableFileExtensions = compilableFileExtensions;
myModuleBuilderFileFilter = new FileFilter() {
@Override
public boolean accept(File file) {
return finalCompilableFileExtensions.contains(FileUtilRt.getExtension(file.getName()));
}
};
}
}
示例6: getRemovedPaths
private static Set<String> getRemovedPaths(ModuleChunk chunk, DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget> dirtyFilesHolder) {
if (!dirtyFilesHolder.hasRemovedFiles()) {
return Collections.emptySet();
}
final Set<String> removed = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
for (ModuleBuildTarget target : chunk.getTargets()) {
removed.addAll(dirtyFilesHolder.getRemovedFiles(target));
}
return removed;
}
示例7: CompilationLog
public CompilationLog(boolean externalBuildUpToDate, List<String> generatedFilePaths, CompilerMessage[] errors,
CompilerMessage[] warnings) {
myExternalBuildUpToDate = externalBuildUpToDate;
myErrors = errors;
myWarnings = warnings;
myGeneratedPaths = new THashSet<String>(generatedFilePaths, FileUtil.PATH_HASHING_STRATEGY);
}
示例8: getMap
@NotNull
private Map<String, FileAttributes> getMap() {
Map<String, FileAttributes> map = com.intellij.reference.SoftReference.dereference(myCache);
if (map == null) {
map = new THashMap<String, FileAttributes>(FileUtil.PATH_HASHING_STRATEGY);
myCache = new SoftReference<Map<String, FileAttributes>>(map);
}
return map;
}
示例9: filterExcludedByOtherProviders
@NotNull
private static List<String> filterExcludedByOtherProviders(@NotNull JpsModule module, @NotNull Collection<String> genRoots) {
final Set<String> genRootPaths = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
for (String genRoot : genRoots) {
genRootPaths.add(FileUtil.toSystemIndependentName(genRoot));
}
final List<String> result = new ArrayList<String>();
final List<JpsModuleSourceRoot> genSourceRoots = new ArrayList<JpsModuleSourceRoot>();
for (JpsModuleSourceRoot root : module.getSourceRoots()) {
if (genRootPaths.contains(FileUtil.toSystemIndependentName(root.getFile().getPath()))) {
genSourceRoots.add(root);
}
}
final Iterable<ExcludedJavaSourceRootProvider> excludedRootProviders = JpsServiceManager.
getInstance().getExtensions(ExcludedJavaSourceRootProvider.class);
for (JpsModuleSourceRoot genSourceRoot : genSourceRoots) {
boolean excluded = false;
for (ExcludedJavaSourceRootProvider provider : excludedRootProviders) {
if (!(provider instanceof AndroidExcludedJavaSourceRootProvider) &&
provider.isExcludedFromCompilation(module, genSourceRoot)) {
excluded = true;
break;
}
}
final String genRootFilePath = genSourceRoot.getFile().getPath();
if (!excluded) {
result.add(genRootFilePath);
}
}
return result;
}
示例10: getFilteringExcludedExtensions
public Set<String> getFilteringExcludedExtensions() {
if (filteringExclusions.isEmpty()) {
return MavenProjectConfiguration.DEFAULT_FILTERING_EXCLUDED_EXTENSIONS;
}
final Set<String> result = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
result.addAll(MavenProjectConfiguration.DEFAULT_FILTERING_EXCLUDED_EXTENSIONS);
result.addAll(filteringExclusions);
return Collections.unmodifiableSet(result);
}
示例11: deleteOutdatedFiles
private static void deleteOutdatedFiles(MultiMap<String, String> filesToDelete, CompileContext context,
SourceToOutputMapping srcOutMapping,
ArtifactOutputToSourceMapping outSrcMapping) throws IOException {
if (filesToDelete.isEmpty()) return;
context.processMessage(new ProgressMessage("Deleting outdated files..."));
int notDeletedFilesCount = 0;
final THashSet<String> notDeletedPaths = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
final THashSet<String> deletedPaths = new THashSet<String>(FileUtil.PATH_HASHING_STRATEGY);
for (String filePath : filesToDelete.keySet()) {
if (notDeletedPaths.contains(filePath)) {
continue;
}
boolean deleted = deletedPaths.contains(filePath);
if (!deleted) {
deleted = FileUtil.delete(new File(filePath));
}
if (deleted) {
if (LOG.isDebugEnabled()) {
LOG.debug("Outdated output file deleted: " + filePath);
}
outSrcMapping.remove(filePath);
deletedPaths.add(filePath);
for (String sourcePath : filesToDelete.get(filePath)) {
srcOutMapping.removeOutput(sourcePath, filePath);
}
}
else {
notDeletedPaths.add(filePath);
if (notDeletedFilesCount++ > 50) {
context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.WARNING, "Deletion of outdated files stopped because too many files cannot be deleted"));
break;
}
context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.WARNING, "Cannot delete file '" + filePath + "'"));
}
}
ProjectBuilderLogger logger = context.getLoggingManager().getProjectBuilderLogger();
if (logger.isEnabled()) {
logger.logDeletedFiles(deletedPaths);
}
}