/** * Just a convienence method to return the key cast to the appropriate type. * * @return the key cast to the appropriate sub-type */ public ContentProviderPackageDetailsKey getContentProviderPackageDetailsKey() { return (ContentProviderPackageDetailsKey) super.getKey(); }
public File getPath(PackageDetails details) { /* JBNADM-2022 - It still needs to be determined if it is the responsibility of the plugin container or the * plugin to be concerned with path information in the package name. For now, it's the plugin's * responsibility. We strip out the path information to keep control of where the JARs are * deployed to. Note: when we add support for more package types, we'll need to refactor this * out on a package type basis. * * jdobies, Sep 20, 2007 */ PackageDetailsKey key = details.getKey(); String fileName = key.getName(); int lastPathStart = fileName.lastIndexOf(File.separatorChar); if (lastPathStart > -1) { fileName = fileName.substring(lastPathStart + 1); } return new File(this.deployDirectory, fileName); }
/** * JBNADM-2022 - It still needs to be determined if it is the responsibility of the plugin container or the * plugin to be concerned with path information in the package name. For now, it's the plugin's * responsibility. We strip out the path information to keep control of where the JARs are * deployed to. Note: when we add support for more package types, we'll need to refactor this * out on a package type basis. * @param details package details * @return destination path */ private File getPath(PackageDetails details) { String fileName = details.getKey().getName(); int lastPathStart = fileName.lastIndexOf(File.separatorChar); if (lastPathStart > -1) { fileName = fileName.substring(lastPathStart + 1); } if (this.fileEnding != null && !fileName.endsWith(this.fileEnding)) { fileName = fileName + this.fileEnding; } return new File(this.directory, fileName); } }