Examples of ReferenceList


Examples of org.jboss.ws.extensions.security.element.ReferenceList

/*     */
/*     */   public Collection<String> process(Document message, SecurityProcess process) throws WSSecurityException
/*     */   {
/* 128 */     Collection ids = new HashSet();
/* 129 */     EncryptedKey key = (EncryptedKey)process;
/* 130 */     ReferenceList list = key.getReferenceList();
/* 131 */     for (String uri : list.getAllReferences())
/*     */     {
/* 133 */       Element element = Util.findElementByWsuId(message.getDocumentElement(), uri);
/* 134 */       if (element == null) {
/* 135 */         throw new WSSecurityException("A reference list refered to an element that was not found: " + uri);
/*     */       }
View Full Code Here

Examples of org.jboss.ws.extensions.security.element.ReferenceList

/*     */     catch (XMLSecurityException e)
/*     */     {
/* 142 */       throw new WSSecurityException("Error initializing xml cipher" + e.getMessage(), e);
/*     */     }
/*     */
/* 145 */     ReferenceList list = new ReferenceList();
/*     */
/* 147 */     if ((targets == null) || (targets.size() == 0))
/*     */     {
/* 150 */       String namespace = message.getDocumentElement().getNamespaceURI();
/* 151 */       processTarget(cipher, message, new QNameTarget(new QName(namespace, "Body"), true), list, secretKey);
View Full Code Here

Examples of org.opensaml.xml.encryption.ReferenceList

public class ReferenceListUnmarshaller extends AbstractXMLEncryptionUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        ReferenceList rl = (ReferenceList) parentXMLObject;

        if (childXMLObject instanceof DataReference) {
            rl.getReferences().add((DataReference) childXMLObject);
        } else if (childXMLObject instanceof KeyReference) {
            rl.getReferences().add((KeyReference) childXMLObject);
        } else {
            super.processChildElement(parentXMLObject, childXMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.encryption.ReferenceList

public class ReferenceListUnmarshaller extends AbstractXMLEncryptionUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        ReferenceList rl = (ReferenceList) parentXMLObject;

        if (childXMLObject instanceof DataReference) {
            rl.getReferences().add((DataReference) childXMLObject);
        } else if (childXMLObject instanceof KeyReference) {
            rl.getReferences().add((KeyReference) childXMLObject);
        } else {
            super.processChildElement(parentXMLObject, childXMLObject);
        }
    }
View Full Code Here

Examples of org.restlet.data.ReferenceList

                String baseName = getBaseName(file, metadataService);
                // 2- looking for resources with the same base name
                if (file.getParentFile() != null) {
                    File[] files = file.getParentFile().listFiles();
                    if (files != null) {
                        ReferenceList rl = new ReferenceList(files.length);

                        String encodedParentDirectoryURI = path.substring(0,
                                path.lastIndexOf("/"));
                        String encodedFileName = path.substring(path
                                .lastIndexOf("/") + 1);

                        for (File entry : files) {
                            if (baseName.equals(getBaseName(entry, metadataService))) {
                                rl
                                        .add(LocalReference
                                                .createFileReference(encodedParentDirectoryURI
                                                        + "/"
                                                        + getReencodedVariantFileName(
                                                                encodedFileName,
                                                                entry.getName())));
                            }
                        }
                        output = rl.getTextRepresentation();
                    }
                }
            } else {
                if ((file != null) && file.exists()) {
                    if (file.isDirectory()) {
                        // Return the directory listing
                        File[] files = file.listFiles();
                        ReferenceList rl = new ReferenceList(files.length);
                        rl.setIdentifier(request.getResourceRef());
                        String directoryUri = request.getResourceRef()
                                .toString();

                        // Ensures that the directory URI ends with a slash
                        if (!directoryUri.endsWith("/")) {
                            directoryUri += "/";
                        }

                        for (File entry : files) {
                            rl.add(directoryUri + entry.getName());
                        }

                        output = rl.getTextRepresentation();
                    } else {
                        // Return the file content
                        output = new FileRepresentation(file, metadataService
                                .getDefaultMediaType(), getTimeToLive());
                        updateMetadata(metadataService, file.getName(), output);
View Full Code Here

Examples of org.restlet.data.ReferenceList

                // 1- set up base name as the longest part of the name without
                // known extensions (beginning from the left)
                String baseName = getBaseName(file, metadataService);
                // 2- loooking for resources with the same base name
                File[] files = file.getParentFile().listFiles();
                ReferenceList rl = new ReferenceList(files.length);
                rl.setIdentifier(request.getResourceRef());

                for (File entry : files) {
                    try {
                        if (entry.getName().startsWith(baseName)) {
                            rl.add(LocalReference.createFileReference(entry));
                        }
                    } catch (IOException ioe) {
                        getLogger().log(Level.WARNING,
                                "Unable to create file reference", ioe);
                    }
                }
                output = rl.getTextRepresentation();
            } else {
                if ((file != null) && file.exists()) {
                    if (file.isDirectory()) {
                        // Return the directory listing
                        File[] files = file.listFiles();
                        ReferenceList rl = new ReferenceList(files.length);
                        rl.setIdentifier(request.getResourceRef());

                        for (File entry : files) {
                            try {
                                rl.add(LocalReference
                                        .createFileReference(entry));
                            } catch (IOException ioe) {
                                getLogger().log(Level.WARNING,
                                        "Unable to create file reference", ioe);
                            }
                        }

                        output = rl.getTextRepresentation();
                    } else {
                        // Return the file content
                        output = new FileRepresentation(file, metadataService
                                .getDefaultMediaType(), getTimeToLive());
                        updateMetadata(metadataService, file.getName(), output);
View Full Code Here

Examples of org.restlet.data.ReferenceList

                            warEntries.add(entries.nextElement().getName());
                        }
                    }

                    // Return the directory listing
                    ReferenceList rl = new ReferenceList();
                    rl.setIdentifier(request.getResourceRef());

                    for (String warEntry : warEntries) {
                        if (warEntry.startsWith(path)) {
                            rl.add(new Reference(warEntry));
                        }
                    }

                    response.setEntity(rl.getTextRepresentation());
                    response.setStatus(Status.SUCCESS_OK);
                } else {
                    // Return the file content
                    Representation output = new InputRepresentation(war
                            .getInputStream(entry), null);
View Full Code Here

Examples of org.restlet.data.ReferenceList

        if (contextResponse.getEntity() != null) {
            if (MediaType.TEXT_URI_LIST.equals(contextResponse.getEntity()
                    .getMediaType())) {
                this.targetDirectory = true;
                this.targetFile = false;
                this.directoryContent = new ReferenceList(contextResponse
                        .getEntity());
                if (!request.getResourceRef().getIdentifier().endsWith("/")) {
                    // All requests will be automatically redirected
                    this.directoryRedirection = true;
                }

                if (!this.targetUri.endsWith("/")) {
                    this.targetUri += "/";
                    this.relativePart += "/";
                }

                // Append the index name
                if (getDirectory().getIndexName() != null
                        && getDirectory().getIndexName().length() > 0) {
                    this.directoryUri = this.targetUri;
                    this.baseName = getDirectory().getIndexName();
                    this.targetUri = this.directoryUri + this.baseName;
                    this.targetIndex = true;
                } else {
                    this.directoryUri = this.targetUri;
                    this.baseName = null;
                }
            } else {
                this.targetDirectory = false;
                this.targetFile = true;
                this.fileContent = contextResponse.getEntity();
            }
        } else {
            this.targetDirectory = false;
            this.targetFile = false;
        }

        if (!this.targetDirectory) {
            int lastSlashIndex = targetUri.lastIndexOf('/');
            if (lastSlashIndex == -1) {
                this.directoryUri = "";
                this.baseName = targetUri;
            } else {
                this.directoryUri = targetUri.substring(0, lastSlashIndex + 1);
                this.baseName = targetUri.substring(lastSlashIndex + 1);
            }

            contextResponse = getDispatcher().get(this.directoryUri);
            if ((contextResponse.getEntity() != null)
                    && MediaType.TEXT_URI_LIST.equals(contextResponse
                            .getEntity().getMediaType())) {
                this.directoryContent = new ReferenceList(contextResponse
                        .getEntity());
            }
        }

        if (this.baseName != null) {
View Full Code Here

Examples of org.restlet.data.ReferenceList

                    getDispatcher().handle(contextRequest, contextResponse);
                } else {
                    // Check if there is only one representation

                    // Try to get the unique representation of the resource
                    ReferenceList references = getVariantsReferences();
                    if (!references.isEmpty()) {
                        if (uniqueReference != null) {
                            contextRequest.setResourceRef(uniqueReference);
                            getDispatcher().handle(contextRequest,
                                    contextResponse);
                        } else {
View Full Code Here

Examples of org.restlet.data.ReferenceList

                }
            }
            results.addAll(resultSet);
            if (resultSet.isEmpty()) {
                if (this.targetDirectory && getDirectory().isListingAllowed()) {
                    ReferenceList userList = new ReferenceList(
                            this.directoryContent.size());
                    // Set the list identifier
                    userList.setIdentifier(baseRef);

                    SortedSet<Reference> sortedSet = new TreeSet<Reference>(
                            getReferencesComparator());
                    sortedSet.addAll(this.directoryContent);

                    for (Reference ref : sortedSet) {
                        String filePart = ref.toString(false, false).substring(
                                rootLength);
                        StringBuilder filePath = new StringBuilder();
                        if ((!baseRef.endsWith("/"))
                                && (!filePart.startsWith("/"))) {
                            filePath.append('/');
                        }
                        filePath.append(filePart);
                        userList.add(baseRef + filePath);
                    }
                    List<Variant> list = getDirectory().getIndexVariants(
                            userList);
                    for (Variant variant : list) {
                        results.add(getDirectory().getIndexRepresentation(
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.