Skip to content

Commit

Permalink
Fixes #293 - file watcher not ensuring paths are relative on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
robstryker committed Oct 26, 2023
1 parent 725ceaf commit d2bff5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ protected int fullPublishCopyExplodedModule(DeployableReference ref, int publish
protected int incrementalPublishCopyExplodedModule(DeployableReference opts,
IDeployableDelta delta) throws CoreException {
File dest = getDestinationPath(opts).toFile();
Path src = new File(opts.getPath()).toPath();

List<String> errors = new ArrayList<>();
Map<Path, IDeployableResourceDelta> deltaVals = delta.getResourceDeltaMap();
for( Map.Entry<Path, IDeployableResourceDelta> entry : deltaVals.entrySet()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
******************************************************************************/
package org.jboss.tools.rsp.server.model.internal.publishing;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardWatchEventKinds;
Expand All @@ -24,7 +25,6 @@

public class DeployableDelta implements IDeployableDelta {

private static final int UNKNOWN_KIND = -1;
private DeployableReference reference;
private Map<Path, IDeployableResourceDelta> changes;

Expand Down Expand Up @@ -99,7 +99,7 @@ public void registerChange(FileWatcherEvent event, DeploymentAssemblyFile assemb
Path relativeToSource = mappingSourcePath.relativize(changedFile);

String depPath = matchedMapping.getDeployPath();
depPath = depPath.startsWith("/") ? depPath.substring(1) : depPath;
depPath = depPath.startsWith(File.separator) ? depPath.substring(1) : depPath;
Path mappingDestPath = Paths.get(depPath);
Path relativeToOutput = mappingDestPath.resolve(relativeToSource);
registerChange(event, relativeToOutput);
Expand Down

0 comments on commit d2bff5c

Please sign in to comment.