implement gzip compression for unbundle command

This commit is contained in:
Sebastian Sdorra
2014-12-01 11:14:19 +01:00
parent 0cd09bf226
commit 34d05ef3a0
7 changed files with 241 additions and 27 deletions

View File

@@ -81,6 +81,17 @@ public class ImportBundleSubCommand extends ImportSubCommand
return name;
}
/**
* Method description
*
*
* @return
*/
public boolean isCompressed()
{
return compressed;
}
//~--- set methods ----------------------------------------------------------
/**
@@ -94,6 +105,17 @@ public class ImportBundleSubCommand extends ImportSubCommand
this.bundle = bundle;
}
/**
* Method description
*
*
* @param compressed
*/
public void setCompressed(boolean compressed)
{
this.compressed = compressed;
}
/**
* Method description
*
@@ -122,9 +144,13 @@ public class ImportBundleSubCommand extends ImportSubCommand
{
ScmClientSession session = createSession();
Repository repository = session.getRepositoryHandler().importFromBundle(
new ImportBundleRequest(
getType(), name, Files.asByteSource(bundle)));
ImportBundleRequest req = new ImportBundleRequest(getType(), name,
Files.asByteSource(bundle));
req.setCompressed(compressed);
Repository repository =
session.getRepositoryHandler().importFromBundle(req);
printImportedRepository(repository);
}
@@ -141,6 +167,14 @@ public class ImportBundleSubCommand extends ImportSubCommand
)
private File bundle;
/** Field description */
@Option(
name = "--compressed",
usage = "optionRepositoryBundleCompressed",
aliases = { "-c" }
)
private boolean compressed = false;
/** Field description */
@Option(
name = "--name",

View File

@@ -53,6 +53,7 @@ optionRepositoryPublic = Repository public readable
optionRepositoryArchive = Repository archived
optionRemoteRepositoryUrl = Remote repository url
optionRepositoryBundle = Import repository from a bundle file (e.g. svn dump)
optionRepositoryBundleCompressed = Indicates that the bundle is gzip compressed
optionPermissionGroup = Group
optionPermissionName = Group or user name