|
|
@ -11,6 +11,7 @@ import com.fr.stable.CommonUtils; |
|
|
|
import com.fr.stable.EncodeConstants; |
|
|
|
import com.fr.stable.EncodeConstants; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
import com.fr.third.jodd.datetime.JDateTime; |
|
|
|
import com.fr.third.org.apache.http.HttpEntity; |
|
|
|
import com.fr.third.org.apache.http.HttpEntity; |
|
|
|
import com.fr.third.org.apache.http.HttpResponse; |
|
|
|
import com.fr.third.org.apache.http.HttpResponse; |
|
|
|
import com.fr.third.org.apache.http.client.HttpClient; |
|
|
|
import com.fr.third.org.apache.http.client.HttpClient; |
|
|
@ -24,8 +25,6 @@ import java.io.File; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.FileOutputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.UUID; |
|
|
|
import java.util.UUID; |
|
|
@ -106,11 +105,10 @@ public class FileEntityBuilder { |
|
|
|
* @throws IOException |
|
|
|
* @throws IOException |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static void uploadFile(File file, String keyFileName) throws IOException { |
|
|
|
public static void uploadFile(File file, String keyFileName) throws IOException { |
|
|
|
Date today=new Date(); |
|
|
|
String today = new JDateTime().toString("YYYY-MM-DD"); |
|
|
|
SimpleDateFormat f=new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
|
|
HttpClient httpclient = new DefaultHttpClient(); |
|
|
|
HttpClient httpclient = new DefaultHttpClient(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
String signedUrl = generateSignedUploadUrl(FOCUS_POINT_FILE_ROOT_PATH + File.separator + f.format(today) + File.separator +keyFileName); |
|
|
|
String signedUrl = generateSignedUploadUrl(FOCUS_POINT_FILE_ROOT_PATH + File.separator + today + File.separator +keyFileName); |
|
|
|
if(StringUtils.isEmpty(signedUrl)){ |
|
|
|
if(StringUtils.isEmpty(signedUrl)){ |
|
|
|
FineLoggerFactory.getLogger().error("signedUrl is null."); |
|
|
|
FineLoggerFactory.getLogger().error("signedUrl is null."); |
|
|
|
return; |
|
|
|
return; |
|
|
|