private void addArtifactsForAppClient(){ ClientArtifactsManager cArtifactsManager = ClientArtifactsManager.get(context); for (int i = 0; i < files.size(); i ++) { URI baseURI = context.getScratchDir("ejb").toURI(); File file = new File(files.get(i)); URI artifact = baseURI.relativize(file.toURI()); //Fix for issue 9734 if (!cArtifactsManager.contains(baseURI,artifact) ){ cArtifactsManager.add(baseURI, artifact); } } }
/** * Adds all artifacts in Collection to those to be added to the client * facade JAR. * * @param baseFile File for the base directory within which each artifact lies * @param artifactFiles Collection of File objects for the artifacts to be included * @throws IllegalStateException if invoked after the accumulated artifacts have been consumed */ public void addAll(final File baseFile, final Collection<File> artifactFiles) { for (File f : artifactFiles) { add(baseFile, f); } }
public boolean contains(final File baseFile, final File artifactFile) { return contains(baseFile.toURI(), artifactFile.toURI()); } /**
if (isArtifactSetConsumed) { throw new IllegalStateException( formattedString("enterprise.deployment.backend.appClientArtifactOutOfOrder", uris.absoluteURI.toASCIIString()) ); if (existingArtifact != null) { throw new IllegalArgumentException( formattedString("enterprise.deployment.backend.appClientArtifactCollision", uris.relativeURI.toASCIIString(), uris.absoluteURI.toASCIIString(), if ( ! f.exists() || ! f.canRead()) { throw new IllegalArgumentException( formattedString("enterprise.deployment.backend.appClientArtifactMissing", uris.relativeURI.toASCIIString(), uris.absoluteURI.toASCIIString())
/** * Retreives the client artifacts store from the provided deployment * context, creating one and storing it back into the DC if none is * there yet. * * @param dc the deployment context to hold the ClientArtifactsManager object * @return the ClientArtifactsManager object from the deployment context (created * and stored in the DC if needed) */ public static ClientArtifactsManager get(final DeploymentContext dc) { synchronized (dc) { ClientArtifactsManager result = dc.getTransientAppMetaData( CLIENT_ARTIFACTS_KEY, ClientArtifactsManager.class); if (result == null) { result = new ClientArtifactsManager(); dc.addTransientAppMetaData(CLIENT_ARTIFACTS_KEY, result); } return result; } }
/** * Adds a new artifact to the collection of artifacts to be added to the * client facade JAR file so they can be delivered to the client during a * download. * * @param baseFile File for the base directory within which the artifact lies * @param artifactFile File for the artifact itself * @throws IllegalStateException if invoked after the accumulated artifacts have been consumed */ public void add(final File baseFile, final File artifactFile) { add(baseFile.toURI(), artifactFile.toURI()); }