Package org.restlet.data

Examples of org.restlet.data.Metadata


            {
                extensions = extensions.substring( idx + 1 );
            }

            MetadataService metadataService = getApplication().getMetadataService();
            Metadata metadata = metadataService.getMetadata( extensions );
            if( metadata != null && metadata instanceof MediaType )
            {
                request.getClientInfo()
                    .setAcceptedMediaTypes( Collections.singletonList( new Preference<MediaType>( (MediaType) metadata ) ) );
                String path = request.getResourceRef().getPath();
View Full Code Here


            {
                extensions = extensions.substring( idx + 1 );
            }

            MetadataService metadataService = getApplication().getMetadataService();
            Metadata metadata = metadataService.getMetadata( extensions );
            if( metadata != null && metadata instanceof MediaType )
            {
                request.getClientInfo()
                    .setAcceptedMediaTypes( Collections.singletonList( new Preference<MediaType>( (MediaType) metadata ) ) );
                String path = request.getResourceRef().getPath();
View Full Code Here

     */
    public void updateMetadata(MetadataService metadataService,
            String entryName, Variant variant) {
        if (variant != null) {
            String[] tokens = entryName.split("\\.");
            Metadata current;

            // We found a potential variant
            for (int j = 1; j < tokens.length; j++) {
                current = metadataService.getMetadata(tokens[j]);
                if (current != null) {
View Full Code Here

                    .getTunnelService().getLanguageAttribute());
            String acceptMediaType = query.getFirstValue(getApplication()
                    .getTunnelService().getMediaTypeAttribute());

            // Parse the headers and update the call preferences
            Metadata metadata = null;
            if (acceptCharset != null) {
                metadata = getApplication().getMetadataService().getMetadata(
                        acceptCharset);

                if (metadata instanceof CharacterSet) {
View Full Code Here

                    .getTunnelService().getLanguageAttribute());
            String acceptMediaType = query.getFirstValue(getApplication()
                    .getTunnelService().getMediaTypeAttribute());

            // Parse the headers and update the call preferences
            Metadata metadata = null;
            if (acceptCharset != null) {
                metadata = getApplication().getMetadataService().getMetadata(
                        acceptCharset);

                if (metadata instanceof CharacterSet) {
View Full Code Here

                // one character set.
                while (true) {
                    final int lastIndexOfPoint = extensions.lastIndexOf('.');
                    final String extension = extensions
                            .substring(lastIndexOfPoint + 1);
                    final Metadata metadata = getMetadata(extension);

                    if (!mediaTypeFound && (metadata instanceof MediaType)) {
                        updateMetadata(clientInfo, metadata);
                        mediaTypeFound = true;
                    } else if (!languageFound && (metadata instanceof Language)) {
View Full Code Here

                final String acceptedMediaType = query
                        .getFirstValue(mediaTypeParameter);

                // Updates the client preferences
                final ClientInfo clientInfo = request.getClientInfo();
                Metadata metadata = getMetadata(acceptedCharSet);
                if (metadata instanceof CharacterSet) {
                    updateMetadata(clientInfo, metadata);
                    query.removeFirst(charSetParameter);
                    queryModified = true;
                }
View Full Code Here

                // one character set.
                while (true) {
                    final int lastIndexOfPoint = extensions.lastIndexOf('.');
                    final String extension = extensions
                            .substring(lastIndexOfPoint + 1);
                    final Metadata metadata = getMetadata(extension);

                    if (!mediaTypeFound && (metadata instanceof MediaType)) {
                        updateMetadata(clientInfo, metadata);
                        mediaTypeFound = true;
                    } else if (!languageFound && (metadata instanceof Language)) {
View Full Code Here

                final String acceptedMediaType = query
                        .getFirstValue(mediaTypeParameter);

                // Updates the client preferences
                final ClientInfo clientInfo = request.getClientInfo();
                Metadata metadata = getMetadata(acceptedCharSet);
                if (metadata instanceof CharacterSet) {
                    updateMetadata(clientInfo, metadata);
                    query.removeFirst(charSetParameter);
                    queryModified = true;
                }
View Full Code Here

     */
    public void updateMetadata(MetadataService metadataService,
            String entryName, Variant variant) {
        if (variant != null) {
            final String[] tokens = entryName.split("\\.");
            Metadata current;

            // We found a potential variant
            for (int j = 1; j < tokens.length; j++) {
                current = metadataService.getMetadata(tokens[j]);
                if (current != null) {
View Full Code Here

TOP

Related Classes of org.restlet.data.Metadata

Copyright © 2018 www.massapicom. 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.