public static DockerImage fromImageName(String imageName){
  imageName=prepare(imageName);
  String[] parts=imageName.split(SECTION_SEPARATOR);
switch (parts.length) {
case 1:
    return fromParts(null,null,parts[0]);
case 2:
  if (isValidNamespace(parts[0])) {
    return fromParts(null,parts[0],parts[1]);
  }
 else {
    return fromParts(parts[0],null,parts[1]);
  }
case 3:
return fromParts(parts[0],parts[1],parts[2]);
default :
throw new IllegalArgumentException("Invalid image format: " + imageName);
}
}

public static DockerImage fromImageName ( String imageName ) { imageName = prepare ( imageName ) ; String [ ] parts = imageName . split ( SECTION_SEPARATOR ) ; switch ( parts . length ) { case 1 : return fromParts ( null , null , parts [ 0 ] ) ; case 2 : if ( isValidNamespace ( parts [ 0 ] ) ) { return fromParts ( null , parts [ 0 ] , parts [ 1 ] ) ; } else { return fromParts ( parts [ 0 ] , null , parts [ 1 ] ) ; } case 3 : return fromParts ( parts [ 0 ] , parts [ 1 ] , parts [ 2 ] ) ; default : throw new IllegalArgumentException ( "Invalid image format: " + imageName ) ; } }
parse a full image name ( myhost : 300 / namespace / repo : tag ) into its components
