Package jetbrains.communicator.core.vfs

Examples of jetbrains.communicator.core.vfs.VFile


    testCase.markLastListenerForCleanup();

    log[0] = "";

    CodePointer pointer = new CodePointer(0, 1);
    VFile file = VFile.create("path");

    self.sendCodeIntervalPointer(file, pointer, "comment���< && 53", testCase.getBroadcaster());

    new WaitFor(2000) {
      @Override
View Full Code Here


        0, selfStatus.getProjects().length);
  }


  public void testGetFileContent_Success() throws Exception {
    VFile vFile = VFile.create("a path");
    myUserModel.addUser(mySelf);
    mySelf.setCanAccessMyFiles(true, myUserModel);

    myIdeFacade.setReturnedFileText(vFile, "some tex&&&<<>t" + '\u0000');

    String text = mySelf.getVFile(vFile, myIdeFacade);

    assertEquals("Should successfully return file text", "some tex&&&<<>t" + '\u0000', text );
    assertEquals("Should put result to vFile", "some tex&&&<<>t" + '\u0000', vFile.getContents());
  }
View Full Code Here

    assertEquals("Should successfully return file text", "some tex&&&<<>t" + '\u0000', text );
    assertEquals("Should put result to vFile", "some tex&&&<<>t" + '\u0000', vFile.getContents());
  }

  public void testGetFileContent_BigFile() throws Exception {
    VFile vFile = VFile.create("a path");
    myUserModel.addUser(mySelf);
    mySelf.setCanAccessMyFiles(true, myUserModel);

    char buf [] = new char[100000];
    Arrays.fill(buf, 'd');
    myIdeFacade.setReturnedFileText(vFile, new String(buf));

    WatchDog s = new WatchDog("get 100000 bytes file");
    mySelf.getVFile(vFile, myIdeFacade);
    s.stop();

    assertEquals("Should successfully return file text", new String(buf), vFile.getContents() );
  }
View Full Code Here

    assertEquals("Should successfully return file text", new String(buf), vFile.getContents() );
  }

  public void testGetFileContent_NoRights() throws Exception {
    VFile vFile = VFile.create("a path");
    myUserModel.addUser(mySelf);
    myIdeFacade.setReturnedFileText(vFile, "some text");
    myIdeFacade.setReturnedAnswer(false);

    mySelf.setCanAccessMyFiles(false, myUserModel);
    String text = mySelf.getVFile(vFile, myIdeFacade);

    assertNull("Should not return file text", text);
    assertNull("Should not put result to vFile", vFile.getContents());
  }
View Full Code Here

    assertNull("Should not return file text", text);
    assertNull("Should not put result to vFile", vFile.getContents());
  }

  public void testGetFileContent_NoRights_AllowedByUser() throws Exception {
    VFile vFile = VFile.create("a path");
    myUserModel.addUser(mySelf);
    myIdeFacade.setReturnedFileText(vFile, "some text");
    myIdeFacade.setReturnedAnswer(true);

    mySelf.setCanAccessMyFiles(false, myUserModel);
View Full Code Here

    assertEquals("Should successfully return file text", "some text", text );
  }

  public void testGetFileContent_NoSuchFile() throws Exception {
    VFile vFile = VFile.create("a path");

    String text = mySelf.getVFile(vFile, myIdeFacade);

    assertNull("No file - no text", text);
  }
View Full Code Here

    if (command != null && editor != null && container != null) {

      VirtualFile file = FileDocumentManager.getInstance().getFile(editor.getDocument());
      if (file != null) {
        VFile vFile = VFSUtil.createFileFrom(file, editor.getProject());
        if (vFile == null) {
          return;
        }

        command.setVFile(vFile);
View Full Code Here

  protected String getActionDescription(User user, VirtualFile file) {
    return StringUtil.getMsg("code_pointer.description", user.getDisplayName());
  }

  protected void doActionCommand(final User user, final VirtualFile file, final Editor editor) {
    VFile vFile = VFSUtil.createFileFrom(file, editor.getProject());
    if (vFile == null) {
      LOG.info("Unable to send code pointer for " + file);
      return;
    }
View Full Code Here

  protected String getActionDescription(User user, VirtualFile file) {
    return StringUtil.getMsg("show.diff.description", file.getPresentableName(), user.getDisplayName());
  }

  protected void doActionCommand(final User user, final VirtualFile file, final Editor editor) {
    VFile vFile = VFSUtil.createFileFrom(file, editor.getProject());
    if (vFile == null) {
      LOG.info("Unable to get file " + file);
      return;
    }
View Full Code Here

  public String getTagName() {
    return GetVFileContentsXmlMessage.TAG;
  }

  protected void doProcess(Element request, Element response) {
    VFile from = VFile.createFrom(request);
    myIdeFacade.fillFileContents(from);
    from.saveTo(response);
  }
View Full Code Here

TOP

Related Classes of jetbrains.communicator.core.vfs.VFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.