All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.io.file.FileOutputStreamFactory Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.io.file;

import com.softicar.platform.common.core.exceptions.SofticarIOException;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.nio.file.Path;

/**
 * A static factory for {@link FileOutputStream}.
 *
 * @author Oliver Richers
 */
public class FileOutputStreamFactory {

	public static FileOutputStream create(File file) {

		try {
			return new FileOutputStream(file);
		} catch (FileNotFoundException exception) {
			throw new SofticarIOException(exception);
		}
	}

	public static FileOutputStream create(Path filePath) {

		return create(filePath.toFile());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy