-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #478 from AuScope/AUS-4238
AUS 4238: Remove unused APIs
- Loading branch information
Showing
43 changed files
with
36 additions
and
4,668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,9 @@ | |
import java.text.SimpleDateFormat; | ||
import java.util.ArrayList; | ||
import java.util.Date; | ||
import java.util.Enumeration; | ||
import java.util.concurrent.ExecutorService; | ||
import java.util.concurrent.Executors; | ||
import java.util.zip.ZipEntry; | ||
import java.util.zip.ZipFile; | ||
import java.util.zip.ZipOutputStream; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
@@ -85,69 +83,6 @@ public DownloadController(HttpServiceCaller serviceCaller, ServiceConfiguration | |
this.serviceConfiguration = serviceConfiguration; | ||
} | ||
|
||
@RequestMapping("/getGmlDownload.do") | ||
public void getGmlDownload( | ||
@RequestParam("email") final String email, | ||
HttpServletResponse response) throws Exception { | ||
DownloadTracker downloadTracker = DownloadTracker.getTracker(email); | ||
Progression progress = downloadTracker.getProgress(); | ||
if (progress == Progression.COMPLETED) { | ||
response.setContentType("application/zip"); | ||
|
||
boolean csvSign = false; | ||
ZipFile downloadZip = null; | ||
try { | ||
downloadZip = new ZipFile(downloadTracker.getFileHandle().getAbsolutePath()); | ||
Enumeration<? extends ZipEntry> zipEntries = downloadZip.entries(); | ||
while (zipEntries.hasMoreElements()) { | ||
String fileName = ((ZipEntry) zipEntries.nextElement()).getName(); | ||
if (fileName.contains("csv")) | ||
{ | ||
csvSign = true; | ||
break; | ||
} | ||
} | ||
} finally { | ||
if (downloadZip != null) { | ||
downloadZip.close(); | ||
} | ||
} | ||
if (csvSign == false) | ||
response.setHeader("Content-Disposition", | ||
"inline; filename=GMLDownload.zip;"); | ||
else | ||
response.setHeader("Content-Disposition", | ||
"inline; filename=CSVDownload.zip;"); | ||
FileIOUtil.writeInputToOutputStream(downloadTracker.getFile(), response.getOutputStream(), 1024, true); | ||
} | ||
|
||
} | ||
|
||
@RequestMapping("/checkGMLDownloadStatus.do") | ||
public void checkGMLDownloadStatus( | ||
@RequestParam("email") final String email, | ||
HttpServletResponse response, | ||
HttpServletRequest request) throws Exception { | ||
|
||
DownloadTracker downloadTracker = DownloadTracker.getTracker(email); | ||
Progression progress = downloadTracker.getProgress(); | ||
String htmlResponse = ""; | ||
response.setContentType("text/html"); | ||
|
||
if (progress == Progression.INPROGRESS) { | ||
htmlResponse = "<html><p>Download currently still in progress</p></html>"; | ||
} else if (progress == Progression.NOT_STARTED) { | ||
htmlResponse = "<html><p>No download request found..</p></html>"; | ||
} else if (progress == Progression.COMPLETED) { | ||
htmlResponse = "<html><p>Your download has successfully completed.</p><p><a href='getGmlDownload.do?email=" | ||
+ email + "'>Click on this link to download</a></p></html>"; | ||
} else { | ||
htmlResponse = "<html><p>A serious error has occurred, please contact our Administrator on [email protected]</p></html>"; | ||
} | ||
|
||
response.getOutputStream().write(htmlResponse.getBytes()); | ||
} | ||
|
||
/** | ||
* Given a list of URls, this function will collate the responses into a zip file and send the response back to the browser. if no email is provided, a zip | ||
* is written to the response output If email address is provided, a html response is returned to the user informing his request has been processed and to | ||
|
50 changes: 0 additions & 50 deletions
50
src/main/java/org/auscope/portal/core/server/controllers/NamespaceController.java
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
src/main/java/org/auscope/portal/core/server/controllers/ServiceConfigurationController.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.