本文整理汇总了Java中com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess.disallowRootAccess方法的典型用法代码示例。如果您正苦于以下问题:Java VfsRootAccess.disallowRootAccess方法的具体用法?Java VfsRootAccess.disallowRootAccess怎么用?Java VfsRootAccess.disallowRootAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess
的用法示例。
在下文中一共展示了VfsRootAccess.disallowRootAccess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testWindowsHiddenDirectory
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess; //导入方法依赖的package包/类
public void testWindowsHiddenDirectory() throws Exception {
if (!SystemInfo.isWindows) {
System.err.println(getName() + " skipped: " + SystemInfo.OS_NAME);
return;
}
File file = new File("C:\\Documents and Settings\\desktop.ini");
if (!file.exists()) {
System.err.println(getName() + " skipped: missing " + file);
return;
}
String parent = FileUtil.toSystemIndependentName(file.getParent());
VfsRootAccess.allowRootAccess(parent);
try {
VirtualFile virtualFile = myFS.refreshAndFindFileByIoFile(file);
assertNotNull(virtualFile);
NewVirtualFileSystem fs = (NewVirtualFileSystem)virtualFile.getFileSystem();
FileAttributes attributes = fs.getAttributes(virtualFile);
assertNotNull(attributes);
assertEquals(FileAttributes.Type.FILE, attributes.type);
assertEquals(FileAttributes.HIDDEN, attributes.flags);
}
finally {
VfsRootAccess.disallowRootAccess(parent);
}
}
示例2: tearDown
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess; //导入方法依赖的package包/类
@Override
protected void tearDown() throws Exception {
try {
if (myGlobalSettingsFile != null) {
VfsRootAccess.disallowRootAccess(myGlobalSettingsFile.getAbsolutePath());
}
VfsRootAccess.disallowRootAccess(PathManager.getConfigPath());
Messages.setTestDialog(TestDialog.DEFAULT);
removeFromLocalRepository("test");
FileUtil.delete(BuildManager.getInstance().getBuildSystemDirectory());
}
finally {
super.tearDown();
}
}
示例3: testSubst
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess; //导入方法依赖的package包/类
public void testSubst() throws Exception {
if (!SystemInfo.isWindows) {
System.err.println("Ignored: Windows required");
return;
}
File targetDir = createTestDir(myTempDirectory, "top");
File subDir = createTestDir(targetDir, "sub");
File file = createTestFile(subDir, "test.txt");
File rootFile = createSubst(targetDir.getPath());
VfsRootAccess.allowRootAccess(rootFile.getPath());
VirtualFile vfsRoot = myFileSystem.findFileByIoFile(rootFile);
try {
assertNotNull(rootFile.getPath(), vfsRoot);
File substDir = new File(rootFile, subDir.getName());
File substFile = new File(substDir, file.getName());
refresh(targetDir);
refresh(substDir);
LocalFileSystem.WatchRequest request = watch(substDir);
try {
myAccept = true;
FileUtil.writeToFile(file, "new content");
assertEvent(VFileContentChangeEvent.class, substFile.getPath());
LocalFileSystem.WatchRequest request2 = watch(targetDir);
try {
myAccept = true;
FileUtil.delete(file);
assertEvent(VFileDeleteEvent.class, file.getPath(), substFile.getPath());
}
finally {
unwatch(request2);
}
myAccept = true;
FileUtil.writeToFile(file, "re-creation");
assertEvent(VFileCreateEvent.class, substFile.getPath());
}
finally {
unwatch(request);
}
}
finally {
delete(targetDir);
deleteSubst(rootFile.getPath());
if (vfsRoot != null) {
((NewVirtualFile)vfsRoot).markDirty();
myFileSystem.refresh(false);
}
VfsRootAccess.disallowRootAccess(rootFile.getPath());
}
}
示例4: testSubst
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess; //导入方法依赖的package包/类
public void testSubst() throws Exception {
if (!SystemInfo.isWindows) {
System.err.println("Ignored: Windows required");
return;
}
File targetDir = createTestDir("top");
File subDir = createTestDir(targetDir, "sub");
File file = createTestFile(subDir, "test.txt");
File rootFile = createSubst(targetDir.getPath());
VfsRootAccess.allowRootAccess(rootFile.getPath());
VirtualFile vfsRoot = myFileSystem.findFileByIoFile(rootFile);
try {
assertNotNull(rootFile.getPath(), vfsRoot);
File substDir = new File(rootFile, subDir.getName());
File substFile = new File(substDir, file.getName());
refresh(targetDir);
refresh(substDir);
myAcceptedDirectories.add(substDir.getPath());
LocalFileSystem.WatchRequest request = watch(substDir);
try {
myAccept = true;
FileUtil.writeToFile(file, "new content");
assertEvent(VFileContentChangeEvent.class, substFile.getPath());
LocalFileSystem.WatchRequest request2 = watch(targetDir);
try {
myAccept = true;
FileUtil.delete(file);
assertEvent(VFileDeleteEvent.class, file.getPath(), substFile.getPath());
}
finally {
unwatch(request2);
}
myAccept = true;
FileUtil.writeToFile(file, "re-creation");
assertEvent(VFileCreateEvent.class, substFile.getPath());
}
finally {
unwatch(request);
}
}
finally {
delete(targetDir);
deleteSubst(rootFile.getPath());
if (vfsRoot != null) {
((NewVirtualFile)vfsRoot).markDirty();
myFileSystem.refresh(false);
}
VfsRootAccess.disallowRootAccess(rootFile.getPath());
}
}