You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by pa...@apache.org on 2016/09/13 08:45:33 UTC

ambari git commit: AMBARI-18284. Ambari PigView stores the script in HDFS in non UTF-8 format (Jay SenSharma via pallavkul)

Repository: ambari
Updated Branches:
  refs/heads/trunk 3638a5b42 -> e82d03c8a


AMBARI-18284. Ambari PigView stores the script in HDFS in non UTF-8 format (Jay SenSharma via pallavkul)


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

Branch: refs/heads/trunk
Commit: e82d03c8a66100ec9c2ceb91d4c5a9cc6e427847
Parents: 3638a5b
Author: Pallav Kulshreshtha <pa...@gmail.com>
Authored: Tue Sep 13 14:14:57 2016 +0530
Committer: Pallav Kulshreshtha <pa...@gmail.com>
Committed: Tue Sep 13 14:14:57 2016 +0530

----------------------------------------------------------------------
 .../org/apache/ambari/view/pig/resources/files/FileService.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e82d03c8/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
index 9dea2a2..509b20e 100644
--- a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
+++ b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
@@ -164,7 +164,7 @@ public class FileService extends BaseService {
       filePath = sanitizeFilePath(filePath);
       LOG.info("Rewriting file {}", filePath);
       FSDataOutputStream output = getHdfsApi().create(filePath, true);
-      output.writeBytes(request.file.getFileContent());
+      output.write(request.file.getFileContent().getBytes("UTF-8"));
       output.close();
       return Response.status(204).build();
     } catch (WebApplicationException ex) {
@@ -189,7 +189,7 @@ public class FileService extends BaseService {
       try {
         FSDataOutputStream output = getHdfsApi().create(request.file.getFilePath(), false);
         if (request.file.getFileContent() != null) {
-          output.writeBytes(request.file.getFileContent());
+          output.write(request.file.getFileContent().getBytes("UTF-8"));
         }
         output.close();
       } catch (FileAlreadyExistsException ex) {