Maor Lipchuk has posted comments on this change.

Change subject: core: Adding support for TarInMemoryExport
......................................................................


Patch Set 5:

(5 comments)

http://gerrit.ovirt.org/#/c/29039/5/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archivers/tar/TarInMemoryExport.java
File 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/archivers/tar/TarInMemoryExport.java:

Line 18: 
Line 19:     }
Line 20: 
Line 21:     /**
Line 22:      * extracting tarInputStream files and returns a map with 
fileContent containing file names and data. This function
> /s/a map../map with the file name as the key and the file content as the va
done
Line 23:      * does not support tar with directories.
Line 24:      *
Line 25:      * @return Map with fileContent containing file names and data
Line 26:      * @throws IOException


Line 21:     /**
Line 22:      * extracting tarInputStream files and returns a map with 
fileContent containing file names and data. This function
Line 23:      * does not support tar with directories.
Line 24:      *
Line 25:      * @return Map with fileContent containing file names and data
> /s/with the file names as the keys, and the file content as string value.
done
Line 26:      * @throws IOException
Line 27:      */
Line 28:     public Map<String, String> unTar() throws IOException {
Line 29:         Map<String, String> fileContent = new HashMap<>();


Line 24:      *
Line 25:      * @return Map with fileContent containing file names and data
Line 26:      * @throws IOException
Line 27:      */
Line 28:     public Map<String, String> unTar() throws IOException {
> What should be return here is a Map<String,ByteBuffer> - sorry for not noti
done
Line 29:         Map<String, String> fileContent = new HashMap<>();
Line 30:         TarArchiveEntry tarEntry = null;
Line 31:         tarEntry = tarInputStream.getNextTarEntry();
Line 32:         String fileData;


Line 37:             // Read file from the archive into byte array.
Line 38:             try (InputStream is = new 
FileInputStream(tarEntry.getFile());) {
Line 39:                 is.read(content);
Line 40:                 fileData = new String(content);
Line 41:                 fileContent.put(tarEntry.getName(), fileData);
> * see comment in patch #4, those should be outside the try block
done
Line 42:             }
Line 43:             tarEntry = tarInputStream.getNextTarEntry();
Line 44:         }
Line 45:         


Line 41:                 fileContent.put(tarEntry.getName(), fileData);
Line 42:             }
Line 43:             tarEntry = tarInputStream.getNextTarEntry();
Line 44:         }
Line 45:         
> remove
done
Line 46:         return fileContent;
Line 47:     }
Line 48: 
Line 49:     @Override


-- 
To view, visit http://gerrit.ovirt.org/29039
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie4fbc12337c16baca4be8a82d4a51b8b3ab0af4a
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to