mirror of https://github.com/apache/jclouds.git
Merge pull request #543 from andrewgaul/builder
Use inference to elide duplicated type parameters
This commit is contained in:
commit
8425716eb4
|
@ -52,7 +52,7 @@ public class BindUserMetadataToHeaders implements Binder, Function<UserMetadata,
|
|||
|
||||
@Override
|
||||
public Map<String, String> apply(UserMetadata md) {
|
||||
Builder<String, String> headers = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> headers = ImmutableMap.builder();
|
||||
if (md.getMetadata().size() > 0) {
|
||||
String header = Joiner.on(',').withKeyValueSeparator("=").join(md.getMetadata());
|
||||
headers.put("x-emc-meta", header);
|
||||
|
|
|
@ -74,7 +74,7 @@ public class ParseUserMetadataFromHeaders implements Function<HttpResponse, User
|
|||
|
||||
// TODO: change to guava
|
||||
private Map<String, String> getMetaMap(String meta) {
|
||||
Builder<String, String> metaMap = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> metaMap = ImmutableMap.builder();
|
||||
for (String entry : Splitter.on(", ").split(meta)) {
|
||||
String[] entrySplit = entry.split("=");
|
||||
metaMap.put(entrySplit[0], entrySplit[1]);
|
||||
|
|
|
@ -69,7 +69,7 @@ public class ParseDirectoryListFromContentAndHeadersTest extends BaseHandlerTest
|
|||
}
|
||||
|
||||
protected Set<DirectoryEntry> values() {
|
||||
Builder<DirectoryEntry> expected = ImmutableSet.<DirectoryEntry>builder();
|
||||
Builder<DirectoryEntry> expected = ImmutableSet.builder();
|
||||
expected.add(new DirectoryEntry("4980cdb2a411106a04a4538c92a1b204ad92077de6e3", FileType.DIRECTORY,
|
||||
"adriancole-blobstore-2096685753"));
|
||||
expected.add(new DirectoryEntry("4980cdb2a410105404980d99e53a0504ad93939e7dc3", FileType.DIRECTORY,
|
||||
|
|
|
@ -130,7 +130,7 @@ public class YamlNode {
|
|||
public InputStream apply(YamlNode in) {
|
||||
if (in == null)
|
||||
return null;
|
||||
Builder<String, Object> prettier = ImmutableMap.<String, Object> builder();
|
||||
Builder<String, Object> prettier = ImmutableMap.builder();
|
||||
if (in.id != null)
|
||||
prettier.put("id", in.id);
|
||||
if (in.name != null)
|
||||
|
|
|
@ -140,7 +140,7 @@ public class CloudSigmaComputeServiceAdapter implements
|
|||
|
||||
@Override
|
||||
public Iterable<Hardware> listHardwareProfiles() {
|
||||
Builder<Hardware> hardware = ImmutableSet.<Hardware> builder();
|
||||
Builder<Hardware> hardware = ImmutableSet.builder();
|
||||
for (double cpu : new double[] { 1000, 5000, 10000, 20000 })
|
||||
for (int ram : new int[] { 512, 1024, 4 * 1024, 16 * 1024, 32 * 1024 }) {
|
||||
final float size = (float) cpu / 100;
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableMap.Builder;
|
|||
public class MapToDriveMetrics implements Function<Map<String, String>, Map<String, ? extends DriveMetrics>> {
|
||||
|
||||
public Map<String, ? extends DriveMetrics> apply(Map<String, String> from) {
|
||||
Builder<String, DriveMetrics> builder = ImmutableMap.<String, DriveMetrics> builder();
|
||||
Builder<String, DriveMetrics> builder = ImmutableMap.builder();
|
||||
addIDEDevices(from, builder);
|
||||
addSCSIDevices(from, builder);
|
||||
addBlockDevices(from, builder);
|
||||
|
|
|
@ -264,7 +264,7 @@ public class CloudStackComputeServiceAdapter implements
|
|||
}
|
||||
|
||||
public void disableStaticNATOnIPAddresses(Set<Long> ipAddresses) {
|
||||
Builder<Long> jobsToTrack = ImmutableSet.<Long> builder();
|
||||
Builder<Long> jobsToTrack = ImmutableSet.builder();
|
||||
for (Long ipAddress : ipAddresses) {
|
||||
Long disableStaticNAT = client.getNATClient().disableStaticNATOnPublicIP(ipAddress);
|
||||
if (disableStaticNAT != null) {
|
||||
|
@ -276,7 +276,7 @@ public class CloudStackComputeServiceAdapter implements
|
|||
}
|
||||
|
||||
public Set<Long> deleteIPForwardingRulesForVMAndReturnDistinctIPs(long virtualMachineId) {
|
||||
Builder<Long> jobsToTrack = ImmutableSet.<Long> builder();
|
||||
Builder<Long> jobsToTrack = ImmutableSet.builder();
|
||||
|
||||
// immutable doesn't permit duplicates
|
||||
Set<Long> ipAddresses = Sets.newLinkedHashSet();
|
||||
|
|
|
@ -108,7 +108,7 @@ public class NetworkService implements Comparable<NetworkService> {
|
|||
|
||||
public NetworkService(String name, Map<String, String> capabilities) {
|
||||
this.name = checkNotNull(name, "name");
|
||||
ImmutableSortedSet.Builder<Capability> internal = ImmutableSortedSet.<Capability> naturalOrder();
|
||||
ImmutableSortedSet.Builder<Capability> internal = ImmutableSortedSet.naturalOrder();
|
||||
for (Entry<String, String> capabililty : checkNotNull(capabilities, "capabilities").entrySet())
|
||||
internal.add(new Capability(capabililty.getKey(), capabililty.getValue()));
|
||||
this.capabilities = internal.build();
|
||||
|
@ -120,7 +120,7 @@ public class NetworkService implements Comparable<NetworkService> {
|
|||
|
||||
public Map<String, String> getCapabilities() {
|
||||
// so tests and serialization comes out expected
|
||||
Builder<String, String> returnVal = ImmutableSortedMap.<String, String> naturalOrder();
|
||||
Builder<String, String> returnVal = ImmutableSortedMap.naturalOrder();
|
||||
for (Capability capability : capabilities) {
|
||||
returnVal.put(capability.name, capability.value);
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ public class QuerySigner implements AuthenticationFilter, RequestSigner {
|
|||
utils.logRequest(signatureLog, request, ">>");
|
||||
|
||||
// encode each parameter value first,
|
||||
ImmutableSortedSet.Builder<String> builder = ImmutableSortedSet.<String> naturalOrder();
|
||||
ImmutableSortedSet.Builder<String> builder = ImmutableSortedSet.naturalOrder();
|
||||
for (Entry<String, String> entry : decodedParams.entries())
|
||||
builder.add(entry.getKey() + "=" + Strings2.urlEncode(entry.getValue()));
|
||||
|
||||
|
|
|
@ -76,14 +76,14 @@ public class CreatePortForwardingRulesForIP {
|
|||
"ip %s should be static NATed to a virtual machine before applying rules", ip);
|
||||
if (Iterables.size(ports) == 0)
|
||||
return ImmutableSet.<IPForwardingRule> of();
|
||||
Builder<AsyncCreateResponse> responses = ImmutableSet.<AsyncCreateResponse> builder();
|
||||
Builder<AsyncCreateResponse> responses = ImmutableSet.builder();
|
||||
for (int port : ports) {
|
||||
AsyncCreateResponse response = client.getNATClient().createIPForwardingRule(ip.getId(), protocol, port);
|
||||
logger.debug(">> creating IP forwarding rule IPAddress(%s) for protocol(%s), port(%s); response(%s)",
|
||||
ip.getId(), protocol, port, response);
|
||||
responses.add(response);
|
||||
}
|
||||
Builder<IPForwardingRule> rules = ImmutableSet.<IPForwardingRule> builder();
|
||||
Builder<IPForwardingRule> rules = ImmutableSet.builder();
|
||||
for (AsyncCreateResponse response : responses.build()) {
|
||||
IPForwardingRule rule = blockUntilJobCompletesAndReturnResult.<IPForwardingRule> apply(response);
|
||||
rules.add(rule);
|
||||
|
|
|
@ -64,7 +64,7 @@ public class ParseEventTypesFromHttpResponse implements Function<HttpResponse, S
|
|||
checkNotNull(response, "response");
|
||||
Set<EventType> toParse = parser.apply(response);
|
||||
checkNotNull(toParse, "parsed result from %s", response);
|
||||
Builder<String> builder = ImmutableSet.<String>builder();
|
||||
Builder<String> builder = ImmutableSet.builder();
|
||||
for (EventType entry : toParse)
|
||||
builder.add(entry.name);
|
||||
return builder.build();
|
||||
|
|
|
@ -88,7 +88,7 @@ public class ParseIdToNameFromHttpResponse implements Function<HttpResponse, Map
|
|||
checkNotNull(response, "response");
|
||||
Set<IdName> toParse = parser.apply(response);
|
||||
checkNotNull(toParse, "parsed result from %s", response);
|
||||
Builder<Long, String> builder = ImmutableSortedMap.<Long, String> naturalOrder();
|
||||
Builder<Long, String> builder = ImmutableSortedMap.naturalOrder();
|
||||
for (IdName entry : toParse)
|
||||
builder.put(entry.id, entry.name);
|
||||
return builder.build();
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ParseNamesFromHttpResponse implements Function<HttpResponse, Set<St
|
|||
checkNotNull(response, "response");
|
||||
Set<Name> toParse = parser.apply(response);
|
||||
checkNotNull(toParse, "parsed result from %s", response);
|
||||
Builder<String> builder = ImmutableSet.<String> builder();
|
||||
Builder<String> builder = ImmutableSet.builder();
|
||||
for (Name entry : toParse)
|
||||
builder.add(entry.name);
|
||||
return builder.build();
|
||||
|
|
|
@ -63,7 +63,7 @@ public class CorrectHypervisorForZone implements Function<Long, Predicate<Templa
|
|||
@Override
|
||||
public Map<Long, Set<String>> apply(CloudStackClient client) {
|
||||
checkNotNull(client, "client");
|
||||
Builder<Long, Set<String>> builder = ImmutableMap.<Long, Set<String>> builder();
|
||||
Builder<Long, Set<String>> builder = ImmutableMap.builder();
|
||||
for (Zone zone : client.getZoneClient().listZones()) {
|
||||
builder.put(zone.getId(), client.getHypervisorClient().listHypervisorsInZone(zone.getId()));
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class BindBlockDeviceMappingToIndexedFormParams implements Binder {
|
|||
checkArgument(checkNotNull(input, "input") instanceof Map, "this binder is only valid for Map");
|
||||
Map<String, BlockDevice> blockDeviceMapping = (Map<String, BlockDevice>) input;
|
||||
|
||||
com.google.common.collect.ImmutableMap.Builder<String, String> builder = ImmutableMap.<String, String> builder();
|
||||
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
|
||||
int amazonOneBasedIndex = 1; // according to docs, counters must start with 1
|
||||
for (Entry<String, BlockDevice> ebsBlockDeviceName : blockDeviceMapping.entrySet()) {
|
||||
// not null by contract
|
||||
|
|
|
@ -40,7 +40,7 @@ public class BindIpPermissionsToIndexedFormParams implements Binder {
|
|||
public <R extends HttpRequest> R bindToRequest(R request, Object input) {
|
||||
checkArgument(checkNotNull(input, "input") instanceof Iterable,
|
||||
"this binder is only valid for Iterable<IpPermission>");
|
||||
Builder<String, String> headers = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> headers = ImmutableMultimap.builder();
|
||||
int index = 0;
|
||||
for (IpPermission perm : (Iterable<IpPermission>) input)
|
||||
headers.putAll(IpPermissions.buildFormParametersForIndex(index++, perm));
|
||||
|
|
|
@ -49,7 +49,7 @@ public class BindS3UploadPolicyAndSignature implements Binder {
|
|||
@Override
|
||||
public <R extends HttpRequest> R bindToRequest(R request, Object input) {
|
||||
String encodedJson = CryptoStreams.base64(checkNotNull(input, "json").toString().getBytes(Charsets.UTF_8));
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
builder.put("Storage.S3.UploadPolicy", encodedJson);
|
||||
String signature = signer.sign(encodedJson);
|
||||
builder.put("Storage.S3.UploadPolicySignature", signature);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class BindUserIdGroupPairToSourceSecurityGroupFormParams implements Binde
|
|||
checkArgument(checkNotNull(input, "input") instanceof UserIdGroupPair,
|
||||
"this binder is only valid for UserIdGroupPair!");
|
||||
UserIdGroupPair pair = (UserIdGroupPair) input;
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
builder.put("SourceSecurityGroupOwnerId", pair.getUserId());
|
||||
builder.put("SourceSecurityGroupName", pair.getGroupName());
|
||||
return ModifyRequest.putFormParams(request, builder.build());
|
||||
|
|
|
@ -191,7 +191,7 @@ public class EC2ComputeService extends BaseComputeService {
|
|||
*/
|
||||
@Override
|
||||
protected void cleanUpIncidentalResourcesOfDeadNodes(Set<? extends NodeMetadata> deadNodes) {
|
||||
Builder<String, String> regionGroups = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> regionGroups = ImmutableMultimap.builder();
|
||||
for (NodeMetadata nodeMetadata : deadNodes) {
|
||||
if (nodeMetadata.getGroup() != null)
|
||||
regionGroups.put(AWSUtils.parseHandle(nodeMetadata.getId())[0], nodeMetadata.getGroup());
|
||||
|
|
|
@ -116,7 +116,7 @@ public class RunningInstanceToNodeMetadata implements Function<RunningInstance,
|
|||
|
||||
// collect all ip addresses into one bundle in case the api mistakenly put a private address
|
||||
// into the public address field
|
||||
Builder<String> addressesBuilder = ImmutableSet.<String> builder();
|
||||
Builder<String> addressesBuilder = ImmutableSet.builder();
|
||||
if (Strings.emptyToNull(instance.getIpAddress()) != null)
|
||||
addressesBuilder.add(instance.getIpAddress());
|
||||
if (Strings.emptyToNull(instance.getPrivateIpAddress()) != null)
|
||||
|
|
|
@ -87,7 +87,7 @@ public class EC2TemplateOptions extends TemplateOptions implements Cloneable {
|
|||
private String keyPair = null;
|
||||
private boolean noKeyPair;
|
||||
private byte[] userData;
|
||||
private ImmutableSet.Builder<BlockDeviceMapping> blockDeviceMappings = ImmutableSet.<BlockDeviceMapping> builder();
|
||||
private ImmutableSet.Builder<BlockDeviceMapping> blockDeviceMappings = ImmutableSet.builder();
|
||||
|
||||
public static final EC2TemplateOptions NONE = new EC2TemplateOptions();
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ public class CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions {
|
|||
|
||||
@VisibleForTesting
|
||||
public Set<String> getSecurityGroupsForTagAndOptions(String region, @Nullable String group, TemplateOptions options) {
|
||||
Builder<String> groups = ImmutableSet.<String> builder();
|
||||
Builder<String> groups = ImmutableSet.builder();
|
||||
|
||||
if (group != null) {
|
||||
String markerGroup = String.format("jclouds#%s#%s", group, region).replace('#', delimiter);
|
||||
|
|
|
@ -170,7 +170,7 @@ public class EC2CreateNodesInGroupThenAddToSet implements CreateNodesInGroupThen
|
|||
|
||||
protected Iterable<String> allocateElasticIpsInRegion(int count, Template template) {
|
||||
|
||||
Builder<String> ips = ImmutableSet.<String> builder();
|
||||
Builder<String> ips = ImmutableSet.builder();
|
||||
if (!autoAllocateElasticIps)
|
||||
return ips.build();
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ public class EC2ImageSupplier implements Supplier<Set<? extends Image>> {
|
|||
public Iterable<Entry<String, DescribeImagesOptions>> getDescribeQueriesForOwnersInRegions(Set<String> regions,
|
||||
String[] amiOwners) {
|
||||
DescribeImagesOptions options = getOptionsForOwners(amiOwners);
|
||||
Builder<String, DescribeImagesOptions> builder = ImmutableMap.<String, DescribeImagesOptions> builder();
|
||||
Builder<String, DescribeImagesOptions> builder = ImmutableMap.builder();
|
||||
for (String region : regions)
|
||||
builder.put(region, options);
|
||||
return builder.build().entrySet();
|
||||
|
|
|
@ -51,7 +51,7 @@ public class BaseEC2RequestOptions extends BaseHttpRequestOptions {
|
|||
}
|
||||
|
||||
protected Set<String> getFormValuesWithKeysPrefixedBy(final String prefix) {
|
||||
Builder<String> values = ImmutableSet.<String> builder();
|
||||
Builder<String> values = ImmutableSet.builder();
|
||||
for (String key : Iterables.filter(formParameters.keySet(), new Predicate<String>() {
|
||||
|
||||
public boolean apply(String input) {
|
||||
|
|
|
@ -132,7 +132,7 @@ public class ElasticStackComputeServiceAdapter implements
|
|||
|
||||
@Override
|
||||
public Iterable<Hardware> listHardwareProfiles() {
|
||||
Builder<Hardware> hardware = ImmutableSet.<Hardware> builder();
|
||||
Builder<Hardware> hardware = ImmutableSet.builder();
|
||||
for (double cpu : new double[] { 1000, 5000, 10000, 20000 })
|
||||
for (int ram : new int[] { 512, 1024, 2048, 4096, 8192 }) {
|
||||
final float size = (float) cpu / 1000;
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.google.common.collect.ImmutableMap.Builder;
|
|||
public class MapToDriveMetrics implements Function<Map<String, String>, Map<String, ? extends DriveMetrics>> {
|
||||
|
||||
public Map<String, ? extends DriveMetrics> apply(Map<String, String> from) {
|
||||
Builder<String, DriveMetrics> builder = ImmutableMap.<String, DriveMetrics> builder();
|
||||
Builder<String, DriveMetrics> builder = ImmutableMap.builder();
|
||||
addIDEDevices(from, builder);
|
||||
addSCSIDevices(from, builder);
|
||||
addBlockDevices(from, builder);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class BindSecurityGroupRuleToJsonPayload extends BindToJsonPayload implem
|
|||
|
||||
@Override
|
||||
public <R extends HttpRequest> R bindToRequest(R request, Map<String, String> postParams) {
|
||||
Builder<String, String> payload = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> payload = ImmutableMap.builder();
|
||||
payload.putAll(postParams);
|
||||
checkArgument(checkNotNull(request, "request") instanceof GeneratedHttpRequest<?>,
|
||||
"this binder is only valid for GeneratedHttpRequests!");
|
||||
|
|
|
@ -131,7 +131,7 @@ public class NovaComputeServiceAdapter implements
|
|||
|
||||
@Override
|
||||
public Iterable<FlavorInZone> listHardwareProfiles() {
|
||||
Builder<FlavorInZone> builder = ImmutableSet.<FlavorInZone> builder();
|
||||
Builder<FlavorInZone> builder = ImmutableSet.builder();
|
||||
for (final String zoneId : zoneIds.get()) {
|
||||
builder.addAll(transform(novaClient.getFlavorClientForZone(zoneId).listFlavorsInDetail(),
|
||||
new Function<Flavor, FlavorInZone>() {
|
||||
|
@ -148,7 +148,7 @@ public class NovaComputeServiceAdapter implements
|
|||
|
||||
@Override
|
||||
public Iterable<ImageInZone> listImages() {
|
||||
Builder<ImageInZone> builder = ImmutableSet.<ImageInZone> builder();
|
||||
Builder<ImageInZone> builder = ImmutableSet.builder();
|
||||
for (final String zoneId : zoneIds.get()) {
|
||||
builder.addAll(transform(filter(novaClient.getImageClientForZone(zoneId).listImagesInDetail(), ImagePredicates
|
||||
.statusEquals(Image.Status.ACTIVE)), new Function<Image, ImageInZone>() {
|
||||
|
@ -165,7 +165,7 @@ public class NovaComputeServiceAdapter implements
|
|||
|
||||
@Override
|
||||
public Iterable<ServerInZone> listNodes() {
|
||||
Builder<ServerInZone> builder = ImmutableSet.<ServerInZone> builder();
|
||||
Builder<ServerInZone> builder = ImmutableSet.builder();
|
||||
for (final String zoneId : zoneIds.get()) {
|
||||
builder.addAll(transform(novaClient.getServerClientForZone(zoneId).listServersInDetail(),
|
||||
new Function<Server, ServerInZone>() {
|
||||
|
|
|
@ -55,7 +55,7 @@ public class CreateSecurityGroupIfNeededTest extends BaseNovaClientExpectTest {
|
|||
|
||||
public void testCreateNewGroup() throws Exception {
|
||||
|
||||
Builder<HttpRequest, HttpResponse> builder = ImmutableMap.<HttpRequest, HttpResponse>builder();
|
||||
Builder<HttpRequest, HttpResponse> builder = ImmutableMap.builder();
|
||||
|
||||
builder.put(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess);
|
||||
builder.put(extensionsOfNovaRequest, extensionsOfNovaResponse);
|
||||
|
@ -133,7 +133,7 @@ public class CreateSecurityGroupIfNeededTest extends BaseNovaClientExpectTest {
|
|||
|
||||
public void testReturnExistingGroupOnAlreadyExists() throws Exception {
|
||||
|
||||
Builder<HttpRequest, HttpResponse> builder = ImmutableMap.<HttpRequest, HttpResponse>builder();
|
||||
Builder<HttpRequest, HttpResponse> builder = ImmutableMap.builder();
|
||||
|
||||
builder.put(keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess);
|
||||
builder.put(extensionsOfNovaRequest, extensionsOfNovaResponse);
|
||||
|
|
|
@ -254,7 +254,7 @@ public class CopyObjectOptions extends BaseHttpRequestOptions {
|
|||
public Multimap<String, String> buildRequestHeaders() {
|
||||
checkState(headerTag != null, "headerTag should have been injected!");
|
||||
checkState(metadataPrefix != null, "metadataPrefix should have been injected!");
|
||||
ImmutableMultimap.Builder<String, String> returnVal = ImmutableMultimap.<String, String> builder();
|
||||
ImmutableMultimap.Builder<String, String> returnVal = ImmutableMultimap.builder();
|
||||
for (Entry<String, String> entry : headers.entries()) {
|
||||
returnVal.put(entry.getKey().replace(DEFAULT_AMAZON_HEADERTAG, headerTag), entry.getValue());
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class PutObjectOptions extends BaseHttpRequestOptions {
|
|||
@Override
|
||||
public Multimap<String, String> buildRequestHeaders() {
|
||||
checkState(headerTag != null, "headerTag should have been injected!");
|
||||
ImmutableMultimap.Builder<String, String> returnVal = ImmutableMultimap.<String, String> builder();
|
||||
ImmutableMultimap.Builder<String, String> returnVal = ImmutableMultimap.builder();
|
||||
for (Entry<String, String> entry : headers.entries()) {
|
||||
returnVal.put(entry.getKey().replace(DEFAULT_AMAZON_HEADERTAG, headerTag), entry.getValue());
|
||||
}
|
||||
|
|
|
@ -49,8 +49,8 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||
* />
|
||||
*/
|
||||
public class ListBucketHandler extends ParseSax.HandlerWithResult<ListBucketResponse> {
|
||||
private Builder<ObjectMetadata> contents = ImmutableSet.<ObjectMetadata> builder();
|
||||
private Builder<String> commonPrefixes = ImmutableSet.<String> builder();
|
||||
private Builder<ObjectMetadata> contents = ImmutableSet.builder();
|
||||
private Builder<String> commonPrefixes = ImmutableSet.builder();
|
||||
private CanonicalUser currentOwner;
|
||||
private StringBuilder currentText = new StringBuilder();
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ public class VCloudComputeServiceAdapter implements ComputeServiceAdapter<VApp,
|
|||
@Override
|
||||
public Iterable<VApp> listNodes() {
|
||||
// TODO: parallel or cache
|
||||
Builder<VApp> nodes = ImmutableSet.<VApp> builder();
|
||||
Builder<VApp> nodes = ImmutableSet.builder();
|
||||
for (Org org : nameToOrg.get().values()) {
|
||||
for (ReferenceType vdc : org.getVDCs().values()) {
|
||||
for (ReferenceType resource : client.getVDCClient().getVDC(vdc.getHref()).getResourceEntities().values()) {
|
||||
|
|
|
@ -86,7 +86,7 @@ public class VCloudComputeUtils {
|
|||
// TODO make this work with composite vApps
|
||||
if (vApp.getChildren().size() == 0)
|
||||
return ImmutableSet.of();
|
||||
Builder<String> ips = ImmutableSet.<String> builder();
|
||||
Builder<String> ips = ImmutableSet.builder();
|
||||
Vm vm = Iterables.get(vApp.getChildren(), 0);
|
||||
// TODO: figure out how to differentiate public from private ip addresses
|
||||
// assumption is that we'll do this from the network object, which may
|
||||
|
|
|
@ -102,7 +102,7 @@ public class DefaultVCloudReferencesModule extends AbstractModule {
|
|||
|
||||
@Override
|
||||
public Map<URI, Catalog> apply(Map<String, Map<String, Catalog>> arg0) {
|
||||
Builder<URI, Catalog> builder = ImmutableMap.<URI, Catalog> builder();
|
||||
Builder<URI, Catalog> builder = ImmutableMap.builder();
|
||||
for (Map<String, Catalog> v1 : arg0.values()) {
|
||||
for (Catalog v2 : v1.values()) {
|
||||
builder.put(v2.getHref(), v2);
|
||||
|
|
|
@ -224,7 +224,7 @@ public class VCloudRestClientModule extends RestClientModule<VCloudClient, VClou
|
|||
|
||||
@Override
|
||||
public Map<String, String> apply(Map<String, Org> arg0) {
|
||||
Builder<String, String> returnVal = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> returnVal = ImmutableMap.builder();
|
||||
for (Entry<String, Org> orgr : arg0.entrySet()) {
|
||||
for (String vdc : orgr.getValue().getVDCs().keySet()) {
|
||||
returnVal.put(vdc, orgr.getKey());
|
||||
|
|
|
@ -72,7 +72,7 @@ public class BindCloneVAppParamsToXmlPayloadTest {
|
|||
|
||||
BindCloneVAppParamsToXmlPayload binder = injector.getInstance(BindCloneVAppParamsToXmlPayload.class);
|
||||
|
||||
Builder<String, String> map = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> map = ImmutableMap.builder();
|
||||
map.put("name", "new-linux-server");
|
||||
map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vapp/201");
|
||||
binder.bindToRequest(request, map.build());
|
||||
|
@ -92,7 +92,7 @@ public class BindCloneVAppParamsToXmlPayloadTest {
|
|||
|
||||
BindCloneVAppParamsToXmlPayload binder = injector.getInstance(BindCloneVAppParamsToXmlPayload.class);
|
||||
|
||||
Builder<String, String> map = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> map = ImmutableMap.builder();
|
||||
map.put("name", "new-linux-server");
|
||||
map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vapp/201");
|
||||
map.put("IsSourceDelete", "true");
|
||||
|
@ -111,7 +111,7 @@ public class BindCloneVAppParamsToXmlPayloadTest {
|
|||
|
||||
BindCloneVAppParamsToXmlPayload binder = injector.getInstance(BindCloneVAppParamsToXmlPayload.class);
|
||||
|
||||
Builder<String, String> map = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> map = ImmutableMap.builder();
|
||||
map.put("name", "my-vapp");
|
||||
map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vapp/4181");
|
||||
binder.bindToRequest(request, map.build());
|
||||
|
|
|
@ -73,7 +73,7 @@ public class BindCloneVAppTemplateParamsToXmlPayloadTest {
|
|||
BindCloneVAppTemplateParamsToXmlPayload binder = injector
|
||||
.getInstance(BindCloneVAppTemplateParamsToXmlPayload.class);
|
||||
|
||||
Builder<String, String> map = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> map = ImmutableMap.builder();
|
||||
map.put("name", "new-linux-server");
|
||||
map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/201");
|
||||
binder.bindToRequest(request, map.build());
|
||||
|
@ -94,7 +94,7 @@ public class BindCloneVAppTemplateParamsToXmlPayloadTest {
|
|||
BindCloneVAppTemplateParamsToXmlPayload binder = injector
|
||||
.getInstance(BindCloneVAppTemplateParamsToXmlPayload.class);
|
||||
|
||||
Builder<String, String> map = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> map = ImmutableMap.builder();
|
||||
map.put("name", "new-linux-server");
|
||||
map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/201");
|
||||
map.put("IsSourceDelete", "true");
|
||||
|
@ -114,7 +114,7 @@ public class BindCloneVAppTemplateParamsToXmlPayloadTest {
|
|||
BindCloneVAppTemplateParamsToXmlPayload binder = injector
|
||||
.getInstance(BindCloneVAppTemplateParamsToXmlPayload.class);
|
||||
|
||||
Builder<String, String> map = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> map = ImmutableMap.builder();
|
||||
map.put("name", "my-vapptemplate");
|
||||
map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/4181");
|
||||
binder.bindToRequest(request, map.build());
|
||||
|
|
|
@ -204,7 +204,7 @@ public abstract class BaseBlobMapIntegrationTest extends BaseMapIntegrationTest<
|
|||
String bucketName = getContainerName();
|
||||
try {
|
||||
Map<String, Blob> map = createMap(context, bucketName);
|
||||
ImmutableMap.Builder<String, Blob> newMap = ImmutableMap.<String, Blob> builder();
|
||||
ImmutableMap.Builder<String, Blob> newMap = ImmutableMap.builder();
|
||||
for (String key : fiveInputs.keySet()) {
|
||||
newMap.put(
|
||||
key,
|
||||
|
@ -227,7 +227,7 @@ public abstract class BaseBlobMapIntegrationTest extends BaseMapIntegrationTest<
|
|||
String bucketName = getContainerName();
|
||||
try {
|
||||
BlobMap map = createMap(context, bucketName);
|
||||
Builder<String> keySet = ImmutableSet.<String> builder();
|
||||
Builder<String> keySet = ImmutableSet.builder();
|
||||
for (int i = 0; i < maxResultsForTestListings() + 1; i++) {
|
||||
keySet.add(i + "");
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public class AWSUtils {
|
|||
checkArgument(checkNotNull(input, "input") instanceof String[], "this binder is only valid for String[] : "
|
||||
+ input.getClass());
|
||||
String[] values = (String[]) input;
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
builder.put(String.format(format, (i + 1)), checkNotNull(values[i], format.toLowerCase() + "s[" + i + "]"));
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class AWSUtils {
|
|||
checkArgument(checkNotNull(input, "input") instanceof Iterable<?>, "this binder is only valid for Iterable<?>: "
|
||||
+ input.getClass());
|
||||
Iterable<?> values = (Iterable<?>) input;
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
int i = 0;
|
||||
for (Object o : values) {
|
||||
builder.put(prefix + "." + (i++ + 1), checkNotNull(o.toString(), prefix.toLowerCase() + "s[" + i + "]"));
|
||||
|
@ -143,7 +143,7 @@ public class AWSUtils {
|
|||
checkArgument(checkNotNull(input, "input") instanceof String[], "this binder is only valid for String[] : "
|
||||
+ input.getClass());
|
||||
String[] values = (String[]) input;
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
builder.put(prefix + "." + (i + 1), checkNotNull(values[i], prefix.toLowerCase() + "s[" + i + "]"));
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public class AWSUtils {
|
|||
public static <R extends HttpRequest> R indexMapToFormValuesWithPrefix(R request, String prefix, String keySuffix, String valueSuffix, Object input) {
|
||||
checkArgument(checkNotNull(input, "input") instanceof Map<?, ?>, "this binder is only valid for Map<?,?>: " + input.getClass());
|
||||
Map<?, ?> map = (Map<?, ?>) input;
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
int i = 1;
|
||||
for (Map.Entry<?, ?> e : map.entrySet()) {
|
||||
builder.put(prefix + "." + i + "." + keySuffix, checkNotNull(e.getKey().toString(), keySuffix.toLowerCase() + "s[" + i + "]"));
|
||||
|
@ -171,7 +171,7 @@ public class AWSUtils {
|
|||
public static <R extends HttpRequest> R indexMultimapToFormValuesWithPrefix(R request, String prefix, String keySuffix, String valueSuffix, Object input) {
|
||||
checkArgument(checkNotNull(input, "input") instanceof Multimap<?, ?>, "this binder is only valid for Multimap<?,?>: " + input.getClass());
|
||||
Multimap<Object, Object> map = (Multimap<Object, Object>) input;
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
int i = 1;
|
||||
for (Object k : map.keySet()) {
|
||||
builder.put(prefix + "." + i + "." + keySuffix, checkNotNull(k.toString(), keySuffix.toLowerCase() + "s[" + i + "]"));
|
||||
|
@ -190,7 +190,7 @@ public class AWSUtils {
|
|||
public static <R extends HttpRequest> R indexMapOfIterableToFormValuesWithPrefix(R request, String prefix, String keySuffix, String valueSuffix, Object input) {
|
||||
checkArgument(checkNotNull(input, "input") instanceof Map<?, ?>, "this binder is only valid for Map<?,Iterable<?>>: " + input.getClass());
|
||||
Map<Object, Iterable<Object>> map = (Map<Object, Iterable<Object>>) input;
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
int i = 1;
|
||||
for (Object k : map.keySet()) {
|
||||
builder.put(prefix + "." + i + "." + keySuffix, checkNotNull(k.toString(), keySuffix.toLowerCase() + "s[" + i + "]"));
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ParseAuthenticationResponseFromHeaders implements Function<HttpResp
|
|||
*/
|
||||
public AuthenticationResponse apply(HttpResponse from) {
|
||||
releasePayload(from);
|
||||
Builder<String, URI> builder = ImmutableMap.<String, URI> builder();
|
||||
Builder<String, URI> builder = ImmutableMap.builder();
|
||||
for (Entry<String, String> entry : from.getHeaders().entries()) {
|
||||
if (entry.getKey().endsWith(URL_SUFFIX))
|
||||
builder.put(entry.getKey(), getURI(entry.getValue()));
|
||||
|
|
|
@ -73,7 +73,7 @@ public class BindAuthToJsonPayload extends BindToJsonPayload implements MapBinde
|
|||
GeneratedHttpRequest<?> gRequest = (GeneratedHttpRequest<?>) request;
|
||||
checkState(gRequest.getArgs() != null, "args should be initialized at this point");
|
||||
|
||||
Builder<String, Object> builder = ImmutableMap.<String, Object> builder();
|
||||
Builder<String, Object> builder = ImmutableMap.builder();
|
||||
addCredentialsInArgsOrNull(gRequest, builder);
|
||||
// TODO: is tenantName permanent? or should we switch to tenantId at some point. seems most tools
|
||||
// still use tenantName
|
||||
|
|
|
@ -106,7 +106,7 @@ public class DefaultVCloudReferencesModule extends AbstractModule {
|
|||
|
||||
@Override
|
||||
public Map<URI, ? extends Catalog> apply(Map<String, Map<String, ? extends Catalog>> arg0) {
|
||||
Builder<URI, Catalog> builder = ImmutableMap.<URI, Catalog> builder();
|
||||
Builder<URI, Catalog> builder = ImmutableMap.builder();
|
||||
for (Map<String, ? extends Catalog> v1 : arg0.values()) {
|
||||
for (Catalog v2 : v1.values()) {
|
||||
builder.put(v2.getHref(), v2);
|
||||
|
|
|
@ -150,7 +150,7 @@ public class TerremarkVCloudRestClientModule<S extends TerremarkVCloudClient, A
|
|||
|
||||
@Override
|
||||
public Map<String, String> apply(Map<String, ? extends org.jclouds.trmk.vcloud_0_8.domain.Org> arg0) {
|
||||
Builder<String, String> returnVal = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> returnVal = ImmutableMap.builder();
|
||||
for (Entry<String, ? extends org.jclouds.trmk.vcloud_0_8.domain.Org> orgr : arg0.entrySet()) {
|
||||
for (String vdc : orgr.getValue().getVDCs().keySet()) {
|
||||
returnVal.put(vdc, orgr.getKey());
|
||||
|
|
|
@ -42,7 +42,7 @@ public class AddInternetServiceOptions extends BindAddInternetServiceToXmlPayloa
|
|||
|
||||
@Override
|
||||
public <R extends HttpRequest> R bindToRequest(R request, Map<String, String> postParams) {
|
||||
ImmutableMap.Builder<String, String> copy = ImmutableMap.<String, String> builder();
|
||||
ImmutableMap.Builder<String, String> copy = ImmutableMap.builder();
|
||||
copy.putAll(postParams);
|
||||
if (description != null)
|
||||
copy.put("description", description);
|
||||
|
|
|
@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||
public class DataCentersHandler extends ParseSax.HandlerWithResult<Set<DataCenter>> {
|
||||
protected StringBuilder currentText = new StringBuilder();
|
||||
|
||||
protected Builder<DataCenter> dataCenters = ImmutableSet.<DataCenter> builder();
|
||||
protected Builder<DataCenter> dataCenters = ImmutableSet.builder();
|
||||
|
||||
protected DataCenter.Builder builder = DataCenter.builder();
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||
public class InternetServicesHandler extends HandlerWithResult<Set<InternetService>> {
|
||||
|
||||
private final InternetServiceHandler handler;
|
||||
private Builder<InternetService> builder = ImmutableSet.<InternetService> builder();
|
||||
private Builder<InternetService> builder = ImmutableSet.builder();
|
||||
|
||||
@Inject
|
||||
public InternetServicesHandler(InternetServiceHandler handler) {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class RunScriptData {
|
|||
public static String JBOSS_HOME = "/usr/local/jboss";
|
||||
|
||||
public static Statement authorizePortsInIpTables(int... ports) {
|
||||
Builder<Statement> builder = ImmutableList.<Statement> builder();
|
||||
Builder<Statement> builder = ImmutableList.builder();
|
||||
for (int port : ports)
|
||||
builder.add(exec("iptables -I INPUT 1 -p tcp --dport " + port + " -j ACCEPT"));
|
||||
builder.add(exec("iptables-save"));
|
||||
|
|
|
@ -65,7 +65,7 @@ public class NullEqualToIsParentOrIsGrandparentOfCurrentLocation implements Pred
|
|||
"only locations of scope PROVIDER can have a null parent; input: %s",
|
||||
input.getLocation());
|
||||
|
||||
Builder<Predicate<Location>> predicates = ImmutableSet.<Predicate<Location>>builder();
|
||||
Builder<Predicate<Location>> predicates = ImmutableSet.builder();
|
||||
|
||||
predicates.add(equalTo(current));
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ public class StubComputeServiceAdapter implements JCloudsNativeComputeServiceAda
|
|||
public Iterable<Image> listImages() {
|
||||
// initializing as a List, as ImmutableSet does not allow you to put
|
||||
// duplicates
|
||||
Builder<Image> images = ImmutableList.<Image> builder();
|
||||
Builder<Image> images = ImmutableList.builder();
|
||||
int id = 1;
|
||||
for (boolean is64Bit : new boolean[] { true, false })
|
||||
for (Entry<OsFamily, Map<String, String>> osVersions : this.osToVersionMap.entrySet()) {
|
||||
|
|
|
@ -149,7 +149,7 @@ public class SshKeys {
|
|||
|
||||
public static Map<String, String> generate(KeyPairGenerator generator) {
|
||||
KeyPair pair = generateRsaKeyPair(generator);
|
||||
Builder<String, String> builder = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMap.builder();
|
||||
builder.put("public", encodeAsOpenSSH(RSAPublicKey.class.cast(pair.getPublic())));
|
||||
builder.put("private", encodeAsPem(RSAPrivateKey.class.cast(pair.getPrivate())));
|
||||
return builder.build();
|
||||
|
|
|
@ -37,7 +37,7 @@ public class JoinOnK2<K, K2, V> implements Function<Map<K, Supplier<Set<K2>>>, M
|
|||
@Override
|
||||
public Map<K2, Supplier<V>> apply(Map<K, Supplier<Set<K2>>> regionToZones) {
|
||||
Map<K2, Supplier<V>> regionToEndpoint = regionToEndpointSupplier.get();
|
||||
Builder<K2, Supplier<V>> builder = ImmutableMap.<K2, Supplier<V>> builder();
|
||||
Builder<K2, Supplier<V>> builder = ImmutableMap.builder();
|
||||
for (Entry<K, Supplier<Set<K2>>> entry : regionToZones.entrySet()) {
|
||||
for (K2 zone : entry.getValue().get()) {
|
||||
builder.put(zone, regionToEndpoint.get(entry.getKey()));
|
||||
|
|
|
@ -185,7 +185,7 @@ public class GsonModule extends AbstractModule {
|
|||
|
||||
@Override
|
||||
public void write(JsonWriter out, Properties value) throws IOException {
|
||||
Builder<String, String> srcMap = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> srcMap = ImmutableMap.builder();
|
||||
for (Enumeration<?> propNames = value.propertyNames(); propNames.hasMoreElements();) {
|
||||
String propName = (String) propNames.nextElement();
|
||||
srcMap.put(propName, value.getProperty(propName));
|
||||
|
|
|
@ -71,7 +71,7 @@ public class LocationIdToIso3166CodesFromConfiguration implements LocationIdToIs
|
|||
}
|
||||
|
||||
});
|
||||
Builder<String, Supplier<Set<String>>> codes = ImmutableMap.<String, Supplier<Set<String>>> builder();
|
||||
Builder<String, Supplier<Set<String>>> codes = ImmutableMap.builder();
|
||||
for (String key : ImmutableSet.of(PROPERTY_REGION, PROPERTY_ZONE)) {
|
||||
String regionOrZoneString = stringsBoundWithRegionOrZonePrefix.get(key + "s");
|
||||
if (regionOrZoneString == null)
|
||||
|
|
|
@ -60,7 +60,7 @@ public class LocationIdToURIFromConfigurationOrDefaultToProvider implements Supp
|
|||
|
||||
@Override
|
||||
public Map<String, Supplier<URI>> get() {
|
||||
Builder<String, Supplier<URI>> locations = ImmutableMap.<String, Supplier<URI>> builder();
|
||||
Builder<String, Supplier<URI>> locations = ImmutableMap.builder();
|
||||
for (String location : locationIds.get()) {
|
||||
String configKey = configPrefix + "." + location + "." + ENDPOINT;
|
||||
String locationUri = config.apply(configKey);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class RegionIdToZoneIdsFromConfiguration implements RegionIdToZoneIdsSupp
|
|||
logger.debug("no regions configured for provider %s", provider);
|
||||
return ImmutableMap.of();
|
||||
}
|
||||
Builder<String, Supplier<Set<String>>> regionToZones = ImmutableMap.<String, Supplier<Set<String>>> builder();
|
||||
Builder<String, Supplier<Set<String>>> regionToZones = ImmutableMap.builder();
|
||||
for (String region : regions) {
|
||||
String configKey = PROPERTY_REGION + "." + region + ".zones";
|
||||
String zones = config.apply(configKey);
|
||||
|
|
|
@ -243,7 +243,7 @@ public class RestAnnotationProcessor<T> {
|
|||
new CacheLoader<Method, Set<Integer>>() {
|
||||
@Override
|
||||
public Set<Integer> load(Method method) {
|
||||
Builder<Integer> toReturn = ImmutableSet.<Integer> builder();
|
||||
Builder<Integer> toReturn = ImmutableSet.builder();
|
||||
for (int index = 0; index < method.getParameterTypes().length; index++) {
|
||||
Class<?> type = method.getParameterTypes()[index];
|
||||
if (HttpRequestOptions.class.isAssignableFrom(type) || optionsVarArgsClass.isAssignableFrom(type))
|
||||
|
@ -922,7 +922,7 @@ public class RestAnnotationProcessor<T> {
|
|||
}
|
||||
|
||||
public static Set<String> getHttpMethods(Method method) {
|
||||
Builder<String> methodsBuilder = ImmutableSet.<String> builder();
|
||||
Builder<String> methodsBuilder = ImmutableSet.builder();
|
||||
for (Annotation annotation : method.getAnnotations()) {
|
||||
HttpMethod http = annotation.annotationType().getAnnotation(HttpMethod.class);
|
||||
if (http != null)
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Multimaps2 {
|
|||
*/
|
||||
@Deprecated
|
||||
public static <K, V> Map<K, Set<V>> toOldSchool(Multimap<K, V> in) {
|
||||
ImmutableMap.Builder<K, Set<V>> out = ImmutableMap.<K, Set<V>> builder();
|
||||
ImmutableMap.Builder<K, Set<V>> out = ImmutableMap.builder();
|
||||
for (K type : in.keySet())
|
||||
out.put(type, ImmutableSet.copyOf(in.get(type)));
|
||||
return out.build();
|
||||
|
@ -55,7 +55,7 @@ public class Multimaps2 {
|
|||
*/
|
||||
@Deprecated
|
||||
public static <K, V> ImmutableMultimap<K, V> fromOldSchool(Map<K, Set<V>> in) {
|
||||
Builder<K, V> out = ImmutableMultimap.<K, V> builder();
|
||||
Builder<K, V> out = ImmutableMultimap.builder();
|
||||
for (K type : in.keySet())
|
||||
out.putAll(type, ImmutableSet.copyOf(in.get(type)));
|
||||
return out.build();
|
||||
|
|
|
@ -36,7 +36,7 @@ public class SaxUtils {
|
|||
}
|
||||
|
||||
public static Map<String, String> cleanseAttributes(Attributes in) {
|
||||
Builder<String, String> attrs = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> attrs = ImmutableMap.builder();
|
||||
for (int i = 0; i < in.getLength(); i++) {
|
||||
String name = in.getQName(i);
|
||||
if (name.indexOf(':') != -1)
|
||||
|
|
|
@ -156,7 +156,7 @@ public class GleSYSComputeServiceAdapter implements ComputeServiceAdapter<Server
|
|||
@Override
|
||||
public Iterable<Hardware> listHardwareProfiles() {
|
||||
Set<? extends Location> locationsSet = locations.get();
|
||||
ImmutableSet.Builder<Hardware> hardwareToReturn = ImmutableSet.<Hardware> builder();
|
||||
ImmutableSet.Builder<Hardware> hardwareToReturn = ImmutableSet.builder();
|
||||
|
||||
// do this loop after dupes are filtered, else OOM
|
||||
Set<OSTemplate> images = listImages();
|
||||
|
@ -167,7 +167,7 @@ public class GleSYSComputeServiceAdapter implements ComputeServiceAdapter<Server
|
|||
for (int diskSizeGB : platformToArgs.getValue().getDiskSizesInGB())
|
||||
for (int cpuCores : platformToArgs.getValue().getCpuCoreOptions())
|
||||
for (int memorySizeMB : platformToArgs.getValue().getMemorySizesInMB()) {
|
||||
ImmutableSet.Builder<String> templatesSupportedBuilder = ImmutableSet.<String> builder();
|
||||
ImmutableSet.Builder<String> templatesSupportedBuilder = ImmutableSet.builder();
|
||||
for (OSTemplate template : images) {
|
||||
if (template.getPlatform().equals(platformToArgs.getKey())
|
||||
&& diskSizeGB >= template.getMinDiskSize() && memorySizeMB >= template.getMinMemSize())
|
||||
|
|
|
@ -53,7 +53,7 @@ public class CreateServerOptions implements MapBinder {
|
|||
GeneratedHttpRequest<?> gRequest = (GeneratedHttpRequest<?>) request;
|
||||
checkState(gRequest.getArgs() != null, "args should be initialized at this point");
|
||||
|
||||
ImmutableMultimap.Builder<String, String> formParams = ImmutableMultimap.<String, String> builder();
|
||||
ImmutableMultimap.Builder<String, String> formParams = ImmutableMultimap.builder();
|
||||
formParams.putAll(forMap(postParams));
|
||||
ServerSpec serverSpec = ServerSpec.class.cast(find(gRequest.getArgs(), instanceOf(ServerSpec.class)));
|
||||
formParams.put("datacenter", serverSpec.getDatacenter());
|
||||
|
|
|
@ -134,7 +134,7 @@ public class ServerClientExpectTest extends BaseRestClientExpectTest<GleSYSClien
|
|||
.put("Authorization", "Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==").build()).build(),
|
||||
HttpResponse.builder().statusCode(200).payload(payloadFromResource("/server_templates.json")).build()).getServerClient();
|
||||
|
||||
ImmutableSet.Builder<OSTemplate> expectedBuilder = ImmutableSet.<OSTemplate> builder();
|
||||
ImmutableSet.Builder<OSTemplate> expectedBuilder = ImmutableSet.builder();
|
||||
|
||||
for (String name : new String[] { "Centos 5", "Centos 5 64-bit", "Centos 6 32-bit", "Centos 6 64-bit",
|
||||
"Debian 5.0 32-bit", "Debian 5.0 64-bit", "Debian 6.0 32-bit", "Debian 6.0 64-bit", "Fedora Core 11",
|
||||
|
|
|
@ -126,7 +126,7 @@ public class VPDCComputeServiceAdapter implements ComputeServiceAdapter<VM, VMSp
|
|||
|
||||
@Override
|
||||
public Iterable<VM> listNodes() {
|
||||
Builder<VM> builder = ImmutableSet.<VM> builder();
|
||||
Builder<VM> builder = ImmutableSet.builder();
|
||||
for (Resource org1 : client.listOrgs()) {
|
||||
Org org = client.getBrowsingClient().getOrg(org1.getId());
|
||||
for (Resource vdc : org.getVDCs()) {
|
||||
|
@ -149,7 +149,7 @@ public class VPDCComputeServiceAdapter implements ComputeServiceAdapter<VM, VMSp
|
|||
|
||||
@Override
|
||||
public Iterable<Network> listLocations() {
|
||||
Builder<Network> builder = ImmutableSet.<Network> builder();
|
||||
Builder<Network> builder = ImmutableSet.builder();
|
||||
for (Resource org1 : client.listOrgs()) {
|
||||
Org org = client.getBrowsingClient().getOrg(org1.getId());
|
||||
for (Resource vdc : org.getVDCs()) {
|
||||
|
|
|
@ -81,7 +81,7 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static Map<String, String> cleanseAttributes(Attributes in) {
|
||||
Builder<String, String> attrs = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> attrs = ImmutableMap.builder();
|
||||
for (int i = 0; i < in.getLength(); i++) {
|
||||
String name = in.getQName(i);
|
||||
if (name.indexOf(':') != -1)
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||
*/
|
||||
public class OrgListHandler extends ParseSax.HandlerWithResult<Set<Resource>> {
|
||||
|
||||
private Builder<Resource> org = ImmutableSet.<Resource> builder();
|
||||
private Builder<Resource> org = ImmutableSet.builder();
|
||||
|
||||
public Set<Resource> getResult() {
|
||||
try {
|
||||
|
|
|
@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||
*/
|
||||
public class TasksListHandler extends ParseSax.HandlerWithResult<Set<Task>> {
|
||||
|
||||
private Builder<Task> tasks = ImmutableSet.<Task> builder();
|
||||
private Builder<Task> tasks = ImmutableSet.builder();
|
||||
private final TaskHandler taskHandler;
|
||||
|
||||
@Inject
|
||||
|
|
|
@ -170,7 +170,7 @@ public class VMClientLiveTest extends BaseVPDCClientLiveTest {
|
|||
System.out.printf("Creating vm's - vpdcId %s, vpdcName %s, networkName %s, name %s, os %s%n", vpdcId, vpdc.getName(), networkTier
|
||||
.getName().replace("-", " "), name, os);
|
||||
|
||||
Builder<VMSpec> vmSpecs = ImmutableSet.<VMSpec> builder();
|
||||
Builder<VMSpec> vmSpecs = ImmutableSet.builder();
|
||||
int noOfVms = 2;
|
||||
for (int i = 0; i < noOfVms; i++) {
|
||||
// TODO: determine the sizes available in the VDC, for example there's
|
||||
|
|
|
@ -53,7 +53,7 @@ public class BindLaunchSpecificationToFormParams implements Binder, Function<Lau
|
|||
|
||||
@Override
|
||||
public Map<String, String> apply(LaunchSpecification launchSpec) {
|
||||
Builder<String, String> builder = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMap.builder();
|
||||
builder.put("LaunchSpecification.ImageId", checkNotNull(launchSpec.getImageId(), "imageId"));
|
||||
if (launchSpec.getAvailabilityZone() != null)
|
||||
builder.put("LaunchSpecification.Placement.AvailabilityZone", launchSpec.getAvailabilityZone());
|
||||
|
|
|
@ -149,7 +149,7 @@ public class AWSEC2ImageSupplier implements Supplier<Set<? extends Image>> {
|
|||
INSTANCE;
|
||||
@Override
|
||||
public Multimap<String, String> apply(String arg0) {
|
||||
ImmutableMultimap.Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
ImmutableMultimap.Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
for (String pair : Splitter.on(';').split(arg0)) {
|
||||
String[] keyValue = pair.split("=");
|
||||
if (keyValue.length == 1)
|
||||
|
|
|
@ -76,7 +76,7 @@ public class CallForImages implements Callable<Iterable<Image>> {
|
|||
|
||||
logger.debug(">> providing images");
|
||||
|
||||
Builder<String, DescribeImagesOptions> builder = ImmutableMap.<String, DescribeImagesOptions> builder();
|
||||
Builder<String, DescribeImagesOptions> builder = ImmutableMap.builder();
|
||||
for (String region : regions)
|
||||
builder.put(region, filters(filter));
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class LaunchSpecification {
|
|||
}
|
||||
|
||||
public static class Builder {
|
||||
protected ImmutableMap.Builder<String, String> securityGroupIdToNames = ImmutableMap.<String, String> builder();
|
||||
protected ImmutableMap.Builder<String, String> securityGroupIdToNames = ImmutableMap.builder();
|
||||
protected String imageId;
|
||||
protected String instanceType;
|
||||
protected String kernelId;
|
||||
|
@ -57,13 +57,13 @@ public class LaunchSpecification {
|
|||
protected String ramdiskId;
|
||||
protected Boolean monitoringEnabled;
|
||||
protected ImmutableSet.Builder<BlockDeviceMapping> blockDeviceMappings = ImmutableSet
|
||||
.<BlockDeviceMapping> builder();
|
||||
protected ImmutableSet.Builder<String> securityGroupIds = ImmutableSet.<String> builder();
|
||||
protected ImmutableSet.Builder<String> securityGroupNames = ImmutableSet.<String> builder();
|
||||
.builder();
|
||||
protected ImmutableSet.Builder<String> securityGroupIds = ImmutableSet.builder();
|
||||
protected ImmutableSet.Builder<String> securityGroupNames = ImmutableSet.builder();
|
||||
protected byte[] userData;
|
||||
|
||||
public void clear() {
|
||||
securityGroupIdToNames = ImmutableMap.<String, String> builder();
|
||||
securityGroupIdToNames = ImmutableMap.builder();
|
||||
imageId = null;
|
||||
instanceType = null;
|
||||
kernelId = null;
|
||||
|
@ -71,9 +71,9 @@ public class LaunchSpecification {
|
|||
availabilityZone = null;
|
||||
ramdiskId = null;
|
||||
monitoringEnabled = false;
|
||||
blockDeviceMappings = ImmutableSet.<BlockDeviceMapping> builder();
|
||||
securityGroupIds = ImmutableSet.<String> builder();
|
||||
securityGroupNames = ImmutableSet.<String> builder();
|
||||
blockDeviceMappings = ImmutableSet.builder();
|
||||
securityGroupIds = ImmutableSet.builder();
|
||||
securityGroupNames = ImmutableSet.builder();
|
||||
userData = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||
public class DescribeSpotPriceHistoryResponseHandler extends
|
||||
ParseSax.HandlerWithResult<Set<Spot>> {
|
||||
|
||||
private Builder<Spot> spots = ImmutableSet.<Spot>builder();
|
||||
private Builder<Spot> spots = ImmutableSet.builder();
|
||||
private final SpotHandler spotHandler;
|
||||
|
||||
@Inject
|
||||
|
|
|
@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSet.Builder;
|
|||
*/
|
||||
public class SpotInstancesHandler extends ParseSax.HandlerWithResult<Set<SpotInstanceRequest>> {
|
||||
|
||||
private final Builder<SpotInstanceRequest> spotRequests = ImmutableSet.<SpotInstanceRequest> builder();
|
||||
private final Builder<SpotInstanceRequest> spotRequests = ImmutableSet.builder();
|
||||
private final SpotInstanceHandler spotRequestHandler;
|
||||
private int itemDepth;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class TagSetHandler extends ParseSax.HandlerForGeneratedRequestWithResult
|
|||
@Override
|
||||
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
|
||||
if (equalsOrSuffix(qName, "tagSet")) {
|
||||
result = ImmutableMap.<String, String>builder();
|
||||
result = ImmutableMap.builder();
|
||||
} else if (qName.equals("item")) {
|
||||
inItem = true;
|
||||
key = null;
|
||||
|
|
|
@ -59,7 +59,7 @@ public class BindObjectMetadataToRequest implements Binder {
|
|||
|
||||
request = metadataPrefixer.bindToRequest(request, md.getUserMetadata());
|
||||
|
||||
Builder<String, String> headers = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> headers = ImmutableMultimap.builder();
|
||||
if (md.getCacheControl() != null) {
|
||||
headers.put(HttpHeaders.CACHE_CONTROL, md.getCacheControl());
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class BindAzureBlobMetadataToRequest implements Binder {
|
|||
checkArgument(blob.getPayload().getContentMetadata().getContentLength() != null
|
||||
&& blob.getPayload().getContentMetadata().getContentLength() >= 0, "size must be set");
|
||||
|
||||
Builder<String, String> headers = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> headers = ImmutableMap.builder();
|
||||
|
||||
headers.put("x-ms-blob-type", blob.getProperties().getType().toString());
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class SoftLayerPropertiesBuilder extends PropertiesBuilder {
|
|||
// 10, 100, 1000
|
||||
properties.setProperty(PROPERTY_SOFTLAYER_VIRTUALGUEST_PORT_SPEED, "10");
|
||||
properties.setProperty(PROPERTY_ISO3166_CODES, "SG,NL,US-CA,US-TX,US-VA,US-WA,US-TX");
|
||||
Builder<String> prices = ImmutableSet.<String> builder();
|
||||
Builder<String> prices = ImmutableSet.builder();
|
||||
prices.add("21"); // 1 IP Address
|
||||
prices.add("55"); // Host Ping: categoryCode: monitoring, notification
|
||||
prices.add("57"); // Email and Ticket: categoryCode: notification
|
||||
|
|
|
@ -146,7 +146,7 @@ public class SoftLayerComputeServiceAdapter implements
|
|||
}
|
||||
|
||||
private Iterable<ProductItemPrice> getPrices(Template template) {
|
||||
Builder<ProductItemPrice> result = ImmutableSet.<ProductItemPrice> builder();
|
||||
Builder<ProductItemPrice> result = ImmutableSet.builder();
|
||||
|
||||
int imageId = Integer.parseInt(template.getImage().getId());
|
||||
result.add(ProductItemPrice.builder().id(imageId).build());
|
||||
|
@ -167,7 +167,7 @@ public class SoftLayerComputeServiceAdapter implements
|
|||
public Iterable<Iterable<ProductItem>> listHardwareProfiles() {
|
||||
ProductPackage productPackage = productPackageSupplier.get();
|
||||
Set<ProductItem> items = productPackage.getItems();
|
||||
Builder<Iterable<ProductItem>> result = ImmutableSet.<Iterable<ProductItem>> builder();
|
||||
Builder<Iterable<ProductItem>> result = ImmutableSet.builder();
|
||||
for (ProductItem cpuItem : filter(items, matches(cpuPattern))) {
|
||||
for (ProductItem ramItem : filter(items, categoryCode("ram"))) {
|
||||
for (ProductItem sanItem : filter(items, and(matches(disk0Type), categoryCode("guest_disk0")))) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class DatacenterClientLiveTest extends BaseSoftLayerClientLiveTest {
|
|||
|
||||
@Test
|
||||
public void testListDatacentersContent() {
|
||||
Builder<Datacenter> builder = ImmutableSet.<Datacenter> builder();
|
||||
Builder<Datacenter> builder = ImmutableSet.builder();
|
||||
builder.add(Datacenter.builder().id(265592).name("ams01").longName("Amsterdam 1").build());
|
||||
builder.add(Datacenter.builder().id(3).name("dal01").longName("Dallas").build());
|
||||
builder.add(Datacenter.builder().id(18171).name("sea01").longName("Seattle").build());
|
||||
|
|
|
@ -116,7 +116,7 @@ public class VirtualGuestClientLiveTest extends BaseSoftLayerClientLiveTest {
|
|||
ProductItemPrice osPrice = ProductItems.price().apply(
|
||||
osToProductItem.get("Ubuntu Linux 8 LTS Hardy Heron - Minimal Install (64 bit)"));
|
||||
|
||||
Builder<ProductItemPrice> prices = ImmutableSet.<ProductItemPrice> builder();
|
||||
Builder<ProductItemPrice> prices = ImmutableSet.builder();
|
||||
prices.addAll(Guice.createInjector(module).getInstance(Key.get(new TypeLiteral<Iterable<ProductItemPrice>>() {
|
||||
})));
|
||||
prices.add(ramPrice);
|
||||
|
|
|
@ -34,7 +34,7 @@ import com.google.common.collect.ImmutableMap.Builder;
|
|||
public class TagNameToUsageCountHandler extends ParseSax.HandlerWithResult<Map<String, Integer>> {
|
||||
protected StringBuilder currentText = new StringBuilder();
|
||||
|
||||
private Builder<String, Integer> builder = ImmutableMap.<String, Integer> builder();
|
||||
private Builder<String, Integer> builder = ImmutableMap.builder();
|
||||
private String name;
|
||||
|
||||
public Map<String, Integer> getResult() {
|
||||
|
|
|
@ -49,7 +49,7 @@ public class BindAttributesToIndexedFormParams implements Binder {
|
|||
checkArgument(checkNotNull(input, "input") instanceof Item, "this binder is only valid for AttributeMap");
|
||||
Item attributeMap = (Item) input;
|
||||
|
||||
Builder<String, String> builder = ImmutableMultimap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMultimap.builder();
|
||||
int amazonOneBasedIndex = 1; // according to docs, counters must start with 1
|
||||
for (String itemName : attributeMap.getAttributes().keySet()) {
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ public class ScriptBuilder implements Statement, AcceptsStatementVisitor {
|
|||
@VisibleForTesting
|
||||
public static Map<String, String> resolveFunctionDependenciesForStatements(Map<String, String> knownFunctions,
|
||||
Iterable<Statement> statements, final OsFamily osFamily) {
|
||||
Builder<String, String> builder = ImmutableMap.<String, String> builder();
|
||||
Builder<String, String> builder = ImmutableMap.builder();
|
||||
builder.putAll(knownFunctions);
|
||||
Set<String> dependentFunctions = ImmutableSet.copyOf(Iterables.concat(Iterables.transform(statements,
|
||||
new Function<Statement, Iterable<String>>() {
|
||||
|
|
|
@ -121,7 +121,7 @@ public class CreateRunScript extends StatementList {
|
|||
|
||||
private void addUnixRunScript(String runScript, StringBuilder builder) {
|
||||
builder.append("# add desired commands from the user\n");
|
||||
Builder<String> userCommands = ImmutableList.<String>builder();
|
||||
Builder<String> userCommands = ImmutableList.builder();
|
||||
userCommands.add("cd " + pwd);
|
||||
for (Statement statement : statements) {
|
||||
if (statement instanceof Call
|
||||
|
@ -137,7 +137,7 @@ public class CreateRunScript extends StatementList {
|
|||
private void addUnixRunScriptHeader(String runScript, StringBuilder builder) {
|
||||
builder.append("# create runscript header\n");
|
||||
|
||||
Builder<String> beginningOfFile = ImmutableList.<String> builder();
|
||||
Builder<String> beginningOfFile = ImmutableList.builder();
|
||||
beginningOfFile.addAll(Splitter.on(ShellToken.LF.to(OsFamily.UNIX)).split(
|
||||
ShellToken.BEGIN_SCRIPT.to(OsFamily.UNIX)));
|
||||
beginningOfFile.add(format("PROMPT_COMMAND='echo -ne \\\"\\033]0;%s\\007\\\"'", instanceName));
|
||||
|
|
|
@ -53,7 +53,7 @@ public class StatementList extends ForwardingList<Statement> implements Statemen
|
|||
|
||||
@Override
|
||||
public Iterable<String> functionDependencies(OsFamily family) {
|
||||
Builder<String> functions = ImmutableList.<String> builder();
|
||||
Builder<String> functions = ImmutableList.builder();
|
||||
for (Statement statement : delegate()) {
|
||||
functions.addAll(statement.functionDependencies(family));
|
||||
}
|
||||
|
|
|
@ -361,7 +361,7 @@ public class AdminAccess implements Statement {
|
|||
checkNotNull(config.getAdminPrivateKey(), "adminPrivateKey");
|
||||
checkNotNull(config.getLoginPassword(), "loginPassword");
|
||||
|
||||
ImmutableList.Builder<Statement> statements = ImmutableList.<Statement> builder();
|
||||
ImmutableList.Builder<Statement> statements = ImmutableList.builder();
|
||||
UserAdd.Builder userBuilder = UserAdd.builder();
|
||||
userBuilder.login(config.getAdminUsername());
|
||||
if (config.shouldAuthorizeAdminPublicKey())
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Sudoers implements Statement {
|
|||
checkNotNull(family, "family");
|
||||
if (family == OsFamily.WINDOWS)
|
||||
throw new UnsupportedOperationException("windows not yet implemented");
|
||||
Builder<Statement> statements = ImmutableList.<Statement> builder();
|
||||
Builder<Statement> statements = ImmutableList.builder();
|
||||
statements.add(createOrOverwriteFile(sudoers, ImmutableSet.of("root ALL = (ALL) ALL", "%wheel ALL = (ALL) NOPASSWD:ALL")));
|
||||
statements.add(exec("chmod 0440 " + sudoers));
|
||||
return new StatementList(statements.build()).render(family);
|
||||
|
|
|
@ -160,11 +160,11 @@ public class UserAdd implements Statement {
|
|||
if (family == OsFamily.WINDOWS)
|
||||
throw new UnsupportedOperationException("windows not yet implemented");
|
||||
String homeDir = defaultHome + "{fs}" + login;
|
||||
ImmutableList.Builder<Statement> statements = ImmutableList.<Statement> builder();
|
||||
ImmutableList.Builder<Statement> statements = ImmutableList.builder();
|
||||
// useradd cannot create the default homedir
|
||||
statements.add(Statements.exec("{md} " + defaultHome));
|
||||
|
||||
ImmutableMap.Builder<String, String> userAddOptions = ImmutableMap.<String, String> builder();
|
||||
ImmutableMap.Builder<String, String> userAddOptions = ImmutableMap.builder();
|
||||
userAddOptions.put("-s", shell);
|
||||
if (groups.size() > 0) {
|
||||
for (String group : groups)
|
||||
|
|
|
@ -61,11 +61,11 @@ public class AuthorizeRSAPublicKeys implements Statement {
|
|||
checkNotNull(family, "family");
|
||||
if (family == OsFamily.WINDOWS)
|
||||
throw new UnsupportedOperationException("windows not yet implemented");
|
||||
Builder<Statement> statements = ImmutableList.<Statement> builder();
|
||||
Builder<Statement> statements = ImmutableList.builder();
|
||||
statements.add(exec("mkdir -p " + sshDir));
|
||||
String authorizedKeys = sshDir + "{fs}authorized_keys";
|
||||
statements.add(appendFile(authorizedKeys, Splitter.on('\n').split(Joiner.on("\n\n").join(publicKeys))));
|
||||
statements.add(exec("chmod 600 " + authorizedKeys));
|
||||
return new StatementList(statements.build()).render(family);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class InstallRSAPrivateKey implements Statement {
|
|||
checkNotNull(family, "family");
|
||||
if (family == OsFamily.WINDOWS)
|
||||
throw new UnsupportedOperationException("windows not yet implemented");
|
||||
Builder<Statement> statements = ImmutableList.<Statement> builder();
|
||||
Builder<Statement> statements = ImmutableList.builder();
|
||||
statements.add(exec("{md} " + sshDir));
|
||||
String idRsa = sshDir + "{fs}id_rsa";
|
||||
statements.add(exec("{rm} " + idRsa));
|
||||
|
|
Loading…
Reference in New Issue