Examples of IFileSystem


Examples of org.eclipse.core.filesystem.IFileSystem

    }
    return locationInFileSystem(path);
  }

  private String locationInFileSystem(IPath path) {
    IFileSystem fileSystem = EFS.getLocalFileSystem();
    IFileInfo fileInfo = fileSystem.getStore(path).fetchInfo();
    if (!fileInfo.isDirectory()) {
      return null;
    }
    return value;
  }
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileSystem

        tempDir.mkdirs();
        if (tempFile == null) {
          tempFile = File.createTempFile("camelContext-", ".xml", tempDir);
        }
        // lets create the IFile from it...
        IFileSystem fileSystem = EFS.getLocalFileSystem();
        IFileStore fileStore = fileSystem.fromLocalFile(tempFile);

        String xml = contextNode.getXmlString();
        IOUtils.writeText(tempFile, xml);

        return new CamelFileStoreEditorInput(fileStore, contextNode);
View Full Code Here

Examples of org.eclipse.core.filesystem.IFileSystem

       
        // now create the file which will hold the camel context
        tempFile = new File(tempDir, fileUnderDebug.substring(fileUnderDebug.lastIndexOf(File.separatorChar)+1));
       
        // lets create the IFile from it...
        IFileSystem fileSystem = EFS.getLocalFileSystem();
        IFileStore fileStore = fileSystem.fromLocalFile(tempFile);

        // retrieve the contents from the debugger
        String xml = debugger.getContextXmlDump();
        // and write the contents to the file
        if (xml != null) IOUtils.writeText(tempFile, xml);
View Full Code Here

Examples of org.jcoredb.fs.IFileSystem

 
  @Override
  public void create() {

   
    IFileSystem fs = FileSystemRegistry.get(new FileSystemRegKey(Constants.HOST, Configs.getFSConfig().getRootDir()));
   
    BlockId blockId = new BlockId(containerId, segmentId, id);
   
    try
    {
      Block block = fs.read(blockId);
     
      JSONNode root = JSONHelper.createSuccessNode();
      JSONAttribute containerId = new JSONAttribute("containerId", ""+blockId.getContainerId(), AttrType.Number);
      JSONAttribute segmentId = new JSONAttribute("segmentId", ""+blockId.getSegmentId(), AttrType.Number);
      JSONAttribute id = new JSONAttribute("blockId", ""+blockId.getId(), AttrType.Number);
View Full Code Here

Examples of org.jcoredb.fs.IFileSystem

  }

  @Override
  public void create() {
 
    IFileSystem fs = FileSystemRegistry.get(new FileSystemRegKey(Constants.HOST, Configs.getFSConfig().getRootDir()));
   
    IContainer[] cs = fs.getContainers();
       
    JSONNode root = new JSONNode();
   
    JSONAttribute path = new JSONAttribute("path", fs.getPath(), AttrType.String);
   
    root.add(path);
   
    JSONArray childs = new JSONArray("containers");
   
View Full Code Here

Examples of org.jcoredb.fs.IFileSystem

  }
 
  @Test
  public void appendSingleThreadedTest() throws Exception
  {
    IFileSystem fs = new FileSystem(Constants.ROOT_PATH);
    fs.create(0);
    fs.open();
   
    Block[] blocks = new Block[NUM_OF_BLOCKS_TO_APPEND];
   
    String testStr = "<test> <content> Hello world! </content> </test>";
    byte[] content = testStr.getBytes();
   
    for (int i = 0; i < NUM_OF_BLOCKS_TO_APPEND; i++) {

      Block b = new Block(new BlockId(0));
      b.setBytes(content);     
      blocks[i] = b;
    }

    long startMs = System.currentTimeMillis();
   
    fs.append(blocks, false);
       
    long endMs = System.currentTimeMillis();
   
    System.out.println(endMs - startMs + "ms");
     
View Full Code Here

Examples of org.jcoredb.fs.IFileSystem

 
  @Test
  public void appendMultiThreadedTest() throws Exception
  {
   
    IFileSystem fs = new MultiThreadedFileSystem(Constants.ROOT_PATH);
    fs.create(0);
    fs.open();
   
    Block[] blocks = new Block[NUM_OF_BLOCKS_TO_APPEND];
   
    String testStr = "<test> <content> Hello world! </content> </test>";
    byte[] content = testStr.getBytes();
   
    for (int i = 0; i < NUM_OF_BLOCKS_TO_APPEND; i++) {

      Block b = new Block(new BlockId(0));
      b.setBytes(content);     
      blocks[i] = b;
    }

    long startMs = System.currentTimeMillis();
   
    fs.append(blocks, false);
       
    long endMs = System.currentTimeMillis();
   
    System.out.println(endMs - startMs + "ms");
     
View Full Code Here

Examples of org.jcoredb.fs.IFileSystem

  }

  @Override
  public void create() {
 
    IFileSystem fs = FileSystemRegistry.get(new FileSystemRegKey(Constants.HOST, Configs.getFSConfig().getRootDir()));
   
    try
    {
      fs.drop(id);
     
      out.println(JSONHelper.createSuccessNode());     
    }
    catch (Exception e)
    {
View Full Code Here

Examples of org.jcoredb.fs.IFileSystem

   *
   */
  @Override
  public void create() {
   
    IFileSystem fs = FileSystemRegistry.get(new FileSystemRegKey(Constants.HOST, Configs.getFSConfig().getRootDir()));
    IContainer c = fs.getContainer(id);
   
    if (c!=null)
    {
   
      JSONNode root = JSONHelper.createSuccessNode();
View Full Code Here

Examples of org.jcoredb.fs.IFileSystem

  }

  @Test
  public void appendTest() throws Exception {
 
    IFileSystem fs = new FileSystem(Constants.ROOT_PATH);
    fs.create(0);
    fs.open();
   
    Block b = new Block(new BlockId(0));
    byte[] content = "<test> <content> Hello world! </content> </test>".getBytes();
    b.setBytes(content);
   
    Block b2 = new Block(new BlockId(0));
    b.setBytes(content);
   
    BlockId bid = fs.append(b, false);
    BlockId bid2 = fs.append(b2, false);
   
    assertEquals(0, bid.getContainerId());
    assertEquals(0, bid.getSegmentId());
    assertEquals(0, bid.getId());
   
    assertEquals(0, bid2.getContainerId());
    assertEquals(0, bid2.getSegmentId());
    assertEquals(1, bid2.getId());
       
    fs.close();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.