本文整理匯總了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);
}
}