wayang-commons/wayang-utils-profile-db/src/main/java/org/apache/wayang/commons/util/profiledb/storage/FileStorage.java [32:105]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super(uri);
        this.file = new File(uri);
    }

    /**
     * To change target URI during execution
     *
     * @param uri determines new URI where {@link Experiment}s will be persisted
     */
    @Override
    public void changeLocation(URI uri){

        super.changeLocation(uri);
        this.file = new File(uri);
    }

    /**
     * Write {@link Experiment}s to a {@link File}. Existing file contents will be overwritten.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void save(Collection<Experiment> experiments) throws IOException {
        this.file.getAbsoluteFile().getParentFile().mkdirs();
        try (FileOutputStream fos = new FileOutputStream(this.file, false)) {
            this.save(experiments, fos);
        }
    }

    /**
     * Write {@link Experiment}s to a {@link File}. Existing file contents will be overwritten.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void save(Experiment... experiments) throws IOException {
        this.save(Arrays.asList(experiments));
    }

    /**
     * Load {@link Experiment}s from a {@link File}.
     *
     * @return the {@link Experiment}s
     */
    @Override
    public Collection<Experiment> load() throws IOException {
        return load(new FileInputStream(this.file));
    }

    /**
     * Append {@link Experiment}s to a {@link File}. Existing file contents will be preserved.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void append(Collection<Experiment> experiments) throws IOException {
        this.file.getAbsoluteFile().getParentFile().mkdirs();
        try (FileOutputStream fos = new FileOutputStream(this.file, true)) {
            this.save(experiments, fos);
        }
    }

    /**
     * Append {@link Experiment}s to a {@link File}. Existing file contents will be preserved.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void append(Experiment... experiments) throws IOException {
        this.append(Arrays.asList(experiments));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



wayang-commons/wayang-utils-profile-db/src/main/java/org/apache/wayang/commons/util/profiledb/storage/JDBCStorage.java [28:96]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super(uri);
        this.file = new File(uri);
    }

    @Override
    public void changeLocation(URI uri){

        super.changeLocation(uri);
        this.file = new File(uri);
    }

    /**
     * Write {@link Experiment}s to a {@link File}. Existing file contents will be overwritten.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void save(Collection<Experiment> experiments) throws IOException {
        this.file.getAbsoluteFile().getParentFile().mkdirs();
        try (FileOutputStream fos = new FileOutputStream(this.file, false)) {
            this.save(experiments, fos);
        }
    }

    /**
     * Write {@link Experiment}s to a {@link File}. Existing file contents will be overwritten.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void save(Experiment... experiments) throws IOException {
        this.save(Arrays.asList(experiments));
    }

    /**
     * Load {@link Experiment}s from a {@link File}.
     *
     * @return the {@link Experiment}s
     */
    @Override
    public Collection<Experiment> load() throws IOException {
        return load(new FileInputStream(this.file));
    }

    /**
     * Append {@link Experiment}s to a {@link File}. Existing file contents will be preserved.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void append(Collection<Experiment> experiments) throws IOException {
        this.file.getAbsoluteFile().getParentFile().mkdirs();
        try (FileOutputStream fos = new FileOutputStream(this.file, true)) {
            this.save(experiments, fos);
        }
    }

    /**
     * Append {@link Experiment}s to a {@link File}. Existing file contents will be preserved.
     *
     * @param experiments the {@link Experiment}s
     * @throws IOException if the writing fails
     */
    @Override
    public void append(Experiment... experiments) throws IOException {
        this.append(Arrays.asList(experiments));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



