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

com.jeesuite.filesystem.provider.AbstractProvider Maven / Gradle / Ivy

There is a newer version: 1.3.6
Show newest version
/**
 * 
 */
package com.jeesuite.filesystem.provider;

import com.jeesuite.common.http.HttpUtils;
import com.jeesuite.filesystem.FSProvider;

/**
 * @description 
* @author vakin * @date 2017年1月7日 */ public abstract class AbstractProvider implements FSProvider{ private static final String HTTP_PREFIX = "http://"; private static final String HTTPS_PREFIX = "https://"; protected static final String DIR_SPLITER = "/"; protected String urlprefix; protected String bucketName; protected String getFullPath(String file) { if(file.startsWith(HTTP_PREFIX) || file.startsWith(HTTPS_PREFIX)){ return file; } return urlprefix + file; } @Override public String downloadAndSaveAs(String file, String localSaveDir) { return HttpUtils.downloadFile(getDownloadUrl(file), localSaveDir); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy