Skip to content

[Bug]: IOException when exporting project to Zip inside ${PROJECT_HOME} #4393

@vdwals

Description

@vdwals

Apache Hop version?

2.9.0

Java version?

21.0.4

Operating system

Windows

What happened?

We face 2 issues when trying to export the current project to zip. This bug is about the second issue.

Steps to reproduce:

  1. Open / Create a project
  2. Click on HOP icon for menu actions
  3. Click 'Export current project to zip'
  4. Chose a valid destination file INSIDE PROJECT_HOME! (In the file selection dialog, the first issue appears. Its not exclusive to this workflow and depends on the current active pipeline/workflow in the view, therefore I'll skip its description here. Sum up: The default file path provided can be invalid.)
  5. Press 'Save' and see error message:
java.lang.reflect.InvocationTargetException: Error zipping project: 

java.io.IOException: Parent directory file:///C:/Users/DennisvanderWals/hop/${PROJECT_HOME} does not exist!
Parent directory file:///C:/Users/DennisvanderWals/hop/${PROJECT_HOME} does not exist!

Parent directory file:///C:/Users/DennisvanderWals/hop/${PROJECT_HOME} does not exist!

	at org.apache.hop.projects.gui.ProjectsGuiPlugin.lambda$menuProjectExport$1(ProjectsGuiPlugin.java:1152)
	at org.apache.hop.ui.core.dialog.ProgressMonitorDialog.lambda$run$2(ProgressMonitorDialog.java:166)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: org.apache.hop.core.exception.HopFileException: 

java.io.IOException: Parent directory file:///C:/Users/DennisvanderWals/hop/${PROJECT_HOME} does not exist!
Parent directory file:///C:/Users/DennisvanderWals/hop/${PROJECT_HOME} does not exist!

Parent directory file:///C:/Users/DennisvanderWals/hop/${PROJECT_HOME} does not exist!

	at org.apache.hop.core.vfs.HopVfs.getOutputStream(HopVfs.java:326)
	at org.apache.hop.projects.gui.ProjectsGuiPlugin.lambda$menuProjectExport$1(ProjectsGuiPlugin.java:1137)
	... 2 more
Caused by: java.io.IOException: Parent directory file:///C:/Users/DennisvanderWals/hop/${PROJECT_HOME} does not exist!
	at org.apache.hop.core.vfs.HopVfs.getOutputStream(HopVfs.java:288)
	at org.apache.hop.core.vfs.HopVfs.getOutputStream(HopVfs.java:324)
	... 3 more

Instead of resolving ${PROJECT_HOME}, a path inside the installation directory of hop containing ${PROJECT_HOME} is tried to be opened.
Zipping is successful at other directories than inside project home.

Issue Priority

Priority: 2

Issue Component

Component: Hop Gui

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions