Skip to content

Commit 2d4c703

Browse files
gnodetplamentotev
authored andcommitted
Fix link destination, fixes #89
1 parent 3edad29 commit 2d4c703

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoSymlinkResource.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private PlexusIoSymlinkResource( @Nonnull File symlinkfile, String name, @Nonnul
5050
public String getSymlinkDestination()
5151
throws IOException
5252
{
53-
return targetResource.getName();
53+
return symLinkDestination;
5454
}
5555

5656
public PlexusIoResource getTarget()

src/test/java/org/codehaus/plexus/components/io/resources/PlexusIoPlexusIoFileResourceTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributes;
88

99
import org.codehaus.plexus.components.io.attributes.SymlinkUtils;
10+
import org.codehaus.plexus.components.io.functions.SymlinkDestinationSupplier;
1011
import org.codehaus.plexus.util.Os;
1112
import org.junit.Test;
1213

@@ -31,6 +32,8 @@ public void testRealSymlink()
3132
assertTrue( r.isDirectory() );
3233
final File target = SymlinkUtils.readSymbolicLink( file );
3334
assertTrue( target.getName().endsWith( "targetDir" ) );
35+
assertTrue( r instanceof SymlinkDestinationSupplier );
36+
assertEquals( "targetDir/", ( ( SymlinkDestinationSupplier ) r ).getSymlinkDestination() );
3437
}
3538

3639
@Test

0 commit comments

Comments
 (0)