@Override protected void doValidate(Task task, ValidationStatus status) throws PackageException { if (file == null || todir == null) { status.addError("Cannot execute command in installer." + " Invalid update syntax: file or todir was not specified."); return; } if (todir.isFile()) { status.addError("Cannot execute command in installer." + " Invalid update command: todir should be a directory!"); } if (file.isFile()) { Match<String> match = JarUtils.findJarVersion(file.getName()); if (match == null) { status.addError("Cannot execute command in installer." + " Cannot use 'update' command for non versioned files!. File name must contain a version: " + file.getName()); } } else if (!file.isDirectory()) { status.addWarning("Ignored command in installer." + " Source file not found! " + file.getName()); } }
protected LocalPackage validateInstall(ValidationStatus status) throws PackageException { LocalPackage oldpkg = service.getActivePackage(pkg.getName()); if (oldpkg != null) { if (oldpkg.getPackageState() == PackageState.INSTALLING) { status.addWarning("A package with the same name: " + oldpkg.getId() + " is being installing. Try again later."); } else { status.addWarning("The package " + oldpkg.getId() + " will be uninstalled!"); } return oldpkg; } return null; }
String targetPlatform = PlatformVersionHelper.getPlatformFilter(); if (!TargetPlatformFilterHelper.isCompatibleWithTargetPlatform(pkg, targetPlatform)) { status.addWarning("This package is not validated for you current platform: " + targetPlatform);
String targetPlatform = PlatformVersionHelper.getPlatformFilter(); if (!TargetPlatformFilterHelper.isCompatibleWithTargetPlatform(pkg, targetPlatform)) { status.addWarning("This package is not validated for you current platform: " + targetPlatform);