Skip to content

Commit

Permalink
[SHRINKWRAP-381] Rename Archive.mv to "move" for API consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ALRubinger committed Apr 3, 2012
1 parent 426be7a commit 78ea66e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/org/jboss/shrinkwrap/api/Archive.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> expo
* @throws IllegalArchivePathException * @throws IllegalArchivePathException
* If the source path is invalid. * If the source path is invalid.
*/ */
T mv(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException; T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException;


/** /**
* Moves the asset under the source path to the target path. * Moves the asset under the source path to the target path.
Expand All @@ -512,7 +512,7 @@ T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> expo
* @throws IllegalArchivePathException * @throws IllegalArchivePathException
* If the source path is invalid. * If the source path is invalid.
*/ */
T mv(String source, String target) throws IllegalArgumentException, IllegalArchivePathException; T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException;


/** /**
* Acts as a shorthand for {@link Archive#toString(Formatter)} where the {@link Formatters#SIMPLE} is leveraged. * Acts as a shorthand for {@link Archive#toString(Formatter)} where the {@link Formatters#SIMPLE} is leveraged.
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -525,10 +525,10 @@ public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter)
/** /**
* {@inheritDoc} * {@inheritDoc}
* *
* @see org.jboss.shrinkwrap.api.Archive#mv(org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.ArchivePath) * @see org.jboss.shrinkwrap.api.Archive#move(org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.ArchivePath)
*/ */
@Override @Override
public T mv(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException { public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException {
Validate.notNull(source, "The source path was not specified"); Validate.notNull(source, "The source path was not specified");
Validate.notNull(target, "The target path was not specified"); Validate.notNull(target, "The target path was not specified");


Expand All @@ -545,17 +545,17 @@ public T mv(ArchivePath source, ArchivePath target) throws IllegalArgumentExcept
/** /**
* {@inheritDoc} * {@inheritDoc}
* *
* @see org.jboss.shrinkwrap.api.Archive#mv(java.lang.String, java.lang.String) * @see org.jboss.shrinkwrap.api.Archive#move(java.lang.String, java.lang.String)
*/ */
@Override @Override
public T mv(String source, String target) throws IllegalArgumentException, IllegalArchivePathException { public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException {
Validate.notNullOrEmpty(source, "The source path was not specified"); Validate.notNullOrEmpty(source, "The source path was not specified");
Validate.notNullOrEmpty(target, "The target path was not specified"); Validate.notNullOrEmpty(target, "The target path was not specified");


final ArchivePath sourcePath = new BasicPath(source); final ArchivePath sourcePath = new BasicPath(source);
final ArchivePath targetPath = new BasicPath(target); final ArchivePath targetPath = new BasicPath(target);


return mv(sourcePath, targetPath); return move(sourcePath, targetPath);
} }


/** /**
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -300,22 +300,22 @@ public T merge(final Archive<?> source, final String path) throws IllegalArgumen
/** /**
* {@inheritDoc} * {@inheritDoc}
* *
* @see org.jboss.shrinkwrap.api.Archive#mv(org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.ArchivePath) * @see org.jboss.shrinkwrap.api.Archive#move(org.jboss.shrinkwrap.api.ArchivePath, org.jboss.shrinkwrap.api.ArchivePath)
*/ */
@Override @Override
public T mv(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException { public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException {
this.getArchive().mv(source, target); this.getArchive().move(source, target);
return covarientReturn(); return covarientReturn();
} }


/** /**
* {@inheritDoc} * {@inheritDoc}
* *
* @see org.jboss.shrinkwrap.api.Archive#mv(java.lang.String, java.lang.String) * @see org.jboss.shrinkwrap.api.Archive#move(java.lang.String, java.lang.String)
*/ */
@Override @Override
public T mv(String source, String target) throws IllegalArgumentException, IllegalArchivePathException { public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException {
this.getArchive().mv(source, target); this.getArchive().move(source, target);
return covarientReturn(); return covarientReturn();
} }


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ public void shouldMoveAsset() {
final String sourcePath = "path1"; final String sourcePath = "path1";
final String targetPath = "path2"; final String targetPath = "path2";
archive.add(EmptyAsset.INSTANCE, sourcePath); archive.add(EmptyAsset.INSTANCE, sourcePath);
archive.mv(sourcePath, targetPath); archive.move(sourcePath, targetPath);


Assert.assertEquals("The archive should have only one asset", 1, numAssets(archive)); Assert.assertEquals("The archive should have only one asset", 1, numAssets(archive));
Assert.assertNotNull("The asset should be at the target path", archive.get(targetPath)); Assert.assertNotNull("The asset should be at the target path", archive.get(targetPath));
Expand All @@ -1211,7 +1211,7 @@ public void shouldNotMoveAssetBecauseOfInexistentPath() {
final Archive<JavaArchive> archive = ShrinkWrap.create(JavaArchive.class, "archive.jar"); final Archive<JavaArchive> archive = ShrinkWrap.create(JavaArchive.class, "archive.jar");
final String sourcePath = "non-existent-path1"; final String sourcePath = "non-existent-path1";
final String targetPath = "path2"; final String targetPath = "path2";
archive.mv(sourcePath, targetPath); archive.move(sourcePath, targetPath);
} }


// -------------------------------------------------------------------------------------|| // -------------------------------------------------------------------------------------||
Expand Down

0 comments on commit 78ea66e

Please sign in to comment.