You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ri...@apache.org on 2010/03/30 14:19:57 UTC
svn commit: r929105 [2/3] - in
/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec: ./ src/ src/main/
src/main/java/ src/main/java/javax/ src/main/java/javax/ws/
src/main/java/javax/ws/rs/ src/main/java/javax/ws/rs/core/
src/main/java/javax/ws/rs/ext/
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/EntityTag.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/EntityTag.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/EntityTag.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/EntityTag.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import javax.ws.rs.ext.RuntimeDelegate;
+import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
+
+public class EntityTag {
+ private final boolean isWeak;
+ private final String value;
+
+ public EntityTag(String value) {
+ this(value, false);
+ }
+
+ public EntityTag(String value, boolean weak) {
+ if (value == null) {
+ throw new IllegalArgumentException();
+ }
+ this.value = value;
+ this.isWeak = weak;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj) {
+ return true;
+ }
+
+ if (!(obj instanceof EntityTag)) {
+ return false;
+ }
+
+ EntityTag other = (EntityTag)obj;
+ if (isWeak != other.isWeak()) {
+ return false;
+ }
+
+ if (!value.equals(other.getValue())) {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + ((isWeak) ? 1 : 0);
+ result = 31 * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public boolean isWeak() {
+ return isWeak;
+ }
+
+ private static final HeaderDelegate<EntityTag> headerDelegate =
+ RuntimeDelegate
+ .getInstance()
+ .createHeaderDelegate(EntityTag.class);
+
+ @Override
+ public String toString() {
+ return headerDelegate.toString(this);
+ }
+
+ public static EntityTag valueOf(String value) {
+ return headerDelegate.fromString(value);
+ }
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/EntityTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/EntityTag.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/EntityTag.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/GenericEntity.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/GenericEntity.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/GenericEntity.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/GenericEntity.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+
+public class GenericEntity<T> {
+ private final T entity;
+ private final Type genericType;
+
+ protected GenericEntity(T entity) {
+ if (entity == null) {
+ throw new IllegalArgumentException();
+ }
+ this.entity = entity;
+
+ Type superclass = this.getClass().getGenericSuperclass();
+ this.genericType = ((ParameterizedType)superclass).getActualTypeArguments()[0];
+
+ // TODO: what if the user extends their GenericEntity superclass?
+ }
+
+ public GenericEntity(T entity, Type genericType) {
+ if (entity == null) {
+ throw new IllegalArgumentException();
+ }
+
+ if (genericType == null) {
+ throw new IllegalArgumentException();
+ }
+
+ checkCompatibility(entity.getClass(), genericType);
+ this.entity = entity;
+ this.genericType = genericType;
+ }
+
+ private void checkCompatibility(Class<?> rawType, Type genericType) {
+ if (genericType instanceof Class<?>) {
+ if (!((Class<?>)genericType).isAssignableFrom(rawType)) {
+ throw new IllegalArgumentException();
+ }
+ } else if (genericType instanceof ParameterizedType) {
+ checkCompatibility(rawType, ((ParameterizedType)genericType).getRawType());
+ } else if (genericType instanceof GenericArrayType) {
+ if (!rawType.isArray()) {
+ throw new IllegalArgumentException();
+ }
+ // check the array parameter
+ checkCompatibility(rawType.getComponentType(), ((GenericArrayType)genericType)
+ .getGenericComponentType());
+ }
+ }
+
+ public T getEntity() {
+ return entity;
+ }
+
+ public Class<?> getRawType() {
+ return entity.getClass();
+ }
+
+ public Type getType() {
+ return genericType;
+ }
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/GenericEntity.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/GenericEntity.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/GenericEntity.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/HttpHeaders.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/HttpHeaders.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/HttpHeaders.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/HttpHeaders.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+public interface HttpHeaders {
+ public static final String ACCEPT = "Accept";
+ public static final String ACCEPT_CHARSET = "Accept-Charset";
+ public static final String ACCEPT_ENCODING = "Accept-Encoding";
+ public static final String ACCEPT_LANGUAGE = "Accept-Language";
+ public static final String AUTHORIZATION = "Authorization";
+ public static final String CACHE_CONTROL = "Cache-Control";
+ public static final String CONTENT_ENCODING = "Content-Encoding";
+ public static final String CONTENT_LANGUAGE = "Content-Language";
+ public static final String CONTENT_LENGTH = "Content-Length";
+ public static final String CONTENT_LOCATION = "Content-Location";
+ public static final String CONTENT_TYPE = "Content-Type";
+ public static final String COOKIE = "Cookie";
+ public static final String DATE = "Date";
+ public static final String ETAG = "ETag";
+ public static final String EXPIRES = "Expires";
+ public static final String HOST = "Host";
+ public static final String IF_MATCH = "If-Match";
+ public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
+ public static final String IF_NONE_MATCH = "If-None-Match";
+ public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since";
+ public static final String LAST_MODIFIED = "Last-Modified";
+ public static final String LOCATION = "Location";
+ public static final String SET_COOKIE = "Set-Cookie";
+ public static final String USER_AGENT = "User-Agent";
+ public static final String VARY = "Vary";
+ public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
+
+ public List<Locale> getAcceptableLanguages();
+
+ public List<MediaType> getAcceptableMediaTypes();
+
+ public Map<String, Cookie> getCookies();
+
+ public Locale getLanguage();
+
+ public MediaType getMediaType();
+
+ public List<String> getRequestHeader(String name);
+
+ public MultivaluedMap<String, String> getRequestHeaders();
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/HttpHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/HttpHeaders.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/HttpHeaders.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MediaType.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MediaType.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MediaType.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MediaType.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,221 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.ws.rs.ext.RuntimeDelegate;
+import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
+
+public class MediaType {
+ public static final String APPLICATION_ATOM_XML =
+ "application/atom+xml";
+
+ public static final MediaType APPLICATION_ATOM_XML_TYPE =
+ new MediaType(
+ "application",
+ "atom+xml");
+ public static final String APPLICATION_FORM_URLENCODED =
+ "application/x-www-form-urlencoded";
+ public static final MediaType APPLICATION_FORM_URLENCODED_TYPE =
+ new MediaType(
+ "application",
+ "x-www-form-urlencoded");
+ public static final String APPLICATION_JSON =
+ "application/json";
+ public static final MediaType APPLICATION_JSON_TYPE =
+ new MediaType(
+ "application",
+ "json");
+ public static final String APPLICATION_OCTET_STREAM =
+ "application/octet-stream";
+ public static final MediaType APPLICATION_OCTET_STREAM_TYPE =
+ new MediaType(
+ "application",
+ "octet-stream");
+ public static final String APPLICATION_SVG_XML =
+ "application/svg+xml";
+ public static final MediaType APPLICATION_SVG_XML_TYPE =
+ new MediaType(
+ "application",
+ "svg+xml");
+ public static final String APPLICATION_XHTML_XML =
+ "application/xhtml+xml";
+ public static final MediaType APPLICATION_XHTML_XML_TYPE =
+ new MediaType(
+ "application",
+ "xhtml+xml");
+ public static final String APPLICATION_XML =
+ "application/xml";
+ public static final MediaType APPLICATION_XML_TYPE =
+ new MediaType(
+ "application",
+ "xml");
+ public static final String MEDIA_TYPE_WILDCARD = "*";
+ public static final String MULTIPART_FORM_DATA =
+ "multipart/form-data";
+ public static final MediaType MULTIPART_FORM_DATA_TYPE =
+ new MediaType(
+ "multipart",
+ "form-data");
+ public static final String TEXT_HTML = "text/html";
+ public static final MediaType TEXT_HTML_TYPE =
+ new MediaType(
+ "text",
+ "html");
+ public static final String TEXT_PLAIN = "text/plain";
+ public static final MediaType TEXT_PLAIN_TYPE =
+ new MediaType(
+ "text",
+ "plain");
+ public static final String TEXT_XML = "text/xml";
+ public static final MediaType TEXT_XML_TYPE =
+ new MediaType(
+ "text",
+ "xml");
+ public static final String WILDCARD = "*/*";
+ public static final MediaType WILDCARD_TYPE =
+ new MediaType(
+ "*",
+ "*");
+
+ private final String type;
+ private final String subtype;
+ private final Map<String, String> params;
+
+ private static final HeaderDelegate<MediaType> delegate =
+ RuntimeDelegate
+ .getInstance()
+ .createHeaderDelegate(MediaType.class);
+
+ public MediaType(String type, String subtype, Map<String, String> parameters) {
+ if (type == null) {
+ this.type = MEDIA_TYPE_WILDCARD;
+ } else {
+ this.type = type;
+ }
+
+ if (subtype == null) {
+ this.subtype = MEDIA_TYPE_WILDCARD;
+ } else {
+ this.subtype = subtype;
+ }
+
+ if (parameters == null) {
+ this.params = Collections.emptyMap();
+ } else {
+ // need to use a temporary map here since for some reason the ordering is important.
+ Map<String, String> temp = new TreeMap<String, String>(new Comparator<String>() {
+ public int compare(String o1, String o2) {
+ return o1.compareToIgnoreCase(o2);
+ }
+ });
+ // need to put in as all lower case keys for comparisons, hashcode, and output
+ for (String key : parameters.keySet()) {
+ temp.put(key.toLowerCase(), parameters.get(key));
+ }
+ this.params = Collections.unmodifiableMap(temp);
+ }
+ }
+
+ public MediaType(String type, String subtype) {
+ this(type, subtype, null);
+ }
+
+ public MediaType() {
+ this(MEDIA_TYPE_WILDCARD, MEDIA_TYPE_WILDCARD);
+ }
+
+ public static MediaType valueOf(String type) throws java.lang.IllegalArgumentException {
+ return delegate.fromString(type);
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public boolean isWildcardType() {
+ return MEDIA_TYPE_WILDCARD.equals(getType());
+ }
+
+ public String getSubtype() {
+ return subtype;
+ }
+
+ public boolean isWildcardSubtype() {
+ return MEDIA_TYPE_WILDCARD.equals(getSubtype());
+ }
+
+ public Map<String, String> getParameters() {
+ return params;
+ }
+
+ public boolean isCompatible(MediaType other) {
+ if (other == null) {
+ return false;
+ }
+ if (isWildcardType() || other.isWildcardType()) {
+ return true;
+ }
+ if (isWildcardSubtype() || other.isWildcardSubtype()) {
+ return getType().equalsIgnoreCase(other.getType());
+ }
+ return getType().equalsIgnoreCase(other.getType()) && getSubtype().equalsIgnoreCase(other
+ .getSubtype());
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj) {
+ return true;
+ }
+
+ if (!(obj instanceof MediaType)) {
+ return false;
+ }
+
+ MediaType other = (MediaType)obj;
+
+ return getType().equalsIgnoreCase(other.getType()) && getSubtype().equalsIgnoreCase(other
+ .getSubtype())
+ && getParameters().equals(other.getParameters());
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ // be sure to lowercase for comparisions
+
+ // be careful about hash code. since not guaranteed that this is a final
+ // class, need to use methods. methods do not guarantee lowercase
+ result = 31 * result + getType().toLowerCase().hashCode();
+ result = 31 * result + getSubtype().toLowerCase().hashCode();
+ result = 31 * result + getParameters().hashCode();
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return delegate.toString(this);
+ }
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MediaType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MediaType.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MediaType.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MultivaluedMap.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MultivaluedMap.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MultivaluedMap.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MultivaluedMap.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.util.List;
+import java.util.Map;
+
+public interface MultivaluedMap<K, V> extends Map<K, List<V>> {
+ public void add(K key, V value);
+
+ public V getFirst(K key);
+
+ public void putSingle(K key, V value);
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MultivaluedMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MultivaluedMap.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/MultivaluedMap.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/NewCookie.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/NewCookie.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/NewCookie.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/NewCookie.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import javax.ws.rs.ext.RuntimeDelegate;
+import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
+
+public class NewCookie extends Cookie {
+ public static final int DEFAULT_MAX_AGE = -1;
+
+ private final String comment;
+ private final int maxAge;
+ private final boolean isSecure;
+
+ public NewCookie(String name, String value) {
+ this(name, value, null, null, null, DEFAULT_MAX_AGE, false);
+ }
+
+ public NewCookie(String name,
+ String value,
+ String path,
+ String domain,
+ String comment,
+ int maxAge,
+ boolean isSecure) {
+ this(name, value, path, domain, DEFAULT_VERSION, comment, maxAge, isSecure);
+ }
+
+ public NewCookie(String name,
+ String value,
+ String path,
+ String domain,
+ int version,
+ String comment,
+ int maxAge,
+ boolean isSecure) {
+ super(name, value, path, domain, version);
+ this.comment = comment;
+ this.maxAge = maxAge;
+ this.isSecure = isSecure;
+ }
+
+ public NewCookie(Cookie cookie) {
+ this(cookie, null, DEFAULT_MAX_AGE, false);
+ }
+
+ public NewCookie(Cookie cookie, String comment, int maxAge, boolean isSecure) {
+ super(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie
+ .getVersion());
+ this.comment = comment;
+ this.maxAge = maxAge;
+ this.isSecure = isSecure;
+ }
+
+ @Override
+ public boolean equals(java.lang.Object obj) {
+ if (this == obj) {
+ return true;
+ }
+
+ if (obj == null) {
+ return false;
+ }
+
+ // note that this must be a NewCookie exactly
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+
+ NewCookie other = (NewCookie)obj;
+ if (!getName().equals(other.getName())) {
+ return false;
+ }
+
+ if (getVersion() != other.getVersion()) {
+ return false;
+ }
+
+ if (isSecure != other.isSecure) {
+ return false;
+ }
+
+ if (maxAge != other.maxAge) {
+ return false;
+ }
+
+ String value = getValue();
+ if (value == null) {
+ if (other.getValue() != null) {
+ return false;
+ }
+ } else {
+ if (!value.equals(other.getValue())) {
+ return false;
+ }
+ }
+
+ String path = getPath();
+ if (path == null) {
+ if (other.getPath() != null) {
+ return false;
+ }
+ } else {
+ if (!path.equals(other.getPath())) {
+ return false;
+ }
+ }
+
+ String domain = getDomain();
+ if (domain == null) {
+ if (other.getDomain() != null) {
+ return false;
+ }
+ } else {
+ if (!domain.equals(other.getDomain())) {
+ return false;
+ }
+ }
+
+ if (comment == null) {
+ if (other.comment != null) {
+ return false;
+ }
+ } else {
+ if (!comment.equals(other.comment)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = super.hashCode();
+ result = 31 * result + ((comment == null) ? 0 : comment.hashCode());
+ result = 31 * result + maxAge;
+ result = 31 * result + ((isSecure) ? 1 : 0);
+ return result;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ public int getMaxAge() {
+ return maxAge;
+ }
+
+ public boolean isSecure() {
+ return isSecure;
+ }
+
+ public Cookie toCookie() {
+ return new Cookie(getName(), getValue(), getPath(), getDomain(), getVersion());
+ }
+
+ private static final HeaderDelegate<NewCookie> headerDelegate =
+ RuntimeDelegate
+ .getInstance()
+ .createHeaderDelegate(NewCookie.class);
+
+ @Override
+ public String toString() {
+ return headerDelegate.toString(this);
+ }
+
+ public static NewCookie valueOf(String value) {
+ return headerDelegate.fromString(value);
+ }
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/NewCookie.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/NewCookie.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/NewCookie.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/PathSegment.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/PathSegment.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/PathSegment.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/PathSegment.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+public interface PathSegment {
+ public MultivaluedMap<String, String> getMatrixParameters();
+
+ public String getPath();
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/PathSegment.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/PathSegment.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/PathSegment.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Request.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Request.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Request.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Request.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.util.Date;
+import java.util.List;
+
+public interface Request {
+
+ public Response.ResponseBuilder evaluatePreconditions();
+
+ public Response.ResponseBuilder evaluatePreconditions(Date lastModified);
+
+ public Response.ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag entityTag);
+
+ public Response.ResponseBuilder evaluatePreconditions(EntityTag entityTag);
+
+ public String getMethod();
+
+ public Variant selectVariant(List<Variant> variants);
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Request.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Request.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Request.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,276 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.net.URI;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+import javax.ws.rs.ext.RuntimeDelegate;
+
+public abstract class Response {
+
+ private final static RuntimeDelegate delegate = RuntimeDelegate.getInstance();
+
+ public abstract static class ResponseBuilder {
+ protected ResponseBuilder() {
+ // do nothing
+ }
+
+ public abstract Response build();
+
+ public abstract Response.ResponseBuilder cacheControl(CacheControl value);
+
+ @Override
+ public abstract Response.ResponseBuilder clone();
+
+ public abstract Response.ResponseBuilder contentLocation(URI value);
+
+ public abstract Response.ResponseBuilder cookie(NewCookie... values);
+
+ public abstract Response.ResponseBuilder entity(Object value);
+
+ public abstract Response.ResponseBuilder expires(Date value);
+
+ public abstract Response.ResponseBuilder header(String name, Object value);
+
+ public abstract Response.ResponseBuilder language(Locale value);
+
+ public abstract Response.ResponseBuilder language(String value);
+
+ public abstract Response.ResponseBuilder lastModified(Date value);
+
+ public abstract Response.ResponseBuilder location(URI value);
+
+ protected static Response.ResponseBuilder newInstance() {
+ return delegate.createResponseBuilder();
+ }
+
+ public abstract Response.ResponseBuilder status(int value);
+
+ public Response.ResponseBuilder status(Response.Status value) {
+ return delegate.createResponseBuilder().status(value.getStatusCode());
+ }
+
+ public abstract Response.ResponseBuilder tag(EntityTag value);
+
+ public abstract Response.ResponseBuilder tag(String value);
+
+ public abstract Response.ResponseBuilder type(MediaType value);
+
+ public abstract Response.ResponseBuilder type(String type);
+
+ public abstract Response.ResponseBuilder variant(Variant value);
+
+ public abstract Response.ResponseBuilder variants(List<Variant> values);
+
+ public Response.ResponseBuilder status(Response.StatusType status) {
+ return delegate.createResponseBuilder().status(
+ status.getStatusCode());
+ }
+ }
+
+ public static enum Status implements StatusType {
+ OK(Family.SUCCESSFUL, 200, "OK"),
+ CREATED(Family.SUCCESSFUL, 201, "Created"),
+ ACCEPTED(Family.SUCCESSFUL, 202, "Accepted"),
+ NO_CONTENT(Family.SUCCESSFUL, 204, "No Content"),
+ MOVED_PERMANENTLY(Family.REDIRECTION, 301, "Moved Permanently"),
+ SEE_OTHER(Family.REDIRECTION, 303, "See Other"),
+ NOT_MODIFIED(Family.REDIRECTION, 304, "Not Modified"),
+ TEMPORARY_REDIRECT(Family.REDIRECTION, 307, "Temporary Redirect"),
+ BAD_REQUEST(Family.CLIENT_ERROR, 400,"Bad Request"),
+ UNAUTHORIZED(Family.CLIENT_ERROR, 401, "Unauthorized"),
+ FORBIDDEN(Family.CLIENT_ERROR, 403, "Forbidden"),
+ NOT_FOUND(Family.CLIENT_ERROR, 404, "Not Found"),
+ NOT_ACCEPTABLE(Family.CLIENT_ERROR, 406, "Not Acceptable"),
+ CONFLICT(Family.CLIENT_ERROR, 409, "Conflict"),
+ GONE(Family.CLIENT_ERROR, 410, "Gone"),
+ PRECONDITION_FAILED(Family.CLIENT_ERROR, 412, "Precondition Failed"),
+ UNSUPPORTED_MEDIA_TYPE(Family.CLIENT_ERROR, 415, "Unsupported Media Type"),
+ INTERNAL_SERVER_ERROR(Family.SERVER_ERROR, 500, "Internal Server Error"),
+ SERVICE_UNAVAILABLE(Family.SERVER_ERROR, 503, "Service Unavailable"), ;
+
+ private final Family family;
+ private final int statusCode;
+ private final String reasonPhrase;
+
+ private Status(Family family, int statusCode, String reasonPhrase) {
+ this.family = family;
+ this.statusCode = statusCode;
+ this.reasonPhrase = reasonPhrase;
+ }
+
+ public static enum Family {
+ INFORMATIONAL,
+ SUCCESSFUL,
+ REDIRECTION,
+ CLIENT_ERROR,
+ SERVER_ERROR,
+ OTHER
+ }
+
+ public static Status fromStatusCode(int statusCode) {
+ for (Status s : values()) {
+ if (s.getStatusCode() == statusCode) {
+ return s;
+ }
+ }
+ return null;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public Response.Status.Family getFamily() {
+ return family;
+ }
+
+ @Override
+ public String toString() {
+ return reasonPhrase;
+ }
+
+ public String getReasonPhrase() {
+ return reasonPhrase;
+ }
+ }
+
+ public interface StatusType {
+ public Response.Status.Family getFamily();
+
+ public String getReasonPhrase();
+
+ public int getStatusCode();
+ }
+
+ protected Response() {
+ // do nothing
+ }
+
+ public static Response.ResponseBuilder created(java.net.URI location) {
+ if (location == null) {
+ throw new IllegalArgumentException();
+ }
+ return status(Status.CREATED).location(location);
+ }
+
+ public static Response.ResponseBuilder fromResponse(Response response) {
+ ResponseBuilder builder = delegate.createResponseBuilder();
+ builder.status(response.getStatus());
+ builder.entity(response.getEntity());
+ MultivaluedMap<String, Object> metadata = response.getMetadata();
+ for (String key : metadata.keySet()) {
+ List<Object> values = metadata.get(key);
+ for (Object value : values) {
+ builder.header(key, value);
+ }
+ }
+ return builder;
+ }
+
+ public abstract Object getEntity();
+
+ public abstract MultivaluedMap<String, Object> getMetadata();
+
+ public abstract int getStatus();
+
+ public static Response.ResponseBuilder noContent() {
+ return status(Status.NO_CONTENT);
+ }
+
+ public static Response.ResponseBuilder notAcceptable(List<Variant> values) {
+ ResponseBuilder builder = status(Status.NOT_ACCEPTABLE);
+ if (values == null) {
+ return builder.variants(Collections.EMPTY_LIST);
+ }
+ return builder.variants(values);
+ }
+
+ public static Response.ResponseBuilder notModified() {
+ return status(Status.NOT_MODIFIED);
+ }
+
+ public static Response.ResponseBuilder notModified(EntityTag value) {
+ if (value == null) {
+ throw new IllegalArgumentException();
+ }
+ return status(Status.NOT_MODIFIED).tag(value);
+ }
+
+ public static Response.ResponseBuilder notModified(String value) {
+ if (value == null) {
+ throw new IllegalArgumentException();
+ }
+ return status(Status.NOT_MODIFIED).tag(value);
+ }
+
+ public static Response.ResponseBuilder ok() {
+ return status(Status.OK);
+ }
+
+ public static Response.ResponseBuilder ok(Object entity) {
+ return status(Status.OK).entity(entity);
+ }
+
+ public static Response.ResponseBuilder ok(Object entity, MediaType mediaType) {
+ return status(Status.OK).entity(entity).type(mediaType);
+ }
+
+ public static Response.ResponseBuilder ok(Object entity, String mediaType) {
+ return status(Status.OK).entity(entity).type(mediaType);
+ }
+
+ public static Response.ResponseBuilder ok(Object entity, Variant variant) {
+ return status(Status.OK).entity(entity).variant(variant);
+ }
+
+ public static Response.ResponseBuilder seeOther(URI location) {
+ if (location == null) {
+ throw new IllegalArgumentException();
+ }
+ return status(Status.SEE_OTHER).location(location);
+ }
+
+ public static Response.ResponseBuilder serverError() {
+ return status(Status.INTERNAL_SERVER_ERROR);
+ }
+
+ public static Response.ResponseBuilder status(int status) {
+ if (status < 100 || status > 599) {
+ throw new IllegalArgumentException();
+ }
+ return ResponseBuilder.newInstance().status(status);
+ }
+
+ public static Response.ResponseBuilder status(Response.Status status) {
+ if (status == null) {
+ throw new IllegalArgumentException();
+ }
+ return ResponseBuilder.newInstance().status(status);
+ }
+
+ public static Response.ResponseBuilder temporaryRedirect(URI location) {
+ return status(Status.TEMPORARY_REDIRECT).location(location);
+ }
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Response.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/SecurityContext.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/SecurityContext.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/SecurityContext.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/SecurityContext.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.security.Principal;
+
+public interface SecurityContext {
+ public static final java.lang.String BASIC_AUTH = "BASIC";
+ public static final java.lang.String CLIENT_CERT_AUTH = "CLIENT_CERT";
+ public static final java.lang.String DIGEST_AUTH = "DIGEST";
+ public static final java.lang.String FORM_AUTH = "FORM";
+
+ public String getAuthenticationScheme();
+
+ public Principal getUserPrincipal();
+
+ public boolean isSecure();
+
+ public boolean isUserInRole(String role);
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/SecurityContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/SecurityContext.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/SecurityContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/StreamingOutput.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/StreamingOutput.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/StreamingOutput.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/StreamingOutput.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+public interface StreamingOutput {
+ public void write(OutputStream os) throws IOException;
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/StreamingOutput.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/StreamingOutput.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/StreamingOutput.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilder.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilder.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilder.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import javax.ws.rs.ext.RuntimeDelegate;
+
+public abstract class UriBuilder {
+ protected UriBuilder() {
+ super();
+ }
+
+ public static UriBuilder fromPath(String value) {
+ return newInstance().replacePath(value);
+ }
+
+ public static UriBuilder fromResource(Class<?> resourceClass) {
+ return newInstance().path(resourceClass);
+ }
+
+ public static UriBuilder fromUri(String value) {
+ try {
+ return fromUri(new URI(value));
+ } catch (NullPointerException e) {
+ throw new IllegalArgumentException(e);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ public static UriBuilder fromUri(URI uri) {
+ return newInstance().uri(uri);
+ }
+
+ private final static RuntimeDelegate delegate = RuntimeDelegate.getInstance();
+
+ protected static UriBuilder newInstance() {
+ return delegate.createUriBuilder();
+ }
+
+ public abstract java.net.URI build(Object... values);
+
+ public abstract java.net.URI buildFromEncoded(Object... values);
+
+ public abstract java.net.URI buildFromEncodedMap(Map<String, ? extends Object> values);
+
+ public abstract java.net.URI buildFromMap(Map<String, ? extends Object> values);
+
+ @Override
+ public abstract UriBuilder clone();
+
+ public abstract UriBuilder fragment(String value);
+
+ public abstract UriBuilder host(String value);
+
+ public abstract UriBuilder matrixParam(String name, Object... values);
+
+ public abstract UriBuilder path(Class<?> resourceClass);
+
+ public abstract UriBuilder path(Class<?> resourceClass, String resourceMethodName);
+
+ public abstract UriBuilder path(Method resourceMethod);
+
+ public abstract UriBuilder path(String value);
+
+ public abstract UriBuilder port(int port);
+
+ public abstract UriBuilder queryParam(String name, Object... values);
+
+ public abstract UriBuilder replaceMatrix(String value);
+
+ public abstract UriBuilder replaceMatrixParam(String name, Object... values);
+
+ public abstract UriBuilder replacePath(String value);
+
+ public abstract UriBuilder replaceQuery(String value);
+
+ public abstract UriBuilder replaceQueryParam(String name, Object... values);
+
+ public abstract UriBuilder scheme(String value);
+
+ public abstract UriBuilder schemeSpecificPart(String value);
+
+ public abstract UriBuilder segment(String... values);
+
+ public abstract UriBuilder uri(URI value);
+
+ public abstract UriBuilder userInfo(String value);
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilderException.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilderException.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilderException.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilderException.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+public class UriBuilderException extends RuntimeException {
+
+ private static final long serialVersionUID = 956255903370721193L;
+
+ public UriBuilderException() {
+ super();
+ }
+
+ public UriBuilderException(String msg) {
+ super(msg);
+ }
+
+ public UriBuilderException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+
+ public UriBuilderException(Throwable cause) {
+ super((cause == null ? null : cause.toString()), cause);
+ }
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilderException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilderException.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriBuilderException.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriInfo.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriInfo.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriInfo.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriInfo.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.net.URI;
+import java.util.List;
+
+public interface UriInfo {
+ public URI getAbsolutePath();
+
+ public UriBuilder getAbsolutePathBuilder();
+
+ public URI getBaseUri();
+
+ public UriBuilder getBaseUriBuilder();
+
+ public List<Object> getMatchedResources();
+
+ public List<String> getMatchedURIs();
+
+ public List<String> getMatchedURIs(boolean decode);
+
+ public String getPath();
+
+ public String getPath(boolean decode);
+
+ public MultivaluedMap<String, String> getPathParameters();
+
+ public MultivaluedMap<String, String> getPathParameters(boolean decode);
+
+ public List<PathSegment> getPathSegments();
+
+ public List<PathSegment> getPathSegments(boolean decode);
+
+ public MultivaluedMap<String, String> getQueryParameters();
+
+ public MultivaluedMap<String, String> getQueryParameters(boolean decode);
+
+ public URI getRequestUri();
+
+ public UriBuilder getRequestUriBuilder();
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriInfo.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/UriInfo.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Variant.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Variant.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Variant.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Variant.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.core;
+
+import java.util.Locale;
+
+import javax.ws.rs.ext.RuntimeDelegate;
+
+public class Variant {
+ public abstract static class VariantListBuilder {
+ protected VariantListBuilder() {
+ /* do nothing */
+ }
+
+ public abstract Variant.VariantListBuilder add();
+
+ public abstract java.util.List<Variant> build();
+
+ public abstract Variant.VariantListBuilder encodings(String... values);
+
+ public abstract Variant.VariantListBuilder languages(Locale... values);
+
+ public abstract Variant.VariantListBuilder mediaTypes(MediaType... values);
+
+ private final static RuntimeDelegate delegate = RuntimeDelegate.getInstance();
+
+ public static Variant.VariantListBuilder newInstance() {
+ return delegate.createVariantListBuilder();
+ }
+ }
+
+ public static Variant.VariantListBuilder encodings(String... values) {
+ return VariantListBuilder.newInstance().encodings(values);
+ }
+
+ public static Variant.VariantListBuilder languages(java.util.Locale... values) {
+ return VariantListBuilder.newInstance().languages(values);
+ }
+
+ public static Variant.VariantListBuilder mediaTypes(MediaType... values) {
+ return VariantListBuilder.newInstance().mediaTypes(values);
+ }
+
+ private final MediaType mediaType;
+ private final Locale language;
+ private final String encoding;
+
+ public Variant(MediaType mediaType, Locale language, String encoding) {
+ if (mediaType == null && language == null && encoding == null) {
+ throw new IllegalArgumentException();
+ }
+
+ this.mediaType = mediaType;
+ this.language = language;
+ this.encoding = encoding;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+
+ if (!(obj instanceof Variant)) {
+ return false;
+ }
+
+ Variant other = (Variant)obj;
+
+ String encoding = getEncoding();
+ if (encoding == null) {
+ if (other.getEncoding() != null) {
+ return false;
+ }
+ } else {
+ if (!encoding.equals(other.getEncoding())) {
+ return false;
+ }
+ }
+
+ Locale locale = getLanguage();
+ if (locale == null) {
+ if (other.getLanguage() != null) {
+ return false;
+ }
+ } else {
+ if (!locale.equals(other.getLanguage())) {
+ return false;
+ }
+ }
+
+ MediaType mt = getMediaType();
+ if (mt == null) {
+ if (other.getMediaType() != null) {
+ return false;
+ }
+ } else {
+ return mt.equals(other.getMediaType());
+ }
+
+ return true;
+ }
+
+ public String getEncoding() {
+ return encoding;
+ }
+
+ public java.util.Locale getLanguage() {
+ return language;
+ }
+
+ public MediaType getMediaType() {
+ return mediaType;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + ((language == null) ? 0 : language.hashCode());
+ result = 31 * result + ((encoding == null) ? 0 : encoding.hashCode());
+ result = 31 * result + ((mediaType == null) ? 0 : mediaType.hashCode());
+ return result;
+ }
+
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Variant.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Variant.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/core/Variant.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ContextResolver.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ContextResolver.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ContextResolver.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ContextResolver.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.ext;
+
+public interface ContextResolver<T> {
+ public T getContext(Class<?> rawType);
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ContextResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ContextResolver.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ContextResolver.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ExceptionMapper.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ExceptionMapper.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ExceptionMapper.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ExceptionMapper.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.ext;
+
+import javax.ws.rs.core.Response;
+
+public interface ExceptionMapper<T extends Throwable> {
+ public Response toResponse(T throwable);
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ExceptionMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ExceptionMapper.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/ExceptionMapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyReader.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyReader.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyReader.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyReader.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.ext;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+
+public interface MessageBodyReader<T> {
+ public boolean isReadable(Class<?> rawType,
+ Type genericType,
+ Annotation[] annotations,
+ MediaType mediaType);
+
+ public T readFrom(Class<T> rawType,
+ Type genericType,
+ Annotation[] annotations,
+ MediaType mediaType,
+ MultivaluedMap<String, String> httpHeaders,
+ InputStream entityStream) throws IOException;
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyReader.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyReader.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyReader.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyWriter.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyWriter.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyWriter.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyWriter.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.ext;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+
+public interface MessageBodyWriter<T> {
+
+ public long getSize(T t,
+ Class<?> rawType,
+ Type genericType,
+ Annotation[] annotations,
+ MediaType mediaType);
+
+ public boolean isWriteable(Class<?> rawType,
+ Type genericType,
+ Annotation[] annotations,
+ MediaType mediaType);
+
+ public void writeTo(T t,
+ Class<?> rawType,
+ Type genericType,
+ Annotation[] annotations,
+ MediaType mediaType,
+ MultivaluedMap<String, Object> httpHeaders,
+ OutputStream entityStream) throws IOException;
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyWriter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyWriter.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/MessageBodyWriter.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Provider.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Provider.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Provider.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Provider.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.ext;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(value = ElementType.TYPE)
+@Retention(value = RetentionPolicy.RUNTIME)
+@Documented
+public @interface Provider {
+
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Provider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Provider.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Provider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Providers.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Providers.java?rev=929105&view=auto
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Providers.java (added)
+++ geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Providers.java Tue Mar 30 12:19:56 2010
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package javax.ws.rs.ext;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+
+import javax.ws.rs.core.MediaType;
+
+public interface Providers {
+ public <T> ContextResolver<T> getContextResolver(Class<T> rawType, MediaType mediaType);
+
+ public <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> rawType);
+
+ public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> rawType,
+ Type genericType,
+ Annotation[] annotations,
+ MediaType mediaType);
+
+ public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> rawType,
+ Type genericType,
+ Annotation[] annotations,
+ MediaType mediaType);
+}
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Providers.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Providers.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/specs/trunk/geronimo-jaxrs_1.1_spec/src/main/java/javax/ws/rs/ext/Providers.java
------------------------------------------------------------------------------
svn:mime-type = text/plain