// b : standard image
// p : custom image
commandList.add(new Command("b", Actions.OP_BASE,
- "Select ID of base disk image. (Currently, only 1 is avaliable)",
+ "Select ID of base disk image.\n\t\t(Avaliable disk image can be found using 'list-image' command)",
"1", false, true));
commandList.add(new Command("p", Actions.OP_PATH,
"Select path of base target image.", "", false, true));
prop.load(new FileInputStream(f));
platformName = prop.getProperty(StringResource.IMAGE_PLATFORM, platform.getVersion());
type = prop.getProperty(StringResource.IMAGE_TYPE, "default");
- name = prop.getProperty(StringResource.IMAGE_NAME);
+ name = prop.getProperty(StringResource.IMAGE_NAME).toLowerCase();
if (name == null) {
throw new Exception();
}
File defaultImages = new File(platform_path + FilePath.getInstance().getDefaultImagePath());
File addonsImages = new File(platform_path + FilePath.getInstance().getAddonsImagePath());
+ //boolean isDuplicate = false;
if(defaultImages.exists() && defaultImages.isDirectory()) {
+ BaseImage image;
for (File f : defaultImages.listFiles()) {
if (f.isDirectory()) {
try {
- imageList.add(new BaseImage(this, f, ++id));
+ image = new BaseImage(this, f, ++id);
+ for (BaseImage i : imageList) {
+ if (i.getName().equals(image.getName())){
+ // TODO: duplicate name...
+ EMLogger.getLogger().warning("The same name of the base disk image already exist.(name : " + image.getName() + " )");
+ --id;
+ throw new Exception();
+ }
+ }
+ imageList.add(image);
} catch (Exception e) {
- EMLogger.getLogger().warning("Failed adding base image..\n" + f.getAbsolutePath());
+ EMLogger.getLogger().warning("Failed adding base image..\n" + "Base Disk Image Path: " + f.getAbsolutePath());
}
}
}
}
if (addonsImages.exists() && addonsImages.isDirectory()) {
+ BaseImage image;
for (File f : addonsImages.listFiles()) {
if (f.isDirectory()) {
try {
- imageList.add(new BaseImage(this, f, ++id));
+ image = new BaseImage(this, f, ++id);
+ for (BaseImage i : imageList) {
+ if (i.getName().equals(image.getName())){
+ // TODO: duplicate name...
+ EMLogger.getLogger().warning("The same name of the base disk image already exist.(name : " + image.getName() + " )");
+ --id;
+ throw new Exception();
+ }
+ }
+ imageList.add(image);
} catch (Exception e) {
- EMLogger.getLogger().warning("Failed adding base image..\n" + f.getAbsolutePath());
+ EMLogger.getLogger().warning("Failed adding base image..\n" + "Base Disk Image Path: " + f.getAbsolutePath());
}
}
}