Examples of InvalidVersionException


Examples of biz.massivedynamics.versioneer.exceptions.InvalidVersionException

        //Set up an initial (null) abstract version
        Version version = null;

        //Check to see if the string is empty
        if (versionAsString.isEmpty()) {
            throw new InvalidVersionException("Can't create a blank version!");
        }

        //Set up a split
        String[] versionParts = versionAsString.split("\\.");

        //Switch by the number of version parts
        switch (versionParts.length) {
            case 4: {
                int major = Integer.valueOf(versionParts[0]);
                int minor = Integer.valueOf(versionParts[1]);
                int build = Integer.valueOf(versionParts[2]);
                int revision;
                if (versionParts[3].contains("-") || versionParts[3].contains(" ")) {
                    revision = Integer.valueOf(versionParts[3].split("[ -]")[0]);
                } else {
                    revision = Integer.valueOf(versionParts[3]);
                }

                version = new FourPartVersion(major, minor, build, revision);
            }
            break;

            case 3: {
                int major = Integer.valueOf(versionParts[0]);
                int minor = Integer.valueOf(versionParts[1]);
                int build;
                if (versionParts[2].contains("-") || versionParts[2].contains(" ")) {
                    build = Integer.valueOf(versionParts[2].split("[ -]")[0]);
                } else {
                    build = Integer.valueOf(versionParts[2]);
                }

                version = new ThreePartVersion(major, minor, build);
            }
            break;

            case 2: {
                int major = Integer.valueOf(versionParts[0]);
                int minor;
                if (versionParts[1].contains("-") || versionParts[1].contains(" ")) {
                    minor = Integer.valueOf(versionParts[1].split("[ -]")[0]);
                } else {
                    minor = Integer.valueOf(versionParts[1]);
                }

                version = new TwoPartVersion(major, minor);
            }
            break;

            case 1: {
                int _version;
                if (versionParts[0].contains("-") || versionParts[0].contains(" ")) {
                    _version = Integer.valueOf(versionParts[0].split("[ -]")[0]);
                } else {
                    _version = Integer.valueOf(versionParts[0]);
                }

                version = new NumericVersion(_version);
            }
            break;
        }

        //Check the version before we start on the rest
        if (version == null) {
            throw new InvalidVersionException("Version \"" + versionAsString + "\" could not be decoded");
        }
       
        //Get the last part
        String lastPart = versionParts[versionParts.length - 1];
       
View Full Code Here

Examples of com.adobe.epubcheck.util.InvalidVersionException

        report.info(null, FeatureEnum.FORMAT_VERSION, EPUBVersion.VERSION_2.toString());
        return EPUBVersion.VERSION_2;
      }
      else if (InvalidVersionException.UNSUPPORTED_VERSION.equals(e.getMessage()))
      {
        throw new InvalidVersionException(InvalidVersionException.UNSUPPORTED_VERSION);
      }
      else if (InvalidVersionException.VERSION_ATTRIBUTE_NOT_FOUND.equals(e.getMessage()))
      {
        throw new InvalidVersionException(InvalidVersionException.VERSION_ATTRIBUTE_NOT_FOUND);
      }
      else if (InvalidVersionException.PACKAGE_ELEMENT_NOT_FOUND.equals(e.getMessage()))
      {
        throw new InvalidVersionException(InvalidVersionException.PACKAGE_ELEMENT_NOT_FOUND);
      }
      else
      {
        report.message(MessageId.RSC_005, new MessageLocation(path, -1, -1), e.getMessage());
      }
    }
    catch (IOException e)
    {
      report.message(MessageId.PKG_008, new MessageLocation(path, -1, -1), path);
    }
    throw new InvalidVersionException(InvalidVersionException.VERSION_NOT_FOUND);
  }
View Full Code Here

Examples of com.adobe.epubcheck.util.InvalidVersionException

            version = EPUBVersion.VERSION_3;
          }
          else
          {
            outWriter.println(Messages.get("display_help"));
            throw new RuntimeException(new InvalidVersionException(
                InvalidVersionException.UNSUPPORTED_VERSION));
          }
        }
        else
        {
View Full Code Here

Examples of com.adobe.epubcheck.util.InvalidVersionException

    } catch (IOException e)
    {
      report
          .message(MessageId.PKG_008, new MessageLocation(path, -1, -1), path);
    }
    throw new InvalidVersionException(InvalidVersionException.VERSION_NOT_FOUND);
  }
View Full Code Here

Examples of com.adobe.epubcheck.util.InvalidVersionException

      {
        processPackage(attributes);
        isPackageRoot = true;
      } else if (!isPackageRoot)
      {
        throw new InvalidVersionException(
            InvalidVersionException.PACKAGE_ELEMENT_NOT_FOUND);
      } else if ("type".equals(localName) && EpubConstants.DCElements.equals(uri))
      {
        currentText = "";
      } else if ("identifier".equals(localName) && EpubConstants.DCElements.equals(uri)) {
View Full Code Here

Examples of com.adobe.epubcheck.util.InvalidVersionException

      throws SAXException
    {
      String version = attributes.getValue("version");
      if (version == null)
      {
        throw new InvalidVersionException(
            InvalidVersionException.VERSION_ATTRIBUTE_NOT_FOUND);
      } else if (VERSION_3.equals(version))
      {
        builder.withVersion(EPUBVersion.VERSION_3);
      } else if (VERSION_2.equals(version))
      {
        builder.withVersion(EPUBVersion.VERSION_2);
      } else
      {
        throw new InvalidVersionException(
            InvalidVersionException.UNSUPPORTED_VERSION);
      }
      String uniqueId = attributes.getValue("unique-identifier");
      if (uniqueId != null)
        this.uniqueId  = uniqueId;
View Full Code Here

Examples of org.glite.authz.pap.repository.exceptions.InvalidVersionException

                throw new RepositoryException(e);
            }
        }

        if (!(oldPolicy.getVersion().equals(version))) {
            throw new InvalidVersionException(String.format("Attempting to update the wrong version of PolicyId=\"%s\" (requestedVersion=\"%s\", repositoryVersion=\"%s\")",
                                                            policyId,
                                                            version,
                                                            oldPolicy.getVersion()));
        }
View Full Code Here

Examples of org.glite.authz.pap.repository.exceptions.InvalidVersionException

     */
    private static void checkVersion() {
        String repositoryVersion = FileSystemRepositoryManager.getInstance().getRepositoryVersion();

        if (!(REPOSITORY_MANAGER_VERSION.equals(repositoryVersion))) {
            throw new InvalidVersionException("Invalid repository version (v" + repositoryVersion
                    + "). Requested version is v" + REPOSITORY_MANAGER_VERSION);
        }

        log.info("Repository version: v" + repositoryVersion);
    }
View Full Code Here

Examples of org.glite.authz.pap.repository.exceptions.InvalidVersionException

        String repositoryVersion = oldPolicySetString.getVersion();
        TypeStringUtils.releaseUnneededMemory(oldPolicySetString);

        if (!(repositoryVersion.equals(policySetVersion))) {
            throw new InvalidVersionException(String.format("Attempting to update the wrong version of PolicySetId=\"%s\" (requestedVersion=\"%s\", repositoryVersion=\"%s\")",
                                                            policySetId,
                                                            policySetVersion,
                                                            repositoryVersion));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.