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

com.sixestates.utils.FileStoreUtils Maven / Gradle / Ivy

Go to download

A Java SDK for communicating with the 6Estates Intelligent Document Processing(IDP) Platform

There is a newer version: 8.2.3
Show newest version
package com.sixestates.utils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;

public class FileStoreUtils {
    public static void localFileSystemStore(String path, String fileName, byte[] fileBytes) {
        Date d1 = new Date();
        File file = new File(path + fileName);
        System.out.println("write file: " + fileName );
        if (file.exists()) {
            file.delete();
        }
        try {
            file.createNewFile();
            FileOutputStream fileOutputStream = null;
            fileOutputStream = new FileOutputStream(file);
            fileOutputStream.write(fileBytes);
            fileOutputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy