Esempio n. 1
0
  /**
   * @param repositoryManager
   * @param peerName
   * @throws FileNotFoundException
   */
  public FSBlockRepository(FSRepositoryManager repositoryManager, String directoryPath) {
    super(repositoryManager);

    if (directoryPath == null) {
      throw new RuntimeException("DirectoryPath cannot be null");
    }
    this.directoryPath = directoryPath;
    this.usedSpace = getUsedSpace();
    try {
      BitCoopFile dirFile = new BitCoopFile(directoryPath);
      dirFile.mkdirs();
      openIndex();
    } catch (Exception e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
  }
Esempio n. 2
0
 /*junit*/ BitCoopFile getFileForId(long blockId) {
   BitCoopFile parent = new BitCoopFile(getFilePath(blockId));
   parent.mkdirs();
   return new BitCoopFile(parent, "data");
 }