Permalink
Browse files

[SHRINKWRAP-381] Rename Archive.mv to "move" for API consistency

  • Loading branch information...
1 parent 426be7a commit 78ea66e8a868af2638804c8da39f1345c4428ea4 @ALRubinger committed Feb 9, 2012
@@ -497,7 +497,7 @@ T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> expo
* @throws IllegalArchivePathException
* 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.
@@ -512,7 +512,7 @@ T add(Archive<?> archive, ArchivePath path, Class<? extends StreamExporter> expo
* @throws IllegalArchivePathException
* 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.
@@ -525,10 +525,10 @@ public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter)
/**
* {@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
- 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(target, "The target path was not specified");
@@ -545,17 +545,17 @@ public T mv(ArchivePath source, ArchivePath target) throws IllegalArgumentExcept
/**
* {@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
- 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(target, "The target path was not specified");
final ArchivePath sourcePath = new BasicPath(source);
final ArchivePath targetPath = new BasicPath(target);
- return mv(sourcePath, targetPath);
+ return move(sourcePath, targetPath);
}
/**
@@ -300,22 +300,22 @@ public T merge(final Archive<?> source, final String path) throws IllegalArgumen
/**
* {@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
- public T mv(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException {
- this.getArchive().mv(source, target);
+ public T move(ArchivePath source, ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException {
+ this.getArchive().move(source, target);
return covarientReturn();
}
/**
* {@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
- public T mv(String source, String target) throws IllegalArgumentException, IllegalArchivePathException {
- this.getArchive().mv(source, target);
+ public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException {
+ this.getArchive().move(source, target);
return covarientReturn();
}
@@ -1200,7 +1200,7 @@ public void shouldMoveAsset() {
final String sourcePath = "path1";
final String targetPath = "path2";
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.assertNotNull("The asset should be at the target path", archive.get(targetPath));
@@ -1211,7 +1211,7 @@ public void shouldNotMoveAssetBecauseOfInexistentPath() {
final Archive<JavaArchive> archive = ShrinkWrap.create(JavaArchive.class, "archive.jar");
final String sourcePath = "non-existent-path1";
final String targetPath = "path2";
- archive.mv(sourcePath, targetPath);
+ archive.move(sourcePath, targetPath);
}
// -------------------------------------------------------------------------------------||

0 comments on commit 78ea66e

Please sign in to comment.