Example #1
0
 public OSingleFileSegment(
     final OStorageLocal iStorage, final OStorageFileConfiguration iConfig, final String iType)
     throws IOException {
   config = iConfig;
   storage = iStorage;
   file =
       OFileFactory.instance()
           .create(
               iType,
               iStorage.getVariableParser().resolveVariables(iConfig.path),
               iStorage.getMode());
   file.setMaxSize((int) OFileUtils.getSizeAsNumber(iConfig.maxSize));
   file.setIncrementSize((int) OFileUtils.getSizeAsNumber(iConfig.incrementSize));
 }
Example #2
0
  private OFile createNewFile() throws IOException {
    final int num = files.length - 1;

    final OFile file =
        OFileFactory.instance()
            .create(
                type,
                config.getLocation() + "/" + name + "." + num + fileExtension,
                storage.getMode());
    file.setMaxSize(fileMaxSize);
    file.create(fileStartSize);
    files[num] = file;

    addInfoFileConfigEntry(file);

    return file;
  }