[
https://issues.apache.org/jira/browse/MASSEMBLY-788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matias Cuturi updated MASSEMBLY-788:
------------------------------------
Description:
Hello Team,
I had a problem when upgrading the Maven Assembly Plugin from 2.5.5 to 2.6. The
problem happens when calling the the function _unzipModuleData_ of the class
_DefaultPlatformManager.java_ (see vertx-platform-2.1.5) with a zip file
created by the Maven Assembly Plugin 2.6. The error message "Failed to create
directory" is thrown. This issue does not happen with v2.5.5.
Example:
Assuming that following module was compressed with v2.6:
module/foo/bar/baz.java --> module.zip
when unziping the file:
{code}
//Pseudo code
String directory = "C:\unzip_directory\";
InputStream is = new BufferedInputStream(new FileInputStream("C:\module.zip");
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(is));
while ((entry = zis.getNextEntry()) != null) {
//Create the directory structure from the zip file
...
...
String entryName = entry.getName();
if (!new File(directory, entryName).mkdir()) {
throw new PlatformManagerException("Failed to create directory");
}
}
{code}
the value of _entryName_ in the first while-iteration is "module/foo/bar/"
instead of being "module/" in the first iteration, "foo/" in the second and
"bar/" in the third one. This causes an error when trying to create the new
file.
This issue is probably only happening in Windows machines.
Regards,
Matias
was:
Hello Team,
I had a problem when upgrading the Maven Assembly Plugin from 2.5.5 to 2.6. The
problem happens when calling the the function _unzipModuleData_ of the class
_DefaultPlatformManager.java_ (see vertx-platform-2.1.5) with a zip file
created by the Maven Assembly Plugin 2.6. The error message "Failed to create
directory" is thrown. This issue does not happen with v2.5.5.
Example:
Assuming that following module was compressed with v2.6:
module/foo/bar/baz.java --> module.zip
when unziping the file:
{code}
//Pseudo code
String directory = "C:\unzip_directory\";
InputStream is = new BufferedInputStream(new FileInputStream("C:\module.zip");
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(is));
while ((entry = zis.getNextEntry()) != null) {
//Create the directory structure from the zip file
...
...
String entryName = entry.getName();
if (!new File(directory, entryName).mkdir()) {
throw new PlatformManagerException("Failed to create directory");
}
}
{code}
the value of zis.getNextEntry() in the first while-iteration is
"module/foo/bar" instead of being "module/" in the first iteration, "foo/" in
the second and "bar/" in the third one. This causes an error when trying to
create the new file.
This issue is probably only happening in Windows machines.
Regards,
Matias
> Entry names in ZIP file are not correctly parsed when unzipping it
> ------------------------------------------------------------------
>
> Key: MASSEMBLY-788
> URL: https://issues.apache.org/jira/browse/MASSEMBLY-788
> Project: Maven Assembly Plugin
> Issue Type: Bug
> Affects Versions: 2.6
> Environment: Windows 7 Professional, JDK 1.8.0_25, maven 3.2.5,
> vertx-platform-2.1.5
> Reporter: Matias Cuturi
>
> Hello Team,
> I had a problem when upgrading the Maven Assembly Plugin from 2.5.5 to 2.6.
> The problem happens when calling the the function _unzipModuleData_ of the
> class _DefaultPlatformManager.java_ (see vertx-platform-2.1.5) with a zip
> file created by the Maven Assembly Plugin 2.6. The error message "Failed to
> create directory" is thrown. This issue does not happen with v2.5.5.
> Example:
> Assuming that following module was compressed with v2.6:
> module/foo/bar/baz.java --> module.zip
> when unziping the file:
> {code}
> //Pseudo code
> String directory = "C:\unzip_directory\";
> InputStream is = new BufferedInputStream(new FileInputStream("C:\module.zip");
> ZipInputStream zis = new ZipInputStream(new BufferedInputStream(is));
> while ((entry = zis.getNextEntry()) != null) {
> //Create the directory structure from the zip file
> ...
> ...
> String entryName = entry.getName();
> if (!new File(directory, entryName).mkdir()) {
> throw new PlatformManagerException("Failed to create directory");
> }
> }
> {code}
> the value of _entryName_ in the first while-iteration is "module/foo/bar/"
> instead of being "module/" in the first iteration, "foo/" in the second and
> "bar/" in the third one. This causes an error when trying to create the new
> file.
> This issue is probably only happening in Windows machines.
> Regards,
> Matias
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)