diff --git a/bigtop-manager-stack/bigtop-manager-stack-core/src/main/java/org/apache/bigtop/manager/stack/core/tarball/TarballDownloader.java b/bigtop-manager-stack/bigtop-manager-stack-core/src/main/java/org/apache/bigtop/manager/stack/core/tarball/TarballDownloader.java index ace5bae85..188279178 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-core/src/main/java/org/apache/bigtop/manager/stack/core/tarball/TarballDownloader.java +++ b/bigtop-manager-stack/bigtop-manager-stack-core/src/main/java/org/apache/bigtop/manager/stack/core/tarball/TarballDownloader.java @@ -38,18 +38,7 @@ public static Boolean downloadFile(String fileUrl, String saveDir) { int responseCode = httpConn.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { - String fileName = ""; - String disposition = httpConn.getHeaderField("Content-Disposition"); - - if (disposition != null) { - int index = disposition.indexOf("filename="); - if (index > 0) { - fileName = disposition.substring(index + 10, disposition.length() - 1); - } - } else { - fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1); - } - + String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1); InputStream inputStream = httpConn.getInputStream(); String saveFilePath = saveDir + File.separator + fileName;