flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [3/9] flink git commit: [FLINK-5598] [web frontend] Return filename after jar upload
Date Thu, 09 Mar 2017 12:02:28 GMT
[FLINK-5598] [web frontend] Return filename after jar upload

This closes #3469


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/84afd068
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/84afd068
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/84afd068

Branch: refs/heads/master
Commit: 84afd068ac229e4d598fffdf10075e9d356fbe07
Parents: 59f0f7a
Author: Fabian Wollert <darkwolli32@gmail.com>
Authored: Fri Mar 3 17:40:02 2017 +0100
Committer: Stephan Ewen <sewen@apache.org>
Committed: Thu Mar 9 13:00:55 2017 +0100

----------------------------------------------------------------------
 .../flink/runtime/webmonitor/handlers/JarUploadHandler.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/84afd068/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHandler.java
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHandler.java
b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHandler.java
index 3d7cb8a..ec8516d 100644
--- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHandler.java
+++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarUploadHandler.java
@@ -59,10 +59,11 @@ public class JarUploadHandler extends AbstractJsonRequestHandler {
 				return "{\"error\": \"Only Jar files are allowed.\"}";
 			}
 			
-			File newFile = new File(jarDir, UUID.randomUUID() + "_" + filename);
+			String filenameWithUUID = UUID.randomUUID() + "_" + filename;
+			File newFile = new File(jarDir, filenameWithUUID);
 			if (tempFile.renameTo(newFile)) {
 				// all went well
-				return "{}";
+				return "{\"status\": \"success\", \"filename\": \"" + filenameWithUUID + "\"}";
 			}
 			else {
 				//noinspection ResultOfMethodCallIgnored


Mime
View raw message