File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
modules/hivemq/src/main/java/org/testcontainers/hivemq Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -146,19 +146,20 @@ private boolean removePrepackagedExtensions() {
146146 }
147147
148148 @ Override
149- public void copyFileToContainer (final @ NotNull MountableFile mountableFile , @ NotNull String containerPath ) {
150- if (!isStarted && removePrepackagedExtensions () && containerPath .startsWith ("/opt/hivemq/extensions/" )) {
151- containerPath = "/opt/hivemq/temp-extensions/" + containerPath .substring ("/opt/hivemq/extensions/" .length ());
152- }
153- super .copyFileToContainer (mountableFile , containerPath );
149+ public void copyFileToContainer (final @ NotNull MountableFile mountableFile , final @ NotNull String containerPath ) {
150+ super .copyFileToContainer (mountableFile , mapContainerPathIfRequired (containerPath ));
154151 }
155152
156153 @ Override
157- public void copyFileToContainer (final @ NotNull Transferable transferable , @ NotNull String containerPath ) {
154+ public void copyFileToContainer (final @ NotNull Transferable transferable , final @ NotNull String containerPath ) {
155+ super .copyFileToContainer (transferable , mapContainerPathIfRequired (containerPath ));
156+ }
157+
158+ private @ NotNull String mapContainerPathIfRequired (final @ NotNull String containerPath ) {
158159 if (!isStarted && removePrepackagedExtensions () && containerPath .startsWith ("/opt/hivemq/extensions/" )) {
159- containerPath = "/opt/hivemq/temp-extensions/" + containerPath .substring ("/opt/hivemq/extensions/" .length ());
160+ return "/opt/hivemq/temp-extensions/" + containerPath .substring ("/opt/hivemq/extensions/" .length ());
160161 }
161- super . copyFileToContainer ( transferable , containerPath ) ;
162+ return containerPath ;
162163 }
163164
164165 protected void containerIsStarted (final @ NotNull InspectContainerResponse containerInfo ) {
You can’t perform that action at this time.
0 commit comments