BundleImageManifest.java (eucalyptus-4.4.1) | : | BundleImageManifest.java (eucalyptus-4.4.2) | ||
---|---|---|---|---|
skipping to change at line 81 | skipping to change at line 81 | |||
Accounts.lookupSystemAccountByAlias( AccountIdentifiers.AWS_EXEC_READ_SY STEM_ACCOUNT ), | Accounts.lookupSystemAccountByAlias( AccountIdentifiers.AWS_EXEC_READ_SY STEM_ACCOUNT ), | |||
(int)TimeUnit.MINUTES.toSeconds( 15 ))) { | (int)TimeUnit.MINUTES.toSeconds( 15 ))) { | |||
return s3Client.getObjectContent(bucketName, manifestKey, maximumSize); | return s3Client.getObjectContent(bucketName, manifestKey, maximumSize); | |||
} catch (Exception e) { | } catch (Exception e) { | |||
throw new EucalyptusCloudException("Failed to read manifest file: " | throw new EucalyptusCloudException("Failed to read manifest file: " | |||
+ bucketName + "/" + manifestKey, e); | + bucketName + "/" + manifestKey, e); | |||
} | } | |||
} | } | |||
@Override | @Override | |||
public String getPrefix(String location) { | ||||
final String cleanLocation = clean( location ); | ||||
final int index = cleanLocation.indexOf('/') + 1; | ||||
final int endIndex = cleanLocation.lastIndexOf('/'); | ||||
return endIndex > index ? | ||||
cleanLocation.substring( index, endIndex ) : | ||||
""; | ||||
} | ||||
@Override | ||||
public String getBaseBucket(String location) { | public String getBaseBucket(String location) { | |||
String cleanLocation = location.replaceAll("^/*", ""); | final String cleanLocation = clean( location ); | |||
int index = cleanLocation.indexOf('/'); | final int index = cleanLocation.indexOf('/'); | |||
return cleanLocation.substring(0, index); | return cleanLocation.substring(0, index); | |||
} | } | |||
private String clean( final String location ) { | ||||
return location.replaceAll("^/*", ""); | ||||
} | ||||
} | } | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 16 lines changed or added |