org.jboss.shrinkwrap.api.Archive.move()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.jboss.shrinkwrap.api.Archive.move()方法的一些代码示例,展示了Archive.move()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Archive.move()方法的具体详情如下:
包路径:org.jboss.shrinkwrap.api.Archive
类名称:Archive
方法名:move

Archive.move介绍

[英]Moves the asset under the source path to the target path.
[中]将源路径下的资源移动到目标路径。

代码示例

代码示例来源:origin: wildfly/wildfly-arquillian

@Override
public T move(final ArchivePath source, final ArchivePath target) throws IllegalArgumentException, IllegalArchivePathException {
  return delegate.move(source, target);
}

代码示例来源:origin: wildfly/wildfly-arquillian

@Override
public T move(final String source, final String target) throws IllegalArgumentException, IllegalArchivePathException {
  return delegate.move(source, target);
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

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

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-base

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

代码示例来源:origin: shrinkwrap/shrinkwrap

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

代码示例来源:origin: shrinkwrap/shrinkwrap

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

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test(expected = IllegalArchivePathException.class)
public void shouldNotMoveAssetBecauseOfInexistentPath() {
  final Archive<JavaArchive> archive = ShrinkWrap.create(JavaArchive.class, "archive.jar");
  final String sourcePath = "non-existent-path1";
  final String targetPath = "path2";
  archive.move(sourcePath, targetPath);
}

代码示例来源:origin: org.jboss.shrinkwrap/shrinkwrap-impl-nio2

archive.move(source.toString(), target.toString());

代码示例来源:origin: shrinkwrap/shrinkwrap

archive.move(source.toString(), target.toString());

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
public void shouldMoveDirectory() {
  final Archive<JavaArchive> archive = ShrinkWrap.create(JavaArchive.class, "archive.jar");
  final String sourcePath = "path1";
  final String targetPath = "path2";
  archive.addAsDirectory(sourcePath);
  archive.move(sourcePath, targetPath);
  Assert.assertTrue("Directory should be at the new path", archive.get(targetPath).getAsset() == null);
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
public void shouldMoveAsset() {
  final Archive<JavaArchive> archive = ShrinkWrap.create(JavaArchive.class, "archive.jar");
  final String sourcePath = "path1";
  final String targetPath = "path2";
  archive.add(EmptyAsset.INSTANCE, sourcePath);
  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));
}

代码示例来源:origin: shrinkwrap/shrinkwrap

@Test
public void shouldMoveNotEmptyDirectory() {
  final Archive<JavaArchive> archive = ShrinkWrap.create(JavaArchive.class, "archive.jar");
  final String sourcePath = "path1";
  final String targetPath = "path2";
  final String childDirName = "childDir";
  final String childDirPath = sourcePath + "/" + childDirName;
  final String childDirTargetPath = targetPath + "/" + childDirName;
  final String childFileName = "file1";
  final String childFilePath = childDirPath + "/" + childFileName;
  final String childFileTargetPath = childDirTargetPath + "/" + childFileName;
  archive.addAsDirectory(sourcePath);
  archive.addAsDirectory(childDirName);
  archive.add(EmptyAsset.INSTANCE, childFilePath);
  archive.move(sourcePath, targetPath);
  Assert.assertTrue("Directory should be at the new path", archive.get(targetPath).getAsset() == null);
  Assert.assertTrue("Child dir should be at the new path", archive.get(childDirTargetPath).getAsset() == null);
  Assert.assertTrue("Child asset should be at the new path", archive.get(childFileTargetPath).getAsset() != null);
}

相关文章