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

com.mntviews.upload.UploadService Maven / Gradle / Ivy

The newest version!
package com.mntviews.upload;

import com.mntviews.upload.model.ConnectionData;

import java.io.File;

public interface UploadService {
    String FILE_NAME_TEMPLATE = "@filename@";
    String FILE_TAG_TEMPLATE = "@filetag@";
    String FILE_ID_TEMPLATE = "@fileid@";
    String TABLE_NAME_TEMPLATE = "@tablename@";

    default String correctScript(String script, String fileName, String fileTag, String tableName) {
        script = script.replace(FILE_NAME_TEMPLATE, fileName);
        if (fileTag != null)
            script = script.replace(FILE_TAG_TEMPLATE, fileTag);

        if (tableName != null)
            script = script.replace(TABLE_NAME_TEMPLATE, tableName);

        return script;
    }

    void upload(ConnectionData connectionData, File file, String script);

    void uploadFile(ConnectionData connectionData, File file, String script);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy