Java 类com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl 实例源码

项目:intellij-ce-playground    文件:VirtualDirectoryImpl.java   
public void addChild(@NotNull VirtualFileSystemEntry child) {
  final String childName = child.getName();
  final boolean ignoreCase = !getFileSystem().isCaseSensitive();
  synchronized (myData) {
    int indexInReal = findIndex(myData.myChildrenIds, childName, ignoreCase);

    myData.removeAdoptedName(childName);
    if (indexInReal < 0) {
      insertChildAt(child, indexInReal);
      ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
    }
    // else already stored
    assertConsistency(ignoreCase, child);
  }
}
项目:intellij-ce-playground    文件:VirtualFileSystemEntry.java   
public void setNewName(@NotNull String newName) {
  if (!isValidName(newName)) {
    throw new IllegalArgumentException(VfsBundle.message("file.invalid.name.error", newName));
  }

  VirtualDirectoryImpl parent = getParent();
  parent.removeChild(this);
  mySegment.setNameId(myId, FileNameCache.storeName(newName));
  ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
  parent.addChild(this);
}
项目:intellij-ce-playground    文件:LocalFileSystemTest.java   
public void testFileLength() throws Exception {
  File file = FileUtil.createTempFile("test", "txt");
  FileUtil.writeToFile(file, "hello");
  VirtualFile virtualFile = myFS.refreshAndFindFileByIoFile(file);
  assertNotNull(virtualFile);
  String s = VfsUtilCore.loadText(virtualFile);
  assertEquals("hello", s);
  assertEquals(5, virtualFile.getLength());

  FileUtil.writeToFile(file, "new content");
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
  s = VfsUtilCore.loadText(virtualFile);
  assertEquals("new content", s);
  assertEquals(11, virtualFile.getLength());
}
项目:tools-idea    文件:LocalFileSystemTest.java   
public void testFileLength() throws Exception {
  File file = FileUtil.createTempFile("test", "txt");
  FileUtil.writeToFile(file, "hello");
  VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file);
  assertNotNull(virtualFile);
  String s = VfsUtilCore.loadText(virtualFile);
  assertEquals("hello", s);
  assertEquals(5, virtualFile.getLength());

  FileUtil.writeToFile(file, "new content");
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
  s = VfsUtilCore.loadText(virtualFile);
  assertEquals("new content", s);
  assertEquals(11, virtualFile.getLength());
}
项目:consulo    文件:LocalFileSystemTest.java   
public void testFileLength() throws Exception {
  File file = FileUtil.createTempFile("test", "txt");
  FileUtil.writeToFile(file, "hello");
  VirtualFile virtualFile = myFS.refreshAndFindFileByIoFile(file);
  assertNotNull(virtualFile);
  String s = VfsUtilCore.loadText(virtualFile);
  assertEquals("hello", s);
  assertEquals(5, virtualFile.getLength());

  FileUtil.writeToFile(file, "new content");
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
  s = VfsUtilCore.loadText(virtualFile);
  assertEquals("new content", s);
  assertEquals(11, virtualFile.getLength());
}
项目:consulo    文件:VirtualDirectoryImpl.java   
public void addChild(@Nonnull VirtualFileSystemEntry child) {
  final String childName = child.getName();
  final boolean ignoreCase = !getFileSystem().isCaseSensitive();
  synchronized (myData) {
    int indexInReal = findIndex(myData.myChildrenIds, childName, ignoreCase);

    myData.removeAdoptedName(childName);
    if (indexInReal < 0) {
      insertChildAt(child, indexInReal);
      ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
    }
    // else already stored
    assertConsistency(ignoreCase, child);
  }
}
项目:consulo    文件:VirtualFileSystemEntry.java   
public void setNewName(@Nonnull String newName) {
  if (!getFileSystem().isValidName(newName)) {
    throw new IllegalArgumentException(VfsBundle.message("file.invalid.name.error", newName));
  }

  VirtualDirectoryImpl parent = getParent();
  parent.removeChild(this);
  mySegment.setNameId(myId, FileNameCache.storeName(newName));
  ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
  parent.addChild(this);
}
项目:intellij-ce-playground    文件:LightPlatformTestCase.java   
private static void cleanPersistedVFSContent() {
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
}
项目:intellij-ce-playground    文件:PlatformTestCase.java   
private static void cleanPersistedVFSContent() {
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
}
项目:intellij-ce-playground    文件:VirtualDirectoryImpl.java   
private void removeFromArray(int index) {
  myData.myChildrenIds = ArrayUtil.remove(myData.myChildrenIds, index);
  ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
}
项目:tools-idea    文件:LightPlatformTestCase.java   
private static void cleanPersistedVFSContent() {
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
}
项目:tools-idea    文件:PlatformTestCase.java   
private static void cleanPersistedVFSContent() {
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
}
项目:consulo    文件:LightPlatformTestCase.java   
private static void cleanPersistedVFSContent() {
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
}
项目:consulo    文件:PlatformTestCase.java   
private static void cleanPersistedVFSContent() {
  ((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
}
项目:consulo    文件:VirtualDirectoryImpl.java   
private void removeFromArray(int index) {
  myData.myChildrenIds = ArrayUtil.remove(myData.myChildrenIds, index);
  ((PersistentFSImpl)PersistentFS.getInstance()).incStructuralModificationCount();
}