ImageManifestFile.java (eucalyptus-4.4.1) | : | ImageManifestFile.java (eucalyptus-4.4.2) | ||
---|---|---|---|---|
skipping to change at line 28 | skipping to change at line 28 | |||
* additional information or have any questions. | * additional information or have any questions. | |||
************************************************************************/ | ************************************************************************/ | |||
package com.eucalyptus.imaging.manifest; | package com.eucalyptus.imaging.manifest; | |||
import com.eucalyptus.util.EucalyptusCloudException; | import com.eucalyptus.util.EucalyptusCloudException; | |||
public class ImageManifestFile { | public class ImageManifestFile { | |||
private final ImageManifest manifestType; | private final ImageManifest manifestType; | |||
private final String location; | private final String location; | |||
private final int manifestSizeLimit; | private final int manifestSizeLimit; | |||
private volatile String baseBucket; | ||||
private volatile String prefix; | ||||
public ImageManifestFile(String location, ImageManifest type, | public ImageManifestFile(String location, ImageManifest type, | |||
int manifestSizeLimit) { | int manifestSizeLimit) { | |||
this.manifestType = type; | this.manifestType = type; | |||
this.location = location; | this.location = location; | |||
this.manifestSizeLimit = manifestSizeLimit; | this.manifestSizeLimit = manifestSizeLimit; | |||
} | } | |||
public ImageManifest getManifestType() { | public ImageManifest getManifestType() { | |||
// TODO: return it base on manifest content | // TODO: return it base on manifest content | |||
return manifestType; | return manifestType; | |||
} | } | |||
public String getManifest() throws EucalyptusCloudException { | public String getManifest() throws EucalyptusCloudException { | |||
return manifestType.getManifest(this.location, this.manifestSizeLimit); | return manifestType.getManifest(this.location, this.manifestSizeLimit); | |||
} | } | |||
public String getBaseBucket() throws EucalyptusCloudException { | public String getBaseBucket() throws EucalyptusCloudException { | |||
return manifestType.getBaseBucket(this.location); | if ( baseBucket == null ) { | |||
baseBucket = manifestType.getBaseBucket( this.location ); | ||||
} | ||||
return baseBucket; | ||||
} | ||||
public String getPrefix() throws EucalyptusCloudException { | ||||
if ( prefix == null ) { | ||||
prefix = manifestType.getPrefix( this.location ); | ||||
} | ||||
return prefix; | ||||
} | } | |||
public int getManifestSizeLimit() { | public int getManifestSizeLimit() { | |||
return manifestSizeLimit; | return manifestSizeLimit; | |||
} | } | |||
} | } | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 13 lines changed or added |