Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2013-12-05 02:43:46 +0000
committerGerrit Code Review @ Eclipse.org2013-12-10 18:38:57 +0000
commite9a33da7728a7bb91d268e18ff2e4bf20ef30b66 (patch)
tree2397d4127afc3e389761573fcf0c0995e159286a
parentbff783db92ac68511d83af19744b9f3c1428fffd (diff)
downloadorg.eclipse.osee-e9a33da7728a7bb91d268e18ff2e4bf20ef30b66.tar.gz
org.eclipse.osee-e9a33da7728a7bb91d268e18ff2e4bf20ef30b66.tar.xz
org.eclipse.osee-e9a33da7728a7bb91d268e18ff2e4bf20ef30b66.zip
feature[ats_Y4VKW]: Remove jersey/mimepull libraries
-rw-r--r--plugins/com.sun.jersey.client.apache.source/.classpath7
-rw-r--r--plugins/com.sun.jersey.client.apache.source/.project28
-rw-r--r--plugins/com.sun.jersey.client.apache.source/META-INF/MANIFEST.MF7
-rw-r--r--plugins/com.sun.jersey.client.apache.source/build.properties3
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClient.java192
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClientHandler.java276
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.java60
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.java285
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.java135
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientState.java277
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.java70
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.java133
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/package-info.java45
-rw-r--r--plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/package-info.java64
-rw-r--r--plugins/com.sun.jersey.client.apache/.classpath7
-rw-r--r--plugins/com.sun.jersey.client.apache/.project28
-rw-r--r--plugins/com.sun.jersey.client.apache/META-INF/MANIFEST.MF30
-rw-r--r--plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.properties5
-rw-r--r--plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.xml148
-rw-r--r--plugins/com.sun.jersey.client.apache/build.properties3
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClient.classbin3129 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$CustomMethod.classbin767 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$HttpClientResponseInputStream.classbin1037 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler.classbin7457 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.classbin271 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$1.classbin1783 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$2.classbin1556 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$3.classbin1823 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.classbin9848 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.classbin939 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientState.classbin3122 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.classbin1250 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.classbin2993 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey.client.apache/pom.xml17
-rw-r--r--plugins/com.sun.jersey.source/.classpath7
-rw-r--r--plugins/com.sun.jersey.source/.project28
-rw-r--r--plugins/com.sun.jersey.source/META-INF/MANIFEST.MF7
-rw-r--r--plugins/com.sun.jersey.source/META-INF/jersey-module-version1
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider0
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider9
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.StringReaderProvider6
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerProvider2
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter1
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter0
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider6
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider5
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider1
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider5
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/javax.enterprise.inject.spi.Extension1
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/javax.servlet.ServletContainerInitializer1
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyReader45
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyWriter40
-rw-r--r--plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.RuntimeDelegate1
-rw-r--r--plugins/com.sun.jersey.source/META-INF/taglib.tld43
-rw-r--r--plugins/com.sun.jersey.source/build.properties4
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/ConflictException.java68
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/JResponse.java1022
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/JResponseAsResponse.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/MessageException.java52
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/NotFoundException.java106
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/ParamException.java182
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/Responses.java129
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/AbstractClientRequestAdapter.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncUniformInterface.java578
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewResource.java539
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewUniformInterface.java95
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncWebResource.java816
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/Client.java704
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandler.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandlerException.java65
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequest.java234
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequestAdapter.java62
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientResponse.java739
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/CommittingOutputStream.java140
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ComponentsClientConfig.java93
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/GenericType.java128
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/PartialRequestBuilder.java135
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestBuilder.java162
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestWriter.java343
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/TerminatingClientHandler.java53
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterface.java457
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterfaceException.java119
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewResource.java499
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewUniformInterface.java93
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResource.java702
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResourceLinkHeaders.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/AsyncClientHandler.java65
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/FutureListener.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/ITypeListener.java75
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/TypeListener.java116
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/ClientConfig.java180
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/DefaultClientConfig.java146
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/package-info.java45
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ClientFilter.java103
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ConnectionListenerFilter.java342
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ContainerListener.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/Filterable.java159
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.java138
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.java83
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.java463
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/LoggingFilter.java273
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/OnStartConnectionListener.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/client/package-info.java115
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerException.java87
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerFactory.java267
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/MappableContainerException.java75
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.java129
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/LoggingFilter.java277
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/PostReplaceFilter.java87
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.java170
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.java157
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/UriConnegFilter.java190
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/package-info.java130
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.java296
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.java258
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/HttpServerFactory.java312
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/container/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ApplicationAdapter.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClassNamesResourceConfig.java141
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClasspathResourceConfig.java151
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/DefaultResourceConfig.java143
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ExtendedUriInfo.java121
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpContext.java79
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpRequestContext.java261
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpResponseContext.java199
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/InjectParam.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/PackagesResourceConfig.java131
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ParentRef.java63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfig.java926
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfigurator.java57
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceContext.java126
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/ScanningResourceConfig.java155
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/TraceInformation.java83
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/Traceable.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/WebAppResourceConfig.java129
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/core/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfigurated.java55
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfiguration.java607
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONJAXBContext.java591
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONMarshaller.java117
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONUnmarshaller.java143
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONWithPadding.java130
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/json/package-info.java138
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractField.java86
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractImplicitViewMethod.java60
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractMethod.java94
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelComponent.java51
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelVisitor.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResource.java229
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceConstructor.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceMethod.java152
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelContext.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelListener.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSetterMethod.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceLocator.java88
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceMethod.java80
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameter.java147
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameterized.java49
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathAnnotated.java48
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathValue.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/ResourceModelIssue.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/model/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/provider/jaxb/XmlHeader.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/representation/Form.java53
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/representation/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriBuilderImpl.java662
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriComponent.java838
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriPattern.java389
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplate.java895
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplateParser.java424
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/uri/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/view/ImplicitProduces.java69
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/view/Viewable.java174
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/view/package-info.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/WadlGeneratorTask.java201
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.java377
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.java118
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.java116
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.java297
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/ImplMessages.java54
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/impl.properties3
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.java176
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.java124
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/impl/ClientRequestImpl.java156
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/impl/CopyOnWriteHashMap.java168
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/impl/async/FutureClientResponseListener.java119
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/osgi/Activator.java88
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxy.java66
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxyProvider.java52
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HTTPSProperties.java142
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.java308
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableLanguageTag.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableMediaType.java97
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableToken.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/ContentDisposition.java334
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/FormDataContentDisposition.java146
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/HttpDateFormat.java146
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/InBoundHeaders.java63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/LanguageTag.java209
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeader.java322
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeaders.java75
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/MatchingEntityTag.java90
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/MediaTypes.java313
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/OutBoundHeaders.java62
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/ParameterizedHeader.java102
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualityFactor.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualitySourceMediaType.java133
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/Token.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/CookiesParser.java157
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.java132
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReader.java473
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.java359
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.java111
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.java102
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.java178
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DocumentProvider.java125
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.java123
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FileProvider.java113
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.java101
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormProvider.java90
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/Inflector.java847
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.java103
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.java111
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ReaderProvider.java99
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.java127
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/SourceProvider.java214
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StringProvider.java90
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.java120
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.java149
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.java120
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.java153
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CacheControlProvider.java215
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CookieProvider.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/DateProvider.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/EntityTagProvider.java90
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LocaleProvider.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.java101
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/NewCookieProvider.java88
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/StringProvider.java63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/URIProvider.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/WriterUtil.java95
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.java92
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.java92
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.java86
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/Activator.java308
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/OsgiLocator.java99
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.java136
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/CompletableReader.java66
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/EntityHolder.java105
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.java148
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.java227
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.java321
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.java181
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/provider/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/AnnotatedMethod.java292
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/MethodList.java193
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/ReflectionHelper.java735
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/AnnotatedContext.java89
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentConstructor.java252
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentContext.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentDestructor.java96
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentInjector.java171
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProvider.java53
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProviderFactory.java57
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentScope.java49
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderFactory.java246
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderServices.java345
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.java63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.java61
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.java54
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.java109
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.java49
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.java233
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.java125
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ContextResolverFactory.java312
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/InjectableProviderFactory.java251
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/MessageBodyFactory.java471
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.java112
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.java299
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseImpl.java191
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.java126
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/FilesScanner.java116
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/JarFileScanner.java108
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/PackageNamesScanner.java284
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/Scanner.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerException.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerListener.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.java95
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.java129
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.java127
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/Base64.java369
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/Closing.java80
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/FeaturesAndProperties.java129
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparator.java66
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorHashMap.java983
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.java437
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/LazyVal.java69
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/MultivaluedMapImpl.java204
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/ReaderWriter.java193
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.java106
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.java106
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.java146
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/ThrowHelper.java62
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.java146
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/core/util/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.java91
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.java112
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.java97
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/impl/ApiMessages.java17
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/impl/ImplMessages.java774
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/impl/SpiMessages.java126
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/impl/api.properties40
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/impl/impl.properties63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/impl/spi.properties9
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONMarshaller.java117
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONUnmarshaller.java119
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BufferingInputOutputStream.java89
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/FilteringInputStream.java144
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/ImplMessages.java114
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONHelper.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONMarshallerImpl.java168
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONTransformer.java95
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONUnmarshallerImpl.java191
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.java112
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/NameUtil.java473
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/RootElementWrapper.java71
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/Stax2JsonFactory.java177
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/impl.properties8
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.java120
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.java135
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.java169
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.java118
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.java138
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.java149
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.java165
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/CharactersEvent.java71
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndDocumentEvent.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndElementEvent.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/Jackson2StaxReader.java508
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.java278
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonLexer.java743
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonNamespaceContext.java86
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.java241
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonToken.java80
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.java729
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartDocumentEvent.java71
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartElementEvent.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StaxLocation.java46
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.java235
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.java390
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.java315
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.java315
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonEncoder.java90
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.java464
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.java519
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizable.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessage.java71
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessageFactory.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizer.java164
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPart.java333
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartEntity.java96
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartsList.java88
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/Boundary.java99
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataBodyPart.java345
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataMultiPart.java210
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataParam.java158
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/HeadersMap.java54
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPart.java207
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartConfig.java160
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartMediaTypes.java120
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/ParameterizedHeadersMap.java74
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.java193
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/FileDataBodyPart.java226
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/MediaTypePredictor.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/package-info.java45
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.java360
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartConfigProvider.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.java211
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.java85
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartWriter.java240
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/multipart/package-info.java120
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/BuildId.java91
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/InitialContextHelper.java63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalHttpContext.java117
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalInvoker.java103
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/VariantSelector.java309
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/CloseableServiceFactory.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/DeferredResourceConfig.java111
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ExceptionMapperFactory.java160
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.java103
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/RootResourceUriRules.java245
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationContext.java503
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationImpl.java1578
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/build.properties1
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AbstractBean.java136
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.java82
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.java91
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedImpl.java92
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.java84
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.java91
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.java92
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.java102
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/BeanGenerator.java116
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.java181
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.java82
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIExtension.java995
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/DiscoveredParameter.java150
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/InitializedLater.java52
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/ProviderBasedBean.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/SyntheticQualifier.java68
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/Utils.java110
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/IoCResourceFactory.java232
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/ResourceFactory.java161
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/FilterFactory.java173
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/NormalizeFilter.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.java249
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.java228
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.java65
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/Include.java163
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.java137
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.java325
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.java330
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.java91
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.java139
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.java163
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.java98
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.java113
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.java129
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.java109
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/InjectableValuesProvider.java57
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.java128
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.java134
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.java127
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.java93
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ErrorHelper.java88
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/HttpHelper.java288
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceMethodMap.java79
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceUriRules.java434
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/RulesMap.java84
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.java111
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.java92
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceMethod.java204
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.java270
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.java133
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.java174
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.java100
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.java94
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.java94
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.java88
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.java112
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.java125
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.java95
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.java107
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.java103
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.java146
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.java97
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.java78
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.java135
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.java128
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.java68
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.java161
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.java56
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.java156
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.java86
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.java111
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.java75
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.java155
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.java686
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.java117
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.java329
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.java66
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.java210
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.java68
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/PerRequestFactory.java276
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/SingletonFactory.java213
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateFactory.java172
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateViewProcessor.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewResourceMethod.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.java97
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableRule.java161
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathPattern.java171
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathTemplate.java101
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/UriHelper.java171
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.java132
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/BaseRule.java86
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.java111
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.java407
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/PatternRulePair.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.java114
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.java107
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.java180
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.java89
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.java109
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.java193
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/TerminatingRule.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.java281
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.java144
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.java278
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.java169
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.java108
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlFactory.java136
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlMethodFactory.java132
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlResource.java105
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/osgi/Activator.java71
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/probes/UriRuleProbeProvider.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/probes/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentConstructor.java231
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentDestructor.java66
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentInjector.java246
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProvider.java80
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.java68
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlApplicationContext.java110
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlBuilder.java398
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGenerator.java130
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGeneratorImpl.java210
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ApplicationDocs.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ObjectFactory.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.java223
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.java244
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/package-info.java60
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.java148
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.java344
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.java93
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.java115
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.java184
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.java98
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.java122
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.java131
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.java75
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.java103
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.java124
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.java118
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.java62
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.java63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/CloseableService.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/HeaderDelegateProvider.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/MessageBodyWorkers.java205
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReader.java87
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderProvider.java81
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderWorkers.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerRequest.java322
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerResponse.java224
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/CachedEntityContainerRequest.java101
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerListener.java54
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerNotifier.java61
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerProvider.java86
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequest.java903
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequestFilter.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponse.java657
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseFilter.java60
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseWriter.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ExceptionMapperContext.java60
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvoker.java52
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvokerFactory.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ParamQualifier.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ReloadListener.java48
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilter.java66
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilterFactory.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilters.java70
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.java96
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.java57
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplication.java219
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationFactory.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationListener.java44
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationProvider.java69
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/package-info.java44
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/PerSession.java63
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/ServletContainer.java903
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebComponent.java891
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebConfig.java116
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebFilterConfig.java90
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebServletConfig.java89
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/package-info.java149
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/RequestDispatcher.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/package-info.java44
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ClientSide.java46
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedTo.java54
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedToType.java46
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Errors.java289
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Inject.java73
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Injectable.java56
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProvider.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProviderContext.java154
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.java55
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ServerSide.java46
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.java88
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListener.java75
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.java55
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListener.java57
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListenerAdapter.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListener.java77
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.java60
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/PerRequest.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/Singleton.java58
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/AnnotationScannerListener.java224
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/PathProviderScannerListener.java72
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/WebAppResourcesScanner.java113
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceConfigurationError.java76
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceFinder.java1005
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/service/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ResolvedViewable.java105
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContext.java116
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContextException.java86
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateProcessor.java99
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ViewProcessor.java93
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/template/package-info.java44
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriMatchResultContext.java64
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRule.java59
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRuleContext.java143
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRules.java69
-rw-r--r--plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/package-info.java43
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Application.java215
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Doc.java168
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Grammars.java144
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/HTTPMethods.java51
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Include.java131
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Link.java227
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Method.java281
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ObjectFactory.java174
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Option.java165
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Param.java461
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ParamStyle.java67
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/RepresentationType.java348
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Request.java201
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resource.java336
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ResourceType.java238
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resources.java201
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Response.java212
-rw-r--r--plugins/com.sun.jersey.source/com/sun/research/ws/wadl/package-info.java9
-rw-r--r--plugins/com.sun.jersey.source/com/sun/ws/rs/ext/RuntimeDelegateImpl.java63
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ApplicationPath.java55
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/Consumes.java51
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/CookieParam.java66
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/DELETE.java35
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/DefaultValue.java63
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/Encoded.java45
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/FormParam.java69
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/GET.java35
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/HEAD.java35
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/HeaderParam.java68
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/HttpMethod.java75
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/MatrixParam.java72
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/OPTIONS.java35
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/POST.java35
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/PUT.java35
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/Path.java105
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/PathParam.java84
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/Produces.java56
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/QueryParam.java72
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/WebApplicationException.java117
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/Application.java72
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/CacheControl.java370
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/Context.java42
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/Cookie.java198
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/EntityTag.java126
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/GenericEntity.java178
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/HttpHeaders.java217
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/MediaType.java267
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/MultivaluedMap.java56
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/NewCookie.java238
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/PathSegment.java52
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/Request.java127
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/Response.java749
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/SecurityContext.java94
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/StreamingOutput.java45
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilder.java454
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilderException.java65
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/UriInfo.java302
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/Variant.java239
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/core/package-info.java5
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/ContextResolver.java39
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/ExceptionMapper.java36
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/FactoryFinder.java157
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyReader.java100
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyWriter.java106
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/Provider.java41
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/Providers.java131
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/RuntimeDelegate.java218
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/ext/package-info.java4
-rw-r--r--plugins/com.sun.jersey.source/javax/ws/rs/package-info.java25
-rw-r--r--plugins/com.sun.jersey/.classpath7
-rw-r--r--plugins/com.sun.jersey/.project28
-rw-r--r--plugins/com.sun.jersey/META-INF/MANIFEST.MF117
-rw-r--r--plugins/com.sun.jersey/META-INF/jersey-module-version1
-rw-r--r--plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.properties5
-rw-r--r--plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.xml197
-rw-r--r--plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.properties5
-rw-r--r--plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.xml477
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider0
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider9
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.StringReaderProvider6
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerProvider2
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter1
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter0
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider6
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider6
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider1
-rw-r--r--plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider5
-rw-r--r--plugins/com.sun.jersey/META-INF/services/javax.enterprise.inject.spi.Extension1
-rw-r--r--plugins/com.sun.jersey/META-INF/services/javax.servlet.ServletContainerInitializer1
-rw-r--r--plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyReader48
-rw-r--r--plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyWriter41
-rw-r--r--plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.RuntimeDelegate1
-rw-r--r--plugins/com.sun.jersey/META-INF/taglib.tld43
-rw-r--r--plugins/com.sun.jersey/build.properties3
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ConflictException.classbin1056 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/JResponse$AJResponseBuilder.classbin10375 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/JResponse$JResponseBuilder.classbin1709 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/JResponse.classbin11430 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/JResponseAsResponse.classbin1573 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/MessageException.classbin385 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/NotFoundException.classbin1744 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException$CookieParamException.classbin709 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException$FormParamException.classbin701 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException$HeaderParamException.classbin709 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException$MatrixParamException.classbin790 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException$PathParamException.classbin782 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException$QueryParamException.classbin786 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException$URIParamException.classbin968 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/ParamException.classbin1940 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/Responses$1.classbin996 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/Responses.classbin1988 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AbstractClientRequestAdapter.classbin694 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncUniformInterface.classbin4076 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$1.classbin1237 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$2.classbin1827 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$Builder.classbin6291 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource.classbin16523 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewUniformInterface.classbin1863 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$1.classbin1844 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$2.classbin2028 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$3.classbin2688 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$4.classbin1472 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$5.classbin1475 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$6.classbin1821 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$Builder.classbin10899 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource.classbin24143 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$1.classbin1596 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$2.classbin1355 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$3.classbin3133 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4$1.classbin1174 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4.classbin3306 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl$1.classbin1380 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl.classbin1805 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ContextInjectableProvider.classbin922 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/Client.classbin17650 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandler.classbin315 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandlerException.classbin785 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest$Builder.classbin1134 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest.classbin2893 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequestAdapter.classbin301 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse$Status.classbin5916 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse.classbin12454 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/CommittingOutputStream.classbin1660 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ComponentsClientConfig.classbin2509 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/GenericType.classbin2255 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/PartialRequestBuilder.classbin4496 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/RequestBuilder.classbin1557 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriter.classbin436 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterImpl.classbin5099 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterListener.classbin417 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter.classbin7537 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler.classbin419 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterface.classbin2290 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterfaceException.classbin1428 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$1.classbin239 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$Builder.classbin5853 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource.classbin14030 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/ViewUniformInterface.classbin1517 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$1.classbin236 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$Builder.classbin7520 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource.classbin17611 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/WebResourceLinkHeaders.classbin1692 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/async/AsyncClientHandler.classbin520 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/async/FutureListener.classbin367 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/async/ITypeListener.classbin510 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/async/TypeListener.classbin1535 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/config/ClientConfig.classbin1067 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/config/DefaultClientConfig.classbin2865 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientFilter.classbin875 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientRequestContainer.classbin3031 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter$Adapter.classbin1468 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter.classbin2769 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ContainerListener.classbin718 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/Filterable.classbin1667 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter$Adapter.classbin1183 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.classbin2591 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.classbin1885 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$1.classbin1194 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$QOP.classbin1274 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$State.classbin1288 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.classbin9065 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$Adapter.classbin1565 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$LoggingOutputStream.classbin1752 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter.classbin8086 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/OnStartConnectionListener.classbin280 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingInputStream.classbin2244 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingOutputStream.classbin1424 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerException.classbin779 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerFactory.classbin7026 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/MappableContainerException.classbin715 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter$Adapter.classbin1326 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.classbin2573 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter$Adapter.classbin2911 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter.classbin8461 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/PostReplaceFilter.classbin1274 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$AbstractRequestFilter.classbin1364 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$ResourceMethodFilter.classbin2228 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceLocatorFilter.classbin3045 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceMethodFilter.classbin3107 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.classbin2488 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory$Filter.classbin2390 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.classbin2208 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/filter/UriConnegFilter.classbin4109 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.classbin4493 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.classbin5818 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/container/httpserver/HttpServerFactory.classbin4573 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ApplicationAdapter.classbin725 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ClassNamesResourceConfig.classbin3929 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ClasspathResourceConfig.classbin3901 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/DefaultResourceConfig.classbin3352 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ExtendedUriInfo.classbin793 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/HttpContext.classbin499 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/HttpRequestContext.classbin2141 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/HttpResponseContext.classbin1277 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/InjectParam.classbin532 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/PackagesResourceConfig.classbin3366 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ParentRef.classbin465 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$1.classbin1088 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$2.classbin1195 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$TypeParser.classbin388 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig.classbin14619 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfigurator.classbin211 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceContext.classbin691 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/ScanningResourceConfig.classbin4395 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$1.classbin1365 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$TraceHeaderListener.classbin317 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation.classbin2051 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/Traceable.classbin196 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/core/WebAppResourceConfig.classbin3435 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfigurated.classbin216 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$1.classbin1026 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Builder.classbin3109 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedBuilder.classbin2686 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedJettisonBuilder.classbin1545 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$NaturalBuilder.classbin1511 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Notation.classbin1342 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration.classbin6870 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$1.classbin1184 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$2.classbin1067 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$JSONNotation.classbin1510 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext.classbin12100 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONMarshaller.classbin550 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONUnmarshaller.classbin947 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/json/JSONWithPadding.classbin2492 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractField.classbin2150 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractImplicitViewMethod.classbin1174 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractMethod.classbin2198 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelComponent.classbin357 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelVisitor.classbin787 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResource.classbin6501 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceConstructor.classbin1544 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceMethod.classbin4529 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelContext.classbin302 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelListener.classbin244 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSetterMethod.classbin2082 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceLocator.classbin2508 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceMethod.classbin2186 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter$Source.classbin1490 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter.classbin5330 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/Parameterized.classbin256 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/PathAnnotated.classbin191 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/PathValue.classbin953 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/model/ResourceModelIssue.classbin970 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/provider/jaxb/XmlHeader.classbin435 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/representation/Form.classbin396 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriBuilderImpl.classbin15586 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$1.classbin840 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$PathSegmentImpl.classbin2041 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$Type.classbin1712 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent.classbin14391 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$1.classbin227 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$EmptyStringMatchResult.classbin1420 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$GroupIndexMatchResult.classbin1693 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern.classbin5127 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate$1.classbin1568 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate.classbin13740 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$CharacterIterator.classbin333 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$StringCharacterIterator.classbin1338 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser.classbin8274 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/view/ImplicitProduces.classbin478 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/view/Viewable.classbin1712 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask$Loader.classbin2055 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask.classbin5433 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder$1.classbin1164 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder.classbin1968 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigDescriptionBuilder.classbin2694 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigGeneratorImpl.classbin1106 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigImpl.classbin1008 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.classbin2984 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.classbin2818 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.classbin1495 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$1.classbin1564 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$Callback.classbin282 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$CallbackList.classbin1771 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$WadlGeneratorControl.classbin903 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.classbin9678 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/ImplMessages.classbin1766 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/impl.properties3
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.classbin7019 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.classbin5779 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/impl/ClientRequestImpl.classbin5070 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/impl/CopyOnWriteHashMap.classbin4210 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener$1.classbin729 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener.classbin2781 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/osgi/Activator.classbin1984 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxy.classbin1623 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxyProvider.classbin401 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HTTPSProperties.classbin2004 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.classbin291 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1$1.classbin1589 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1.classbin2143 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$URLConnectionResponse.classbin2360 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.classbin8485 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableLanguageTag.classbin1621 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableMediaType.classbin2292 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableToken.classbin1281 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition$ContentDispositionBuilder.classbin2275 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition.classbin5403 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition$FormDataContentDispositionBuilder.classbin1673 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition.classbin2688 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat$1.classbin805 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat.classbin2710 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/InBoundHeaders.classbin597 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/LanguageTag.classbin4150 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader$LinkHeaderBuilder.classbin3297 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader.classbin7303 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeaders.classbin2061 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/MatchingEntityTag.classbin1881 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$1.classbin1236 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$2.classbin1569 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$3.classbin1236 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$4.classbin787 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes.classbin6248 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/OutBoundHeaders.classbin601 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/ParameterizedHeader.classbin2044 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/QualityFactor.classbin361 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/QualitySourceMediaType.classbin3570 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/Token.classbin1416 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableCookie.classbin980 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableNewCookie.classbin1161 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser.classbin3908 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.classbin2297 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$1.classbin1271 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$2.classbin1249 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$3.classbin1277 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$4.classbin1303 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$5.classbin1286 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$6.classbin2220 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$7.classbin1317 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$8.classbin1335 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$9.classbin1090 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$Event.classbin1416 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$ListElementCreator.classbin550 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader.classbin13836 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.classbin7183 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.classbin4212 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.classbin4660 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource$DSByteArrayOutputStream.classbin897 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource.classbin2198 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.classbin4914 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DocumentProvider.classbin6087 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.classbin4164 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FileProvider.classbin5461 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.classbin4874 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormProvider.classbin4226 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector$Replacer.classbin1985 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector.classbin8907 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.classbin4791 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.classbin5039 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ReaderProvider.classbin4322 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.classbin6619 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$DOMSourceReader.classbin4212 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SAXSourceReader.classbin4219 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SourceWriter.classbin5927 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$StreamSourceReader.classbin2829 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider.classbin788 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.classbin3409 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StringProvider.classbin3982 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$App.classbin1308 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$General.classbin1424 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$Text.classbin1297 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.classbin3375 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$App.classbin1304 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$General.classbin1420 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$Text.classbin1293 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.classbin4796 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$App.classbin1308 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$General.classbin1424 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$Text.classbin1297 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.classbin3063 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$App.classbin1304 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$General.classbin1420 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$Text.classbin1293 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.classbin5638 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CacheControlProvider.classbin8174 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CookieProvider.classbin2292 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/DateProvider.classbin2052 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/EntityTagProvider.classbin3115 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.classbin1625 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LocaleProvider.classbin2262 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.classbin3808 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/NewCookieProvider.classbin2587 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/StringProvider.classbin1360 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/URIProvider.classbin1828 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/WriterUtil.classbin1835 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.classbin1802 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider$1.classbin1356 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.classbin3089 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.classbin2712 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$1.classbin1109 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$2.classbin1463 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.classbin2830 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.classbin1400 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.classbin1580 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$1.classbin2217 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$2.classbin1286 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$BundleFactoryLoader.classbin3410 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$1.classbin2757 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$2.classbin1807 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder.classbin2843 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator.classbin7588 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/osgi/OsgiLocator.classbin3661 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.classbin2500 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/provider/CompletableReader.classbin286 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/provider/EntityHolder.classbin961 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.classbin6640 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.classbin7522 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.classbin10658 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.classbin6165 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/AnnotatedMethod.classbin9176 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$1.classbin1151 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$2.classbin1067 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$3.classbin1196 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$4.classbin1232 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$5.classbin1152 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$6.classbin1530 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$7.classbin1155 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$8.classbin1533 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$Filter.classbin295 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList.classbin6414 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$1.classbin1113 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$2.classbin939 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$ClassTypePair.classbin753 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$DeclaringClassInterfacePair.classbin1170 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$TypeClassPair.classbin643 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper.classbin14094 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/AnnotatedContext.classbin1390 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$1.classbin279 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorComparator.classbin2664 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorInjectablePair.classbin1905 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor.classbin8800 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentContext.classbin281 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentDestructor.classbin2815 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector$1.classbin1667 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector.classbin5845 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProvider.classbin194 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProviderFactory.classbin404 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentScope.classbin1694 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$Destroyable.classbin281 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$SingletonComponentProvider.classbin2207 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory.classbin6375 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderClass.classbin931 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderListener.classbin390 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices.classbin12471 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.classbin238 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.classbin413 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.classbin286 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.classbin218 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.classbin895 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.classbin189 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.classbin323 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.classbin322 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.classbin325 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$FullyManagedSingleton.classbin763 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$InstantiatedSingleton.classbin3130 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ManagedSingleton.classbin1518 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ProxiedSingletonWrapper.classbin2246 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.classbin5304 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.classbin341 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.classbin3628 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$1.classbin954 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$2.classbin1058 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1.classbin5959 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$ContextResolverAdapter.classbin2399 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$NullContextResolverAdapter.classbin1106 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory.classbin8129 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$1.classbin1437 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$2.classbin1446 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$MetaInjectableProvider.classbin1107 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory.classbin10828 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$1.classbin1919 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$2.classbin1818 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$DistanceComparator.classbin2642 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$MessageBodyWriterPair.classbin911 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory.classbin17696 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.classbin3024 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.classbin9348 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl$1.classbin1149 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl.classbin3524 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.classbin3518 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner$1.classbin1348 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner.classbin2970 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner$1.classbin1168 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner.classbin2128 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider$1.classbin1147 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider.classbin2043 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner.classbin6427 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/Scanner.classbin277 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerException.classbin781 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerListener.classbin300 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner$1.classbin1402 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.classbin2292 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner$1.classbin1404 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.classbin2706 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner$1.classbin1387 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.classbin3068 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.classbin414 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1$1.classbin913 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1.classbin2306 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.classbin3495 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/Base64.classbin6199 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/Closing$Closure.classbin294 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/Closing.classbin1163 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/FeaturesAndProperties.classbin911 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparator.classbin385 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$1.classbin261 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$Entry.classbin3070 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntryIterator.classbin1697 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntrySet.classbin2304 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$HashIterator.classbin2635 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$KeyIterator.classbin1492 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$ValueIterator.classbin1520 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap.classbin15153 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$1.classbin279 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$Entry.classbin2918 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$EntryIterator.classbin1811 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$KeyIterator.classbin1606 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$LinkedHashIterator.classbin2698 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$ValueIterator.classbin1634 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.classbin6825 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/LazyVal.classbin999 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/MultivaluedMapImpl.classbin6524 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/ReaderWriter.classbin3696 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.classbin1622 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.classbin3678 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.classbin3018 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.classbin4455 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/ThrowHelper.classbin731 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.classbin4103 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.classbin3100 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.classbin3756 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.classbin3267 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/impl/ApiMessages.classbin709 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/impl/ImplMessages.classbin18801 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/impl/SpiMessages.classbin3882 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/impl/api.properties40
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/impl/impl.properties63
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/impl/spi.properties9
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONMarshaller.classbin2992 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONUnmarshaller.classbin4331 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/BufferingInputOutputStream.classbin1432 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/FilteringInputStream.classbin1957 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/ImplMessages.classbin3054 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONHelper.classbin1411 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONMarshallerImpl.classbin6130 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONTransformer.classbin2779 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONUnmarshallerImpl.classbin6864 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.classbin2341 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/NameUtil.classbin7900 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/RootElementWrapper.classbin1671 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory$1.classbin1072 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory.classbin6311 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/impl.properties8
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$App.classbin2063 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$General.classbin2346 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.classbin4494 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$App.classbin919 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$General.classbin1072 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.classbin4539 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$App.classbin919 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$General.classbin1167 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.classbin6727 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.classbin1721 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$App.classbin2070 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$General.classbin2353 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.classbin4482 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$App.classbin923 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$General.classbin1171 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.classbin4332 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.classbin7104 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$1.classbin293 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext$1.classbin1219 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext.classbin5061 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.classbin5284 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/CharactersEvent.classbin966 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndDocumentEvent.classbin755 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndElementEvent.classbin1042 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$1.classbin884 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$2.classbin1400 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$ProcessingInfo.classbin695 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader.classbin14679 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$1.classbin1143 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$State.classbin1443 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.classbin6741 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonLexer.classbin9916 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonNamespaceContext.classbin1885 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent$Attribute.classbin657 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.classbin5297 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonToken.classbin1286 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$1.classbin695 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$2.classbin1402 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$LaState.classbin1836 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$ProcessingState.classbin1426 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.classbin19308 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartDocumentEvent.classbin765 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartElementEvent.classbin1052 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StaxLocation.classbin1537 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy$XmlAttribute.classbin945 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.classbin6521 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$1.classbin1075 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$State.classbin1396 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.classbin9127 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.classbin7766 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.classbin7825 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonEncoder.classbin1542 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$DummyWriterAdapter.classbin836 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$ProcessingState.classbin1701 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$StringWriterAdapter.classbin800 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$WriterAdapter.classbin1271 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.classbin12724 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$1.classbin725 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$2.classbin726 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$3.classbin726 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$4.classbin800 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$ProcessingInfo.classbin1809 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.classbin13459 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/localization/Localizable.classbin473 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessage.classbin1022 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessageFactory.classbin813 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/localization/Localizer.classbin3227 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPart.classbin6260 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartEntity.classbin837 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartsList.classbin2941 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/Boundary.classbin1984 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataBodyPart.classbin5896 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataMultiPart.classbin3738 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataParam.classbin517 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/HeadersMap.classbin358 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPart.classbin3148 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartConfig.classbin2432 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartMediaTypes.classbin1949 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/ParameterizedHeadersMap.classbin2166 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor$CommonMediaTypes.classbin4265 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.classbin1138 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/file/FileDataBodyPart.classbin4268 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/file/MediaTypePredictor.classbin311 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$1.classbin310 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataBodyPartMultiPartInjectable.classbin1672 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataContentDispositionMultiPartInjectable.classbin2007 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataInjectableValuesProvider.classbin1651 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartInjectable.classbin1449 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartParamInjectable.classbin5550 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataBodyPartMultiPartInjectable.classbin1760 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataContentDispositionMultiPartInjectable.classbin2717 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.classbin7409 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider$1.classbin1296 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider.classbin2140 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.classbin7469 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.classbin2355 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartWriter.classbin8084 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/BuildId.classbin1729 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/InitialContextHelper.classbin708 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalHttpContext.classbin2233 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker$1.classbin1245 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker.classbin2807 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.classbin1381 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$1.classbin2547 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$2.classbin2399 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$3.classbin2664 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$4.classbin2352 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$DimensionChecker.classbin921 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$VariantHolder.classbin1036 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector.classbin6876 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/CloseableServiceFactory.classbin3875 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$1.classbin295 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$ApplicationHolder.classbin3403 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig.classbin2508 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory$ExceptionMapperType.classbin923 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory.classbin4719 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.classbin3164 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules$1.classbin1787 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules.classbin8851 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationContext.classbin15007 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$1.classbin1004 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$10.classbin1635 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$11.classbin1687 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$12.classbin1678 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$13.classbin1557 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$14.classbin3300 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15$1.classbin2930 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15.classbin2815 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16$1.classbin1690 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16.classbin2763 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17$1.classbin1690 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17.classbin2894 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18$1.classbin1690 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18.classbin2871 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19$1.classbin1693 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19.classbin2778 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$2.classbin1812 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20$1.classbin1693 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20.classbin2909 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21$1.classbin1693 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21.classbin2886 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22$1.classbin1488 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22.classbin2424 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$23.classbin3480 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$3.classbin1809 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4$1.classbin1038 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4.classbin2247 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5$1.classbin1311 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5.classbin3317 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6$1.classbin1319 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6.classbin3357 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7$1.classbin1322 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7.classbin3372 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$8.classbin757 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$9.classbin1540 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ClassAnnotationKey.classbin1535 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl$1.classbin2333 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl.classbin3857 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorImpl.classbin1548 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ContextInjectableProvider.classbin1034 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$DispatchingListenerProxy.classbin2313 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl.classbin39807 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/build.properties1
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AbstractBean.classbin4088 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.classbin2037 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.classbin2673 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.classbin2924 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedImpl.classbin2516 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.classbin2013 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.classbin2945 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.classbin2900 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.classbin3284 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator$1.classbin1518 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator.classbin3841 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$1.classbin2358 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$2.classbin2176 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$ComponentProviderDestroyable.classbin459 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.classbin6401 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.classbin2283 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$1.classbin1163 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$2.classbin986 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$3.classbin1128 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ContextAnnotationLiteral.classbin899 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$InjectAnnotationLiteral.classbin881 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$JNDIContextDiver.classbin395 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ParameterBean.classbin4212 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PatchInformation.classbin1638 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PredefinedBean.classbin2991 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$SyntheticQualifierAnnotationImpl.classbin879 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension.classbin32024 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/DiscoveredParameter.classbin3351 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/InitializedLater.classbin166 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/ProviderBasedBean.classbin1991 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/SyntheticQualifier.classbin495 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/Utils.classbin3606 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$FullyManagedWrapper.classbin1585 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$PerRequestWrapper.classbin2431 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$SingletonWrapper.classbin2430 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$UndefinedWrapper.classbin2427 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory.classbin4610 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/component/ResourceFactory.classbin6627 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.classbin717 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.classbin1985 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/FilterFactory.classbin7164 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/NormalizeFilter.classbin2007 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$1.classbin1095 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$2.classbin1097 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$ContextInjectableProvider.classbin1048 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$Writer.classbin2631 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.classbin7324 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.classbin1869 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer$Writer.classbin2885 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.classbin5949 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.classbin1828 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Include.classbin3687 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.classbin4541 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.classbin10062 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$1.classbin292 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$AbstractPerSession.classbin4775 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSesson.classbin3152 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonInstantiated.classbin3075 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonProxied.classbin3326 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$SessionMap.classbin2487 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.classbin4888 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.classbin1974 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1$1.classbin1336 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1.classbin3931 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.classbin2371 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Wrapper.classbin769 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory$EJBManagedComponentProvider.classbin1070 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.classbin5260 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.classbin3710 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.classbin1777 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor$1.classbin753 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.classbin3187 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider$1.classbin1433 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.classbin4608 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable$1.classbin1000 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.classbin2236 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/InjectableValuesProvider.classbin2342 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.classbin1796 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.classbin5346 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory$ManagedBeanComponentProvider.classbin2210 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.classbin3338 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.classbin3296 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ErrorHelper.classbin2731 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/HttpHelper.classbin7805 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceMethodMap.classbin2035 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules$1.classbin2224 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules.classbin16737 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap$ConflictClosure.classbin357 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap.classbin2229 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.classbin1496 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.classbin3957 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod$OptionsRequestDispatcher.classbin2856 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.classbin1390 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod$1.classbin1405 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod.classbin4998 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$EntityParamInInvoker.classbin1860 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$JResponseOutInvoker.classbin3294 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ObjectOutInvoker.classbin2798 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ResponseOutInvoker.classbin2221 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$TypeOutInvoker.classbin2827 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$VoidOutInvoker.classbin1844 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.classbin4040 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider$EntityInjectable.classbin1541 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.classbin3953 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormEntityInjectable.classbin1441 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormParameterProvider.classbin1405 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.classbin6268 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider$HttpReqResDispatcher.classbin1983 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.classbin2329 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.classbin3141 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.classbin2331 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider$VoidVoidMethodInvoker.classbin1773 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.classbin1829 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.classbin1761 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieParamInjectable.classbin2165 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieTypeParamInjectable.classbin1516 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.classbin2703 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider$FormParamInjectable.classbin3533 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.classbin2577 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider$HeaderParamInjectable.classbin2161 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.classbin2419 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$1.classbin324 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextInjectable.classbin1252 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextRequestInjectable.classbin1391 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$UriInfoInjectable.classbin1513 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.classbin3095 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider$MatrixParamInjectable.classbin2618 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.classbin2597 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamInjectable.classbin2193 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamListPathSegmentInjectable.classbin1608 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamPathSegmentInjectable.classbin1839 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.classbin3764 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider$QueryParamInjectable.classbin2203 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.classbin2587 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.classbin1576 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$ListString.classbin1080 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SetString.classbin1072 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SortedSetString.classbin1108 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.classbin3009 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$ListValueOf.classbin1135 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SetValueOf.classbin1128 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SortedSetValueOf.classbin1158 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.classbin3382 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.classbin879 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider$1.classbin3449 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider.classbin2305 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.classbin2697 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.classbin455 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.classbin5689 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.classbin384 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.classbin2047 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.classbin2948 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.classbin1549 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.classbin1947 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.classbin2056 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$1.classbin324 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$AbstractStringReader.classbin1858 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider$1.classbin1605 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider.classbin1221 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor$1.classbin1807 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor.classbin1504 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString$1.classbin1787 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString.classbin1473 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromStringEnum.classbin1162 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf$1.classbin1766 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf.classbin1452 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.classbin1268 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$1.classbin1530 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$2.classbin1571 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$3.classbin1571 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$4.classbin1571 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$5.classbin1566 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$6.classbin1561 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$7.classbin1561 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$8.classbin1454 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$ParamAnnotationHelper.classbin683 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.classbin20036 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.classbin2033 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator$1.classbin1461 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.classbin11142 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.classbin1729 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$1.classbin302 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedDispatchingListener.classbin2545 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedRequestListener.classbin1926 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedResponseListener.classbin2509 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$EmptyListener.classbin2368 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.classbin4248 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.classbin1277 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$1.classbin274 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$AbstractPerRequest.classbin3529 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequest.classbin3379 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestInstantiated.classbin2989 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestProxied.classbin3240 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory.classbin5211 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$1.classbin271 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$AbstractSingleton.classbin2844 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$Singleton.classbin2631 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonInstantiated.classbin2739 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonProxied.classbin2847 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory.classbin3374 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateFactory.classbin5593 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateViewProcessor.classbin1735 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewResourceMethod.classbin995 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.classbin4494 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableRule.classbin5864 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern$1.classbin1203 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern.classbin2639 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate$PathTemplateParser.classbin984 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate.classbin1012 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/UriHelper.classbin3075 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$1.classbin291 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$EmptyIterator.classbin1461 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$SingleEntryIterator.classbin1421 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.classbin3300 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/BaseRule.classbin1320 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns$XInterator.classbin2457 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.classbin1763 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$1.classbin267 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$MatchStatus.classbin1382 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$Matcher.classbin4114 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$ResourceMethodListPair.classbin3339 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.classbin11449 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/PatternRulePair.classbin792 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.classbin2831 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.classbin2795 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.classbin3784 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.classbin2469 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns$XInterator.classbin2726 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.classbin1803 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.classbin7846 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/TerminatingRule.classbin1679 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.classbin3106 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules$SearchState.classbin1442 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.classbin6854 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.classbin2978 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.classbin6584 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$ArrayIterator.classbin1369 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$EmptyIterator.classbin1140 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$SingleEntryIterator.classbin1412 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.classbin1872 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.classbin2877 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory$1.classbin1092 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory.classbin4564 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethod.classbin2063 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethodDispatcher.classbin3467 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory.classbin2389 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlResource.classbin3532 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/osgi/Activator.classbin1233 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/probes/UriRuleProbeProvider.classbin776 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$1.classbin307 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorComparator.classbin2509 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorInjectablePair.classbin1762 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor.classbin7247 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentDestructor.classbin1542 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector$1.classbin1101 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector.classbin8886 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProvider.classbin470 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.classbin836 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.classbin657 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlApplicationContext.classbin559 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlBuilder.classbin15418 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGenerator.classbin1462 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl$1.classbin1130 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl.classbin7708 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ApplicationDocs.classbin1058 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ObjectFactory.classbin634 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.classbin5766 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.classbin6565 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.classbin6111 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.classbin12374 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.classbin1602 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.classbin1893 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.classbin3179 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.classbin1185 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.classbin706 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.classbin2062 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.classbin1894 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.classbin1088 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.classbin1187 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.classbin1969 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.classbin1601 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.classbin3641 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.classbin953 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.classbin1055 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.classbin749 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/CloseableService.classbin171 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/HeaderDelegateProvider.classbin475 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/MessageBodyWorkers.classbin2229 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/StringReader$ValidateDefaultValue.classbin594 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/StringReader.classbin395 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderProvider.classbin471 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderWorkers.classbin442 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerRequest.classbin8349 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerResponse.classbin5025 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/CachedEntityContainerRequest.classbin1670 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerListener.classbin220 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerNotifier.classbin220 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerProvider.classbin557 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequest.classbin23977 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequestFilter.classbin270 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$1.classbin1455 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$CommittingOutputStream.classbin2245 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse.classbin17363 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseFilter.classbin321 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseWriter.classbin345 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ExceptionMapperContext.classbin323 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvoker.classbin359 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory$1.classbin1027 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory.classbin710 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ParamQualifier.classbin459 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ReloadListener.classbin163 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilter.classbin310 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilterFactory.classbin360 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilters.classbin546 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.classbin2883 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.classbin362 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.classbin311 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.classbin288 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplication.classbin1659 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationFactory.classbin1152 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationListener.classbin192 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationProvider.classbin311 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/PerSession.classbin602 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$ContextInjectableProvider.classbin1016 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$InternalWebComponent.classbin2302 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer.classbin14334 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$1.classbin1439 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$2.classbin1228 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$3.classbin1083 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$4.classbin1085 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$ContextInjectableProvider.classbin996 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$Writer.classbin4259 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent.classbin21849 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig$ConfigType.classbin1276 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig.classbin835 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebFilterConfig.classbin1901 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebServletConfig.classbin2150 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/dispatch/RequestDispatcher.classbin223 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/ClientSide.classbin334 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedTo.classbin563 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedToType.classbin328 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$1.classbin221 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$Closure.classbin320 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessage.classbin1397 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessagesException.classbin1072 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors.classbin7544 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/Inject.classbin572 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/Injectable.classbin248 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProvider.classbin595 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext$InjectableScopePair.classbin777 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext.classbin2279 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.classbin2299 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/ServerSide.classbin334 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.classbin2384 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListener.classbin371 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.classbin286 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.classbin190 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListener.classbin215 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListenerAdapter.classbin270 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListener.classbin354 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.classbin274 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/resource/PerRequest.classbin584 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/resource/Singleton.classbin581 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$1.classbin282 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$AnnotatedClassVisitor.classbin4487 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener.classbin3779 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/scanning/PathProviderScannerListener.classbin734 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$1.classbin1290 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$2.classbin1335 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner.classbin3162 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceConfigurationError.classbin554 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$1.classbin244 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$AbstractLazyIterator.classbin4785 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$DefaultServiceIteratorProvider.classbin1956 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyClassIterator.classbin3291 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyObjectIterator.classbin4538 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$ServiceIteratorProvider.classbin2341 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder.classbin17390 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/template/ResolvedViewable.classbin2016 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContext.classbin705 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContextException.classbin816 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateProcessor.classbin363 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/template/ViewProcessor.classbin510 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriMatchResultContext.classbin312 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRule.classbin234 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRuleContext.classbin1311 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRules.classbin420 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Application.classbin2508 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Doc.classbin2176 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Grammars.classbin1509 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/HTTPMethods.classbin1520 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Include.classbin1709 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Link.classbin2588 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Method.classbin3189 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/ObjectFactory.classbin3776 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Option.classbin1954 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Param.classbin4931 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/ParamStyle.classbin2099 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/RepresentationType.classbin3619 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Request.classbin2206 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Resource.classbin3489 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/ResourceType.classbin2782 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Resources.classbin2358 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/Response.classbin2544 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/research/ws/wadl/package-info.classbin346 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/com/sun/ws/rs/ext/RuntimeDelegateImpl.classbin895 -> 0 bytes
-rw-r--r--plugins/com.sun.jersey/pom.xml17
-rw-r--r--plugins/org.jvnet.mimepull.source/.classpath7
-rw-r--r--plugins/org.jvnet.mimepull.source/.project28
-rw-r--r--plugins/org.jvnet.mimepull.source/META-INF/MANIFEST.MF7
-rw-r--r--plugins/org.jvnet.mimepull.source/build.properties3
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Chunk.java66
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/ChunkInputStream.java110
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Data.java86
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataFile.java99
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataHead.java274
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FileData.java89
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FinalArrayList.java66
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Header.java65
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/InternetHeaders.java255
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEConfig.java163
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEEvent.java132
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEMessage.java264
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParser.java516
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParsingException.java103
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEPart.java222
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MemoryData.java112
-rw-r--r--plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/WeakDataFile.java132
-rw-r--r--plugins/org.jvnet.mimepull/.classpath7
-rw-r--r--plugins/org.jvnet.mimepull/.project28
-rw-r--r--plugins/org.jvnet.mimepull/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.properties5
-rw-r--r--plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.xml147
-rw-r--r--plugins/org.jvnet.mimepull/build.properties3
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/Chunk.classbin806 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/ChunkInputStream.classbin1949 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/Data.classbin305 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataFile.classbin1126 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadMultiStream.classbin2151 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadOnceStream.classbin901 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead.classbin4313 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/FileData.classbin1460 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/FinalArrayList.classbin847 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/Header.classbin172 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/InternetHeaders.classbin3107 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEConfig.classbin2616 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Content.classbin805 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EVENT_TYPE.classbin1346 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndMessage.classbin623 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndPart.classbin611 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Headers.classbin852 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartMessage.classbin631 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartPart.classbin619 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent.classbin1254 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage$1.classbin1054 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage.classbin6949 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$1.classbin1053 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$LineInputStream.classbin1605 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$MIMEEventIterator.classbin3807 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$STATE.classbin1374 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser.classbin8297 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParsingException.classbin765 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEPart.classbin3595 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/MemoryData.classbin3117 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/WeakDataFile.classbin3358 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/org/jvnet/mimepull/hdr.classbin1516 -> 0 bytes
-rw-r--r--plugins/org.jvnet.mimepull/pom.xml17
1873 files changed, 0 insertions, 112657 deletions
diff --git a/plugins/com.sun.jersey.client.apache.source/.classpath b/plugins/com.sun.jersey.client.apache.source/.classpath
deleted file mode 100644
index f2d414669db..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry exported="true" kind="lib" path=""/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/com.sun.jersey.client.apache.source/.project b/plugins/com.sun.jersey.client.apache.source/.project
deleted file mode 100644
index 9352af65315..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>com.sun.jersey.client.apache.source</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/com.sun.jersey.client.apache.source/META-INF/MANIFEST.MF b/plugins/com.sun.jersey.client.apache.source/META-INF/MANIFEST.MF
deleted file mode 100644
index 949e7c2cd85..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Jersey Apache Client Source
-Bundle-SymbolicName: com.sun.jersey.client.apache.source
-Bundle-Version: 1.8.0.qualifier
-Bundle-Vendor: jersey.java.net
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/com.sun.jersey.client.apache.source/build.properties b/plugins/com.sun.jersey.client.apache.source/build.properties
deleted file mode 100644
index f2b5072ab08..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-output.. = .
-bin.includes = META-INF/,\
- com/
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClient.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClient.java
deleted file mode 100644
index fc876fa663a..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClient.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.client.apache.config.ApacheHttpClientConfig;
-import com.sun.jersey.client.apache.config.DefaultApacheHttpClientConfig;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-
-/**
- * A {@link Client} that utilizes the Apache HTTP client to send and receive
- * HTTP request and responses.
- * <p>
- * If an {@link ApacheHttpClientHandler} is not explicitly passed as a
- * constructor or method parameter then by default an instance is created with
- * an {@link HttpClient} constructed with a {@link MultiThreadedHttpConnectionManager}
- * instance.
- * <p>
- * The following properties are only supported at construction of this class:
- * {@link ApacheHttpClientConfig#PROPERTY_PREEMPTIVE_AUTHENTICATION} and
- * {@link ClientConfig#PROPERTY_CONNECT_TIMEOUT}.
- * <p>
- * By default a request entity is buffered and repeatable such that
- * authorization may be performed automatically in response to a 401 response.
- * <p>
- * If the property {@link ClientConfig#PROPERTY_CHUNKED_ENCODING_SIZE} size
- * is set to a value greater than 0 then chunked encoding will be enabled
- * and the request entity (if present) will not be buffered and is not
- * repeatable. For authorization to work in such scenarios the property
- * {@link ApacheHttpClientConfig#PROPERTY_PREEMPTIVE_AUTHENTICATION} must
- * be set to true.
- * <p>
- * If a response entity is obtained that is an instance of
- * {@link java.io.Closeable}
- * then the instance MUST be closed after processing the entity to release
- * connection-based resources.
- * <p>
- * If a {@link com.sun.jersey.api.client.ClientResponse} is obtained and an
- * entity is not read from the response then
- * {@link com.sun.jersey.api.client.ClientResponse#close() } MUST be called
- * after processing the response to release connection-based resources.
- *
- * @author jorgeluisw@mac.com
- * @author Paul.Sandoz@Sun.Com
- */
-public class ApacheHttpClient extends Client {
-
- private ApacheHttpClientHandler clientHandler;
-
- /**
- * Create a new client instance.
- *
- */
- public ApacheHttpClient() {
- this(createDefaultClientHander(new DefaultApacheHttpClientConfig()));
- }
-
- /**
- * Create a new client instance.
- *
- * @param root the root client handler for dispatching a request and
- * returning a response.
- */
- public ApacheHttpClient(ApacheHttpClientHandler root) {
- this(root, null);
- }
-
- /**
- * Create a new instance with a client configuration and a
- * component provider.
- *
- * @param root the root client handler for dispatching a request and
- * returning a response.
- * @param config the client configuration.
- * @param provider the IoC component provider factory.
- * @deprecated the config parameter is no longer utilized and instead
- * the config obtained from the {@link ApacheHttpClientHandler#getConfig() }
- * is utilized instead.
- */
- @Deprecated
- public ApacheHttpClient(ApacheHttpClientHandler root, ClientConfig config,
- IoCComponentProviderFactory provider) {
- this(root, provider);
- }
-
- /**
- * Create a new instance with a client configuration and a
- * component provider.
- *
- * @param root the root client handler for dispatching a request and
- * returning a response.
- * @param provider the IoC component provider factory.
- */
- public ApacheHttpClient(ApacheHttpClientHandler root,
- IoCComponentProviderFactory provider) {
- super(root, root.getConfig(), provider);
-
- this.clientHandler = root;
- inject(this.clientHandler.getMethodProcessor());
- }
-
- /**
- * Get the Apache HTTP client handler.
- *
- * @return the Apache HTTP client handler.
- */
- public ApacheHttpClientHandler getClientHandler() {
- return clientHandler;
- }
-
- /**
- * Create a default client.
- *
- * @return a default client.
- */
- public static ApacheHttpClient create() {
- return create(new DefaultApacheHttpClientConfig());
- }
-
- /**
- * Create a default client with client configuration.
- *
- * @param cc the client configuration.
- * @return a default client.
- */
- public static ApacheHttpClient create(ClientConfig cc) {
- return create(cc, null);
- }
-
- /**
- * Create a default client with client configuration and component provider.
- *
- * @param cc the client configuration.
- * @param provider the IoC component provider factory.
- * @return a default client.
- */
- public static ApacheHttpClient create(ClientConfig cc, IoCComponentProviderFactory provider) {
- return new ApacheHttpClient(createDefaultClientHander(cc), provider);
- }
-
- /**
- * Create a default Apache HTTP client handler.
- *
- * @return a default Apache HTTP client handler.
- */
- private static ApacheHttpClientHandler createDefaultClientHander(ClientConfig cc) {
- final HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager());
-
- return new ApacheHttpClientHandler(client, cc);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClientHandler.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClientHandler.java
deleted file mode 100644
index cfc84381ec6..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpClientHandler.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache;
-
-import com.sun.jersey.api.client.ClientHandler;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.client.apache.config.ApacheHttpClientConfig;
-import com.sun.jersey.client.apache.config.DefaultApacheHttpClientConfig;
-import com.sun.jersey.core.header.InBoundHeaders;
-
-import com.sun.jersey.core.util.ReaderWriter;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.Closeable;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.core.Context;
-
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.methods.HeadMethod;
-import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.OptionsMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-
-/**
- * A root handler with Jakarta Commons HttpClient acting as a backend.
- * <p>
- * Client operations are thread safe, the HTTP connection may
- * be shared between different threads.
- * <p>
- * If a response entity is obtained that is an instance of {@link Closeable}
- * then the instance MUST be closed after processing the entity to release
- * connection-based resources.
- * <p>
- * If a {@link ClientResponse} is obtained and an entity is not read from the
- * response then {@link ClientResponse#close() } MUST be called after processing
- * the response to release connection-based resources.
- * <p>
- * The following methods are currently supported: HEAD, GET, POST, PUT, DELETE
- * and OPTIONS.
- * <p>
- * Chunked transfer encoding can be enabled or disabled but configuration of
- * the chunked encoding size is not possible. If the
- * {@link ClientConfig#PROPERTY_CHUNKED_ENCODING_SIZE} property is set
- * to a non-null value then chunked transfer encoding is enabled.
- *
- * @author jorgeluisw@mac.com
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ApacheHttpClientHandler implements ClientHandler {
-
- private final HttpClient client;
-
- private final ClientConfig config;
-
- private final ApacheHttpMethodExecutor methodExecutor;
-
- @Context
- private MessageBodyWorkers workers;
-
- /**
- * Create a new root handler with an {@link HttpClient}.
- *
- * @param client the {@link HttpClient}.
- */
- public ApacheHttpClientHandler(HttpClient client) {
- this(client, new DefaultApacheHttpClientConfig(), new DefaultApacheHttpMethodExecutor(client));
- }
-
- /**
- * Create a new root handler with an {@link HttpClient}.
- *
- * @param client the {@link HttpClient}.
- * @param config the client configuration.
- */
- public ApacheHttpClientHandler(HttpClient client, ClientConfig config) {
- this(client, config, new DefaultApacheHttpMethodExecutor(client));
- }
-
- /**
- * Create a new root handler with an {@link HttpClient}.
- *
- * @param client the {@link HttpClient}.
- * @param config the client configuration.
- * @param methodExecutor the method executor.
- */
- public ApacheHttpClientHandler(HttpClient client, ClientConfig config,
- ApacheHttpMethodExecutor methodExecutor) {
- this.client = client;
- this.config = config;
-
- client.getParams().setAuthenticationPreemptive(config.getPropertyAsFeature(
- ApacheHttpClientConfig.PROPERTY_PREEMPTIVE_AUTHENTICATION));
- final Integer connectTimeout = (Integer)config.getProperty(
- ApacheHttpClientConfig.PROPERTY_CONNECT_TIMEOUT);
- if (connectTimeout != null) {
- client.getHttpConnectionManager().getParams().setConnectionTimeout(connectTimeout);
- }
-
- this.methodExecutor = methodExecutor;
- }
-
- /**
- * Get the client config.
- *
- * @return the client config.
- */
- public ClientConfig getConfig() {
- return config;
- }
-
- /**
- * Get the {@link HttpClient}.
- *
- * @return the {@link HttpClient}.
- */
- public HttpClient getHttpClient() {
- return client;
- }
-
- @Override
- public ClientResponse handle(final ClientRequest cr)
- throws ClientHandlerException {
-
- final HttpMethod method = getHttpMethod(cr);
-
- methodExecutor.executeMethod(method, cr);
-
- try {
- ClientResponse r = new ClientResponse(method.getStatusCode(),
- getInBoundHeaders(method),
- new HttpClientResponseInputStream(method),
- workers);
- if (!r.hasEntity()) {
- r.bufferEntity();
- r.close();
- }
- return r;
- } catch (Exception e) {
- method.releaseConnection();
- throw new ClientHandlerException(e);
- }
- }
-
- private HttpMethod getHttpMethod(ClientRequest cr) {
- final String strMethod = cr.getMethod();
- final String uri = cr.getURI().toString();
-
- if (strMethod.equals("GET")) {
- return new GetMethod(uri);
- } else if (strMethod.equals("POST")) {
- return new PostMethod(uri);
- } else if (strMethod.equals("PUT")) {
- return new PutMethod(uri);
- } else if (strMethod.equals("DELETE")) {
- return new CustomMethod("DELETE", uri);
- } else if (strMethod.equals("HEAD")) {
- return new HeadMethod(uri);
- } else if (strMethod.equals("OPTIONS")) {
- return new OptionsMethod(uri);
- } else {
- return new CustomMethod(strMethod, uri);
- }
- }
-
- private static class CustomMethod extends EntityEnclosingMethod {
-
- private String method;
-
- CustomMethod(String method, String uri) {
- super(uri);
-
- this.method = method;
- }
-
- @Override
- public String getName() {
- return method;
- }
- }
-
- private InBoundHeaders getInBoundHeaders(HttpMethod method) {
- InBoundHeaders headers = new InBoundHeaders();
- Header[] respHeaders = method.getResponseHeaders();
- for (Header header : respHeaders) {
- List<String> list = headers.get(header.getName());
- if (list == null) {
- list = new ArrayList<String>();
- }
- list.add(header.getValue());
- headers.put(header.getName(), list);
- }
- return headers;
- }
-
- private static final class HttpClientResponseInputStream extends FilterInputStream {
-
- private final HttpMethod method;
-
- HttpClientResponseInputStream(HttpMethod method) throws IOException {
- super(getInputStream(method));
- this.method = method;
- }
-
- @Override
- public void close()
- throws IOException {
- super.close();
- method.releaseConnection();
- }
- }
-
- private static InputStream getInputStream(HttpMethod method) throws IOException {
- InputStream i = method.getResponseBodyAsStream();
-
- if (i == null) {
- return new ByteArrayInputStream(new byte[0]);
- } else if (i.markSupported()) {
- return i;
- } else {
- return new BufferedInputStream(i, ReaderWriter.BUFFER_SIZE);
- }
- }
-
- /* package */ ApacheHttpMethodExecutor getMethodProcessor() {
- return methodExecutor;
- }
-}
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.java
deleted file mode 100644
index ddc0131eca0..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache;
-
-import com.sun.jersey.api.client.ClientRequest;
-import org.apache.commons.httpclient.HttpMethod;
-
-/**
- * An Apache HTTP method executor.
- *
- * @author imyousuf
- * @author Paul Sandoz
- */
-public interface ApacheHttpMethodExecutor {
-
- /**
- * Execute the HTTP method
- *
- * @param method the HTTP method.
- * @param cr the client request.
- */
- public void executeMethod(HttpMethod method, ClientRequest cr);
-}
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.java
deleted file mode 100644
index 79a1c01dd36..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache;
-
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.CommittingOutputStream;
-import com.sun.jersey.api.client.RequestWriter;
-import com.sun.jersey.client.apache.config.ApacheHttpClientConfig;
-import com.sun.jersey.client.apache.config.ApacheHttpClientState;
-import com.sun.jersey.client.apache.config.DefaultApacheHttpClientConfig;
-import com.sun.jersey.client.apache.config.DefaultCredentialsProvider;
-import org.apache.commons.httpclient.HostConfiguration;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.HttpState;
-import org.apache.commons.httpclient.ProxyHost;
-import org.apache.commons.httpclient.auth.CredentialsProvider;
-import org.apache.commons.httpclient.cookie.CookiePolicy;
-import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
-import org.apache.commons.httpclient.methods.RequestEntity;
-import org.apache.commons.httpclient.params.HttpMethodParams;
-
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A default implementation of an Apache HTTP method executor.
- *
- * @author imyousuf@smartitengineering.com
- * @author Paul Sandoz
- */
-public class DefaultApacheHttpMethodExecutor extends RequestWriter implements ApacheHttpMethodExecutor {
-
- private static final DefaultCredentialsProvider DEFAULT_CREDENTIALS_PROVIDER =
- new DefaultCredentialsProvider();
-
- private final HttpClient httpClient;
-
- public DefaultApacheHttpMethodExecutor(HttpClient httpClient) {
- this.httpClient = httpClient;
- }
-
- @Override
- public void executeMethod(final HttpMethod method, final ClientRequest cr) {
- final Map<String, Object> props = cr.getProperties();
-
- method.setDoAuthentication(true);
-
- final HttpMethodParams methodParams = method.getParams();
-
- // Set the handle cookies property
- if (!cr.getPropertyAsFeature(ApacheHttpClientConfig.PROPERTY_HANDLE_COOKIES)) {
- methodParams.setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
- }
-
- // Set the interactive and credential provider properties
- if (cr.getPropertyAsFeature(ApacheHttpClientConfig.PROPERTY_INTERACTIVE)) {
- CredentialsProvider provider = (CredentialsProvider) props.get(
- ApacheHttpClientConfig.PROPERTY_CREDENTIALS_PROVIDER);
- if (provider == null) {
- provider = DEFAULT_CREDENTIALS_PROVIDER;
- }
- methodParams.setParameter(CredentialsProvider.PROVIDER, provider);
- } else {
- methodParams.setParameter(CredentialsProvider.PROVIDER, null);
- }
-
- // Set the read timeout
- final Integer readTimeout = (Integer) props.get(ApacheHttpClientConfig.PROPERTY_READ_TIMEOUT);
- if (readTimeout != null) {
- methodParams.setSoTimeout(readTimeout);
- }
-
- if (method instanceof EntityEnclosingMethod) {
- final EntityEnclosingMethod entMethod = (EntityEnclosingMethod) method;
-
- if (cr.getEntity() != null) {
- final RequestEntityWriter re = getRequestEntityWriter(cr);
- final Integer chunkedEncodingSize = (Integer) props.get(ApacheHttpClientConfig.PROPERTY_CHUNKED_ENCODING_SIZE);
- if (chunkedEncodingSize != null) {
- // There doesn't seems to be a way to set the chunk size.
- entMethod.setContentChunked(true);
-
- // It is not possible for a MessageBodyWriter to modify
- // the set of headers before writing out any bytes to
- // the OutputStream
- // This makes it impossible to use the multipart
- // writer that modifies the content type to add a boundary
- // parameter
- writeOutBoundHeaders(cr.getHeaders(), method);
-
- // Do not buffer the request entity when chunked encoding is
- // set
- entMethod.setRequestEntity(new RequestEntity() {
-
- @Override
- public boolean isRepeatable() {
- return false;
- }
-
- @Override
- public void writeRequest(OutputStream out) throws IOException {
- re.writeRequestEntity(out);
- }
-
- @Override
- public long getContentLength() {
- return re.getSize();
- }
-
- @Override
- public String getContentType() {
- return re.getMediaType().toString();
- }
- });
-
- } else {
- entMethod.setContentChunked(false);
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try {
- re.writeRequestEntity(new CommittingOutputStream(baos) {
-
- @Override
- protected void commit() throws IOException {
- writeOutBoundHeaders(cr.getMetadata(), method);
- }
- });
- } catch (IOException ex) {
- throw new ClientHandlerException(ex);
- }
-
- final byte[] content = baos.toByteArray();
- entMethod.setRequestEntity(new RequestEntity() {
-
- @Override
- public boolean isRepeatable() {
- return true;
- }
-
- @Override
- public void writeRequest(OutputStream out) throws IOException {
- out.write(content);
- }
-
- @Override
- public long getContentLength() {
- return content.length;
- }
-
- @Override
- public String getContentType() {
- return re.getMediaType().toString();
- }
- });
- }
- } else {
- writeOutBoundHeaders(cr.getHeaders(), method);
- }
- } else {
- writeOutBoundHeaders(cr.getHeaders(), method);
-
- // Follow redirects
- method.setFollowRedirects(cr.getPropertyAsFeature(ApacheHttpClientConfig.PROPERTY_FOLLOW_REDIRECTS));
- }
- try {
- httpClient.executeMethod(getHostConfiguration(httpClient, props), method, getHttpState(props));
- } catch (Exception e) {
- method.releaseConnection();
- throw new ClientHandlerException(e);
- }
- }
-
- private HttpState getHttpState(Map<String, Object> props) {
- ApacheHttpClientState httpState = (ApacheHttpClientState) props.get(
- DefaultApacheHttpClientConfig.PROPERTY_HTTP_STATE);
- if (httpState != null) {
- return httpState.getHttpState();
- } else {
- return null;
- }
- }
-
- private HostConfiguration getHostConfiguration(HttpClient client, Map<String, Object> props) {
- Object proxy = props.get(ApacheHttpClientConfig.PROPERTY_PROXY_URI);
- if (proxy != null) {
- URI proxyUri = getProxyUri(proxy);
-
- String proxyHost = proxyUri.getHost();
- if (proxyHost == null) {
- proxyHost = "localhost";
- }
-
- int proxyPort = proxyUri.getPort();
- if (proxyPort == -1) {
- proxyPort = 8080;
- }
-
- HostConfiguration hostConfig = new HostConfiguration(client.getHostConfiguration());
- String setHost = hostConfig.getProxyHost();
- int setPort = hostConfig.getProxyPort();
-
- if ((setHost == null)
- || (!setHost.equals(proxyHost))
- || (setPort == -1)
- || (setPort != proxyPort)) {
- hostConfig.setProxyHost(new ProxyHost(proxyHost, proxyPort));
- }
- return hostConfig;
- } else {
- return null;
- }
- }
-
- private URI getProxyUri(Object proxy) {
- if (proxy instanceof URI) {
- return (URI) proxy;
- } else if (proxy instanceof String) {
- return URI.create((String) proxy);
- } else {
- throw new ClientHandlerException("The proxy URI property MUST be an instance of String or URI");
- }
- }
-
- private void writeOutBoundHeaders(MultivaluedMap<String, Object> metadata, HttpMethod method) {
- for (Map.Entry<String, List<Object>> e : metadata.entrySet()) {
- List<Object> vs = e.getValue();
- if (vs.size() == 1) {
- method.setRequestHeader(e.getKey(), ClientRequest.getHeaderValue(vs.get(0)));
- } else {
- StringBuilder b = new StringBuilder();
- for (Object v : e.getValue()) {
- if (b.length() > 0) {
- b.append(',');
- }
- b.append(ClientRequest.getHeaderValue(v));
- }
- method.setRequestHeader(e.getKey(), b.toString());
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.java
deleted file mode 100644
index d9069d9bcbb..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache.config;
-
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.client.apache.ApacheHttpClient;
-import com.sun.jersey.client.apache.ApacheHttpClientHandler;
-
-/**
- * Configuration options specific to the Client API that utilizes
- * {@link ApacheHttpClient} or {@link ApacheHttpClientHandler}.
- *
- * @author jorgeluisw@mac.com
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ApacheHttpClientConfig extends ClientConfig {
-
- /**
- * A value of "true" indicates that the client should
- * interactively prompt for credentials should it receive a 401
- * response.
- *
- * The value MUST be an instance of {@link java.lang.Boolean}.
- * If the property is absent the default value is "false"
- */
- public static final String PROPERTY_INTERACTIVE =
- "com.sun.jersey.impl.client.httpclient.interactive";
-
- /**
- * A value of "true" indicates the client should handle cookies
- * automatically using HttpClient's default cookie policy. A value
- * of "false" will cause the client to ignore all cookies.
- *
- * The value MUST be an instance of {@link java.lang.Boolean}.
- * If the property is absent the default value is "false"
- */
- public static final String PROPERTY_HANDLE_COOKIES =
- "com.sun.jersey.impl.client.httpclient.handleCookies";
-
- /**
- * The credential provider that should be used to retrieve
- * credentials from a user. The provider will be used only if
- * {@link #PROPERTY_INTERACTIVE} is set to true.
- *
- * The value MUST be an instance of {@link
- * org.apache.commons.httpclient.auth.CredentialsProvider}. If
- * the property is absent a default provider will be used.
- */
- public static final String PROPERTY_CREDENTIALS_PROVIDER =
- "com.sun.jersey.impl.client.httpclient.credentialsProvider";
-
- /**
- * A value of "true" indicates that a client should send an
- * authentication request even before the server gives a 401
- * response.
- *
- * This property may only be set when constructing a {@link ApacheHttpClient}
- * instance.
- *
- * If the value of this property is set to "true" default
- * credientials must be set for the target or proxy.
- *
- * The value MUST be an instance of {@link java.lang.Boolean}.
- * If the property is absent the default value is "false"
- */
- public static final String PROPERTY_PREEMPTIVE_AUTHENTICATION =
- "com.sun.jersey.impl.client.httpclient.preemptiveAuthentication";
-
- /**
- * A value of a URI to configure the proxy host and proxy port to proxy
- * HTTP requests and responses. If the port component of the URI is absent
- * then a default port of 8080 be selected.
- *
- * The value MUST be an instance of {@link String} or {@link java.net.URI}.
- * If the property absent then no proxy will be utilized.
- */
- public static final String PROPERTY_PROXY_URI =
- "com.sun.jersey.impl.client.httpclient.proxyURI";
-
- /**
- * The {@link ApacheHttpClientState} of the current client.
- * This is used to maintain authentication credentials.
- *
- * The value MUST be an instance of {@link ApacheHttpClientState}.
- */
- public static final String PROPERTY_HTTP_STATE =
- "com.sun.jersey.impl.client.httpclient.httpState";
-
- /**
- * Get the HTTP state. Credentials may be set on the HTTP state.
- * <p>
- * If no state exists then an instance is created and added
- * as the property {@link #PROPERTY_HTTP_STATE}.
- *
- * @return the HTTP state.
- */
- public ApacheHttpClientState getState();
-}
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientState.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientState.java
deleted file mode 100644
index b4022805aa5..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/ApacheHttpClientState.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache.config;
-
-import org.apache.commons.httpclient.HttpState;
-import org.apache.commons.httpclient.NTCredentials;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScope;
-
-/**
- * An encapsulation of the Apache {@link HttpState} that provides easier
- * functionality for setting up credentials and proxy credentials.
- *
- * @author jorgeluisw@mac.com
- * @author Paul.Sandoz@Sun.Com
- */
-public class ApacheHttpClientState {
- private final HttpState state;
-
- /**
- * Create a new instance with a default instance of an Apache HTTP state.
- */
- public ApacheHttpClientState() {
- this(new HttpState());
- }
-
- /**
- * Create a new state instance with an Apacahe HTTP state instance.
- *
- * @param state the Apache HTTP state.
- */
- public ApacheHttpClientState(HttpState state) {
- this.state = state;
- }
-
- /**
- *
- * Sets the credentials for the given authentication scope. Any
- * previous credentials for the given scope will be overwritten.
- *
- * @param realm The authentication realm. The null realm
- * signifies default credentials for the given host, which should
- * be used when no credentials have been explicitly supplied for
- * the challenging realm.
- * @param host The host the realm belongs to. The null host
- * signifies default credentials which should be used when no
- * credentials have been explicitly supplied for the challenging
- * host.
- * @param port The port the realm belongs to. A negitive port
- * signifies the credentials are applicaple to any port when no
- * credentials have been explicitly supplied for the challenging
- * port.
- * @param usernamepassword The username:password formed string.
- */
- public void setCredentials(String realm, String host, int port,
- String usernamepassword) {
- AuthScope authScope = new AuthScope(host, port, realm);
- UsernamePasswordCredentials creds = new UsernamePasswordCredentials(usernamepassword);
-
- getHttpState().setCredentials(authScope, creds);
- }
-
- /**
- * Sets the credentials for the given authentication scope. Any
- * previous credentials for the given scope will be overwritten.
- *
- * @param realm The authentication realm. The null realm
- * signifies default credentials for the given host, which should
- * be used when no credentials have been explicitly supplied for
- * the challenging realm.
- * @param host The host the realm belongs to. The null host
- * signifies default credentials which should be used when no
- * credentials have been explicitly supplied for the challenging
- * host.
- * @param port The port the realm belongs to. A negitive port
- * signifies the credentials are applicaple to any port when no
- * credentials have been explicitly supplied for the challenging
- * port.
- * @param username The username
- * @param password The password
- */
- public void setCredentials(String realm, String host, int port,
- String username, String password) {
- AuthScope authScope = new AuthScope(host, port, realm);
- UsernamePasswordCredentials creds = new UsernamePasswordCredentials(username, password);
-
- getHttpState().setCredentials(authScope, creds);
- }
-
- /**
- * Sets the credentials for the given authentication scope. Any
- * previous credentials for the given scope will be overwritten.
- *
- * This method should be used when setting credentials for the
- * NTLM authentication scheme.
- *
- * @param realm The authentication realm. The null realm
- * signifies default credentials for the given host, which should
- * be used when no credentials have been explicitly supplied for
- * the challenging realm.
- * @param host The host the realm belongs to. The null host
- * signifies default credentials which should be used when no
- * credentials have been explicitly supplied for the challenging
- * host.
- * @param port The port the realm belongs to. A negitive port
- * signifies the credentials are applicaple to any port when no
- * credentials have been explicitly supplied for the challenging
- * port.
- * @param username The username, this should not include the
- * domain to authenticate with. For example: "user" is correct
- * wheareas "DOMAIN\\user" is not.
- * @param password The password
- * @param thisHost The host the authentication requiest is originating
- * from. Essentially, the computer name for this machine.
- * @param domain The domain to authentice with.
- */
- public void setCredentials(String realm, String host, int port,
- String username, String password,
- String domain, String thisHost) {
- AuthScope authScope = new AuthScope(host, port, realm);
- NTCredentials creds = new NTCredentials(username, password, thisHost, domain);
-
- getHttpState().setCredentials(authScope, creds);
- }
-
- /**
- * Sets the proxy credentials for the given authentication scope.
- * Any previous credentials for the given scope will be
- * overwritten.
- *
- * @param realm The authentication realm. The null realm
- * signifies default credentials for the given host, which should
- * be used when no credentials have been explicitly supplied for
- * the challenging realm.
- * @param host The host the realm belongs to. The null host
- * signifies default credentials which should be used when no
- * credentials have been explicitly supplied for the challenging
- * host.
- * @param port The port the realm belongs to. A negitive port
- * signifies the credentials are applicaple to any port when no
- * credentials have been explicitly supplied for the challenging
- * port.
- * @param usernamepassword The username:password formed string.
- */
- public void setProxyCredentials(String realm, String host, int port,
- String usernamepassword) {
- AuthScope authScope = new AuthScope(host, port, realm);
- UsernamePasswordCredentials creds = new UsernamePasswordCredentials(usernamepassword);
-
- getHttpState().setProxyCredentials(authScope, creds);
- }
-
- /**
- * Sets the proxy credentials for the given authentication scope.
- * Any previous credentials for the given scope will be
- * overwritten.
- *
- * @param realm The authentication realm. The null realm
- * signifies default credentials for the given host, which should
- * be used when no credentials have been explicitly supplied for
- * the challenging realm.
- * @param host The host the realm belongs to. The null host
- * signifies default credentials which should be used when no
- * credentials have been explicitly supplied for the challenging
- * host.
- * @param port The port the realm belongs to. A negitive port
- * signifies the credentials are applicaple to any port when no
- * credentials have been explicitly supplied for the challenging
- * port.
- * @param username The username
- * @param password The password
- */
- public void setProxyCredentials(String realm, String host, int port,
- String username, String password) {
- AuthScope authScope = new AuthScope(host, port, realm);
- UsernamePasswordCredentials creds = new UsernamePasswordCredentials(username, password);
-
- getHttpState().setProxyCredentials(authScope, creds);
- }
-
- /**
- * Sets the proxy credentials for the given authentication scope.
- * Any previous credentials for the given scope will be
- * overwritten.
- *
- * This method should be used when setting credentials for the
- * NTLM authentication scheme.
- *
- * @param realm The authentication realm. The null realm
- * signifies default credentials for the given host, which should
- * be used when no credentials have been explicitly supplied for
- * the challenging realm.
- * @param host The host the realm belongs to. The null host
- * signifies default credentials which should be used when no
- * credentials have been explicitly supplied for the challenging
- * host.
- * @param port The port the realm belongs to. A negitive port
- * signifies the credentials are applicaple to any port when no
- * credentials have been explicitly supplied for the challenging
- * port.
- * @param username The username, this should not include the
- * domain to authenticate with. For example: "user" is correct
- * wheareas "DOMAIN\\user" is not.
- * @param password The password
- * @param thisHost The host the authentication requiest is originating
- * from. Essentially, the computer name for this machine.
- * @param domain The domain to authentice with.
- */
- public void setProxyCredentials(String realm, String host, int port,
- String username, String password,
- String domain, String thisHost) {
- AuthScope authScope = new AuthScope(host, port, realm);
- NTCredentials creds = new NTCredentials(username, password, thisHost, domain);
-
- getHttpState().setProxyCredentials(authScope, creds);
- }
-
- /**
- * Clears all credentials.
- */
- public void clearCredentials() {
- getHttpState().clearCredentials();
- }
-
- /**
- * Clears all proxy credentials.
- */
- public void clearProxyCredentials() {
- getHttpState().clearProxyCredentials();
- }
-
- /**
- * Get the HTTP state.
- *
- * @return the HTTP state.
- */
- public HttpState getHttpState() {
- return state;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.java
deleted file mode 100644
index 1ea3b21feb3..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache.config;
-
-import java.util.Map;
-
-
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-
-/**
- * A default client configuration for clients that utilizes the
- * Apache HTTP client to send and receive HTTP request and responses.
- * <p>
- * This class may be extended for specific configuration purposes.
- *
- * @author jorgeluisw@mac.com
- * @author Paul.Sandoz@Sun.Com
- */
-public class DefaultApacheHttpClientConfig extends DefaultClientConfig
- implements ApacheHttpClientConfig {
-
- public ApacheHttpClientState getState() {
- Map<String, Object> props = getProperties();
- ApacheHttpClientState state = (ApacheHttpClientState)props.get(PROPERTY_HTTP_STATE);
-
- if (state == null) {
- state = new ApacheHttpClientState();
- props.put(PROPERTY_HTTP_STATE, state);
- }
-
- return state;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.java
deleted file mode 100644
index 3a8e35304e9..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.apache.config;
-
-import org.apache.commons.httpclient.Credentials;
-import org.apache.commons.httpclient.NTCredentials;
-import org.apache.commons.httpclient.UsernamePasswordCredentials;
-import org.apache.commons.httpclient.auth.AuthScheme;
-import org.apache.commons.httpclient.auth.CredentialsNotAvailableException;
-import org.apache.commons.httpclient.auth.CredentialsProvider;
-import org.apache.commons.httpclient.auth.NTLMScheme;
-import org.apache.commons.httpclient.auth.RFC2617Scheme;
-
-import javax.swing.*;
-import java.io.IOException;
-
-/**
- * A simple interactive credentials provider using Swing dialogs to prompt
- * the user for a user name and password.
- *
- * @author jorgeluisw@mac.com
- */
-public class DefaultCredentialsProvider implements CredentialsProvider {
-
- public Credentials getCredentials(AuthScheme scheme,
- String host,
- int port,
- boolean proxy)
- throws CredentialsNotAvailableException {
- if (scheme == null) {
- return null;
- }
-
- try {
- JTextField userField = new JTextField();
- JPasswordField passwordField = new JPasswordField();
- int response;
-
- if (scheme instanceof NTLMScheme) {
- JTextField domainField = new JTextField();
- Object[] msg = {
- host + ":" + port + " requires Windows authentication",
- "Domain",
- domainField,
- "User Name",
- userField,
- "Password",
- passwordField
- };
- response = JOptionPane.showConfirmDialog(null, msg, "Authenticate",
- JOptionPane.OK_CANCEL_OPTION);
-
- if ((response == JOptionPane.CANCEL_OPTION) ||
- (response == JOptionPane.CLOSED_OPTION)) {
- throw new CredentialsNotAvailableException("User cancled windows authentication.");
- }
-
- return new NTCredentials(userField.getText(), new String(passwordField.getPassword()),
- host, domainField.getText());
-
-
- } else if (scheme instanceof RFC2617Scheme) {
- Object[] msg = {
- host + ":" + port + " requires authentication with the realm '" +
- scheme.getRealm() + "'",
- "User Name",
- userField,
- "Password",
- passwordField
- };
-
- response = JOptionPane.showConfirmDialog(null, msg, "Authenticate",
- JOptionPane.OK_CANCEL_OPTION);
-
- if ((response == JOptionPane.CANCEL_OPTION) ||
- (response == JOptionPane.CLOSED_OPTION)) {
- throw new CredentialsNotAvailableException("User cancled windows authentication.");
- }
-
-
- return new UsernamePasswordCredentials(userField.getText(),
- new String(passwordField.getPassword()));
-
- } else {
-
- throw new CredentialsNotAvailableException("Unsupported authentication scheme: " +
- scheme.getSchemeName());
-
- }
- } catch (IOException ioe) {
-
- throw new CredentialsNotAvailableException(ioe.getMessage(), ioe);
-
- }
- }
-}
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/package-info.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/package-info.java
deleted file mode 100644
index 58dd76a6791..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/config/package-info.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for configuration of a
- * {@link com.sun.jersey.client.apache.ApacheHttpClient}.
- * <p>
- */
-package com.sun.jersey.client.apache.config; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/package-info.java b/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/package-info.java
deleted file mode 100644
index 64442455a03..00000000000
--- a/plugins/com.sun.jersey.client.apache.source/com/sun/jersey/client/apache/package-info.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for the Client API that utilizes the Apache HTTP client to
- * send and receive HTTP request and responses.
- * <p>
- * The client API with the Apache HTTP client can be used as follows to make
- * simple GET and POST requests to a Web resource:
- * <blockquote><pre>
- * Client c = ApacheHttpClient.create();
- * WebResource r = c.resource("http://host/base");
- * String s = r.get(String.class);
- * s = r.post(String.class, s);
- * </pre></blockquote>
- * <p>
- * To support basic authentication with the user name "foo" and the password
- * "bar" the following configuration may be utilized:
- * <blockquote><pre>
- * DefaultApacheHttpClientConfig config = new DefaultApacheHttpClientConfig();
- * config.getState().setCredentials(null, null, -1, "foo", "bar");
- * ApacheHttpClient c = ApacheHttpClient.create(config);
- * WebResource r = c.resource("http://host/base");
- * String s = r.get(String.class);
- * s = r.post(String.class, s);
- * </pre></blockquote>
- */
-package com.sun.jersey.client.apache; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.client.apache/.classpath b/plugins/com.sun.jersey.client.apache/.classpath
deleted file mode 100644
index 4f306b494e4..00000000000
--- a/plugins/com.sun.jersey.client.apache/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry exported="true" kind="lib" path="" sourcepath="/com.sun.jersey.client.apache.source"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/com.sun.jersey.client.apache/.project b/plugins/com.sun.jersey.client.apache/.project
deleted file mode 100644
index 875cab709b6..00000000000
--- a/plugins/com.sun.jersey.client.apache/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>com.sun.jersey.client.apache</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/com.sun.jersey.client.apache/META-INF/MANIFEST.MF b/plugins/com.sun.jersey.client.apache/META-INF/MANIFEST.MF
deleted file mode 100644
index f691fcaee1f..00000000000
--- a/plugins/com.sun.jersey.client.apache/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,30 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Jersey Apache Client
-Bundle-SymbolicName: com.sun.jersey.client.apache
-Bundle-Version: 1.8.0.qualifier
-Bundle-Vendor: jersey.java.net
-Export-Package: com.sun.jersey.client.apache,
- com.sun.jersey.client.apache.config
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: com.sun.jersey.api.client,
- com.sun.jersey.api.client.config,
- com.sun.jersey.core.spi.component.ioc,
- com.sun.jersey.spi,
- javax.ws.rs.core,
- com.sun.jersey.core.header,
- com.sun.jersey.core.util,
- org.apache.commons.codec;version="1.3.0",
- org.apache.commons.codec.binary;version="1.3.0",
- org.apache.commons.codec.digest;version="1.3.0",
- org.apache.commons.codec.language;version="1.3.0",
- org.apache.commons.codec.net;version="1.3.0",
- org.apache.commons.httpclient;version="3.1.0",
- org.apache.commons.httpclient.auth;version="3.1.0",
- org.apache.commons.httpclient.cookie;version="3.1.0",
- org.apache.commons.httpclient.methods;version="3.1.0",
- org.apache.commons.httpclient.methods.multipart;version="3.1.0",
- org.apache.commons.httpclient.params;version="3.1.0",
- org.apache.commons.httpclient.protocol;version="3.1.0",
- org.apache.commons.httpclient.util;version="3.1.0",
- org.apache.commons.logging
diff --git a/plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.properties b/plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.properties
deleted file mode 100644
index 26b2173c45f..00000000000
--- a/plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Fri Jun 24 12:18:11 CEST 2011
-version=1.8
-groupId=com.sun.jersey.contribs
-artifactId=jersey-apache-client
diff --git a/plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.xml b/plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.xml
deleted file mode 100644
index 49aff93b3a5..00000000000
--- a/plugins/com.sun.jersey.client.apache/META-INF/maven/com.sun.jersey.contribs/jersey-apache-client/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
-
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License"). You
- may not use this file except in compliance with the License. You can
- obtain a copy of the License at
- http://glassfish.java.net/public/CDDL+GPL_1_1.html
- or packager/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
-
- When distributing the software, include this License Header Notice in each
- file and include the License file at packager/legal/LICENSE.txt.
-
- GPL Classpath Exception:
- Oracle designates this particular file as subject to the "Classpath"
- exception as provided by Oracle in the GPL Version 2 section of the License
- file that accompanied this code.
-
- Modifications:
- If applicable, add the following below the License Header, with the fields
- enclosed by brackets [] replaced by your own identifying information:
- "Portions Copyright [year] [name of copyright owner]"
-
- Contributor(s):
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-contribs</artifactId>
- <version>1.8</version>
- </parent>
- <artifactId>jersey-apache-client</artifactId>
- <packaging>jar</packaging>
- <name>Jersey Apache HTTP Client</name>
- <dependencies>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <links>
- <link>http://jsr311.java.net/nonav/releases/1.1</link>
- <link>http://jersey.java.net/nonav/apidocs/${project.version}/jersey/</link>
- </links>
- <excludePackageNames>com.sun.jersey.client.apache.impl</excludePackageNames>
- <notimestamp>true</notimestamp>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>cobertura</id>
- <activation>
- <property>
- <name>cobertura</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${project.version}</version>
- <classifier>cobertura</classifier>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-grizzly2</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <classifier>cobertura</classifier>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-grizzly2</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/plugins/com.sun.jersey.client.apache/build.properties b/plugins/com.sun.jersey.client.apache/build.properties
deleted file mode 100644
index f2b5072ab08..00000000000
--- a/plugins/com.sun.jersey.client.apache/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-output.. = .
-bin.includes = META-INF/,\
- com/
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClient.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClient.class
deleted file mode 100644
index 16b94416c4c..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClient.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$CustomMethod.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$CustomMethod.class
deleted file mode 100644
index 5fc06e80159..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$CustomMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$HttpClientResponseInputStream.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$HttpClientResponseInputStream.class
deleted file mode 100644
index fed080f2e1f..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler$HttpClientResponseInputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler.class
deleted file mode 100644
index c6c64e15c6e..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpClientHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.class
deleted file mode 100644
index 1bf57f72104..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/ApacheHttpMethodExecutor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$1.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$1.class
deleted file mode 100644
index 382a0fcb7f6..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$2.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$2.class
deleted file mode 100644
index 78a588af4c1..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$3.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$3.class
deleted file mode 100644
index c4ff93f687c..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.class
deleted file mode 100644
index fdedf2cf2e0..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/DefaultApacheHttpMethodExecutor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.class
deleted file mode 100644
index 4e4b94a0399..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientState.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientState.class
deleted file mode 100644
index 50c782acd01..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/ApacheHttpClientState.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.class
deleted file mode 100644
index 4b01f091cbf..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultApacheHttpClientConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.class b/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.class
deleted file mode 100644
index e31cf497f4d..00000000000
--- a/plugins/com.sun.jersey.client.apache/com/sun/jersey/client/apache/config/DefaultCredentialsProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey.client.apache/pom.xml b/plugins/com.sun.jersey.client.apache/pom.xml
deleted file mode 100644
index 236337325fc..00000000000
--- a/plugins/com.sun.jersey.client.apache/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.x.core.parent</artifactId>
- <version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.x.core.parent</relativePath>
- </parent>
-
- <artifactId>com.sun.jersey.client.apache</artifactId>
- <packaging>eclipse-plugin</packaging>
- <name>com.sun.jersey.client.apache</name>
- <version>1.8.0-SNAPSHOT</version>
-</project> \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/.classpath b/plugins/com.sun.jersey.source/.classpath
deleted file mode 100644
index f2d414669db..00000000000
--- a/plugins/com.sun.jersey.source/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry exported="true" kind="lib" path=""/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/com.sun.jersey.source/.project b/plugins/com.sun.jersey.source/.project
deleted file mode 100644
index 8249dbb7f16..00000000000
--- a/plugins/com.sun.jersey.source/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>com.sun.jersey.source</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/com.sun.jersey.source/META-INF/MANIFEST.MF b/plugins/com.sun.jersey.source/META-INF/MANIFEST.MF
deleted file mode 100644
index 77da4628dd9..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Jersey Source
-Bundle-SymbolicName: com.sun.jersey.source
-Bundle-Version: 1.8.0.qualifier
-Bundle-Vendor: jersey.java.net
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/com.sun.jersey.source/META-INF/jersey-module-version b/plugins/com.sun.jersey.source/META-INF/jersey-module-version
deleted file mode 100644
index 6259340971b..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/jersey-module-version
+++ /dev/null
@@ -1 +0,0 @@
-1.8
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider
+++ /dev/null
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider
deleted file mode 100644
index 4905c35f378..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider
+++ /dev/null
@@ -1,9 +0,0 @@
-com.sun.jersey.core.impl.provider.header.LocaleProvider
-com.sun.jersey.core.impl.provider.header.EntityTagProvider
-com.sun.jersey.core.impl.provider.header.MediaTypeProvider
-com.sun.jersey.core.impl.provider.header.CacheControlProvider
-com.sun.jersey.core.impl.provider.header.NewCookieProvider
-com.sun.jersey.core.impl.provider.header.CookieProvider
-com.sun.jersey.core.impl.provider.header.URIProvider
-com.sun.jersey.core.impl.provider.header.DateProvider
-com.sun.jersey.core.impl.provider.header.StringProvider
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.StringReaderProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.StringReaderProvider
deleted file mode 100644
index e73eb3dbab0..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.StringReaderProvider
+++ /dev/null
@@ -1,6 +0,0 @@
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$TypeFromStringEnum
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$TypeValueOf
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$TypeFromString
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$StringConstructor
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$DateProvider
-com.sun.jersey.server.impl.model.parameter.multivalued.JAXBStringReaderProviders$RootElementProvider
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerProvider
deleted file mode 100644
index 9d53c752f08..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerProvider
+++ /dev/null
@@ -1,2 +0,0 @@
-com.sun.jersey.server.impl.container.httpserver.HttpHandlerContainerProvider
-com.sun.jersey.server.impl.container.grizzly.GrizzlyContainerProvider
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter
deleted file mode 100644
index a25c3d85b2a..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.container.filter.NormalizeFilter
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter
+++ /dev/null
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider
deleted file mode 100644
index e2682dc70ff..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider
+++ /dev/null
@@ -1,6 +0,0 @@
-com.sun.jersey.server.impl.model.method.dispatch.VoidVoidDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.HttpReqResDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.MultipartFormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider
-
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider
deleted file mode 100644
index 132a36d8db1..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider
+++ /dev/null
@@ -1,5 +0,0 @@
-com.sun.jersey.server.impl.model.method.dispatch.VoidVoidDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.HttpReqResDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.MultipartFormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider
deleted file mode 100644
index a8d59db87bf..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.container.WebApplicationProviderImpl
diff --git a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider b/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider
deleted file mode 100644
index c5ee8c2ab37..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider
+++ /dev/null
@@ -1,5 +0,0 @@
-com.sun.jersey.core.impl.provider.xml.SAXParserContextProvider
-com.sun.jersey.core.impl.provider.xml.XMLStreamReaderContextProvider
-com.sun.jersey.core.impl.provider.xml.DocumentBuilderFactoryProvider
-com.sun.jersey.core.impl.provider.xml.TransformerFactoryProvider
-
diff --git a/plugins/com.sun.jersey.source/META-INF/services/javax.enterprise.inject.spi.Extension b/plugins/com.sun.jersey.source/META-INF/services/javax.enterprise.inject.spi.Extension
deleted file mode 100644
index 4222d19b29e..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/javax.enterprise.inject.spi.Extension
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.cdi.CDIExtension \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/META-INF/services/javax.servlet.ServletContainerInitializer b/plugins/com.sun.jersey.source/META-INF/services/javax.servlet.ServletContainerInitializer
deleted file mode 100644
index 26f35bb3243..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/javax.servlet.ServletContainerInitializer
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyReader b/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyReader
deleted file mode 100644
index 99ebed0b289..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyReader
+++ /dev/null
@@ -1,45 +0,0 @@
-com.sun.jersey.core.impl.provider.entity.StringProvider
-com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
-com.sun.jersey.core.impl.provider.entity.FileProvider
-com.sun.jersey.core.impl.provider.entity.InputStreamProvider
-com.sun.jersey.core.impl.provider.entity.DataSourceProvider
-com.sun.jersey.core.impl.provider.entity.RenderedImageProvider
-com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
-com.sun.jersey.core.impl.provider.entity.FormProvider
-com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
-com.sun.jersey.core.impl.provider.entity.ReaderProvider
-com.sun.jersey.core.impl.provider.entity.DocumentProvider
-com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
-com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
-com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
-com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
-com.sun.jersey.core.impl.provider.entity.EntityHolderReader
-com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider
-com.sun.jersey.atom.rome.impl.provider.entity.AtomEntryProvider
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
-com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
-
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetRootElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetJAXBElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetListElementProvider
-
diff --git a/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyWriter b/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyWriter
deleted file mode 100644
index 0a542d5c594..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.MessageBodyWriter
+++ /dev/null
@@ -1,40 +0,0 @@
-com.sun.jersey.core.impl.provider.entity.StringProvider
-com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
-com.sun.jersey.core.impl.provider.entity.FileProvider
-com.sun.jersey.core.impl.provider.entity.InputStreamProvider
-com.sun.jersey.core.impl.provider.entity.DataSourceProvider
-com.sun.jersey.core.impl.provider.entity.RenderedImageProvider
-com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
-com.sun.jersey.core.impl.provider.entity.FormProvider
-com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
-com.sun.jersey.core.impl.provider.entity.ReaderProvider
-com.sun.jersey.core.impl.provider.entity.DocumentProvider
-com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
-com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
-com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
-com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider
-com.sun.jersey.atom.rome.impl.provider.entity.AtomEntryProvider
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
-com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetRootElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetJAXBElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetListElementProvider
diff --git a/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.RuntimeDelegate b/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.RuntimeDelegate
deleted file mode 100644
index 0d2c36fbb72..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/services/javax.ws.rs.ext.RuntimeDelegate
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.provider.RuntimeDelegateImpl
diff --git a/plugins/com.sun.jersey.source/META-INF/taglib.tld b/plugins/com.sun.jersey.source/META-INF/taglib.tld
deleted file mode 100644
index 2e83f8eabc1..00000000000
--- a/plugins/com.sun.jersey.source/META-INF/taglib.tld
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
- <tlib-version>1.0</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>jerseyview</short-name>
- <uri>urn:com:sun:jersey:api:view</uri>
- <description>
- The tag library contains tags that takes advantage of
- the request dispatching mechanism.
- </description>
- <tag>
- <name>include</name>
- <tag-class>com.sun.jersey.server.impl.container.servlet.Include</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <name>page</name>
- <required>yes</required>
- <rtexprvalue>yes</rtexprvalue>
- </attribute>
- <attribute>
- <name>resource</name>
- <required>no</required>
- <rtexprvalue>yes</rtexprvalue>
- </attribute>
- </tag>
-</taglib>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/com.sun.jersey.source/build.properties b/plugins/com.sun.jersey.source/build.properties
deleted file mode 100644
index 33a52111be5..00000000000
--- a/plugins/com.sun.jersey.source/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-output.. = .
-bin.includes = META-INF/,\
- com/,\
- javax/
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/ConflictException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/ConflictException.java
deleted file mode 100644
index 4d5f308f4e1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/ConflictException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-
-/**
- * A HTTP 409 (Conflict) exception.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ConflictException extends WebApplicationException {
-
- /**
- * Create a HTTP 409 (Conflict) exception.
- */
- public ConflictException() {
- super(Responses.conflict().build());
- }
-
- /**
- * Create a HTTP 409 (Conflict) exception.
- * @param message the String that is the entity of the 409 response.
- */
- public ConflictException(String message) {
- super(Response.status(Responses.CONFLICT).
- entity(message).type("text/plain").build());
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/JResponse.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/JResponse.java
deleted file mode 100644
index 90fddc233b6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/JResponse.java
+++ /dev/null
@@ -1,1022 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api;
-
-import com.sun.jersey.core.header.OutBoundHeaders;
-import com.sun.jersey.core.spi.factory.ResponseImpl;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.GenericEntity;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.NewCookie;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.Response.StatusType;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.Variant;
-
-/**
- * Defines the contract between a returned instance and the runtime when
- * an application needs to provide metadata to the runtime.
- * <p>
- * JResponse is a type safe alternative to {@link Response} that preserves the
- * type information of response entity thus it is not necessary to utilize
- * {@link GenericEntity}. It provides equivalent functionality to
- * {@link Response}.
- * <p>
- * JResponse may be extended in combination with {@link AJResponseBuilder}
- * specialization when building responses.
- * <p>
- * Several methods have parameters of type URI, {@link UriBuilder} provides
- * convenient methods to create such values as does
- * {@link <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html#create(java.lang.String)">URI.create()</a>}.
- *
- * @param <E> The entity type
- * @see JResponseBuilder
- * @see Response
- * @author Paul.Sandoz@Sun.Com
- */
-public class JResponse<E> {
- private final StatusType statusType;
-
- private final E entity;
-
- private final OutBoundHeaders headers;
-
- /**
- * Construct given a status type, entity and metadata.
- *
- * @param statusType the status type
- * @param headers the metadata, it is the callers responsibility to copy
- * the metadata if necessary.
- * @param entity the entity
- */
- public JResponse(StatusType statusType, OutBoundHeaders headers, E entity) {
- this.statusType = statusType;
- this.entity = entity;
- this.headers = headers;
- }
-
- /**
- * Construct given a status, entity and metadata.
- *
- * @param status the status
- * @param headers the metadata, it is the callers responsibility to copy
- * the metadata if necessary.
- * @param entity the entity
- */
- public JResponse(int status, OutBoundHeaders headers, E entity) {
- this(ResponseImpl.toStatusType(status), headers, entity);
- }
-
- /**
- * Construct a shallow copy. The metadata map will be copied but not the
- * key/value references.
- *
- * @param that the JResponse to copy from.
- */
- public JResponse(JResponse<E> that) {
- this(that.statusType,
- that.headers != null ? new OutBoundHeaders(that.headers) : null,
- that.entity);
- }
-
- /**
- * Construct from a {@link AJResponseBuilder}.
- *
- * @param b the builder.
- */
- protected JResponse(AJResponseBuilder<E, ?> b) {
- this.statusType = b.getStatusType();
- this.entity = b.getEntity();
- this.headers = b.getMetadata();
- }
-
- /**
- * Convert to a {@link Response} compatible instance.
- *
- * @return the {@link Response} compatible instance.
- */
- public JResponseAsResponse toResponse() {
- return new JResponseAsResponse(this);
- }
-
- /**
- * Convert to a {@link Response} compatible instance.
- *
- * @param type the entity type
- * @return the {@link Response} compatible instance.
- */
- public JResponseAsResponse toResponse(Type type) {
- return new JResponseAsResponse(this, type);
- }
-
- /**
- * Get the status type associated with the response.
- *
- * @return the response status type.
- */
- public StatusType getStatusType() {
- return statusType;
- }
-
- /**
- * Get the status code associated with the response.
- *
- * @return the response status code.
- */
- public int getStatus() {
- return statusType.getStatusCode();
- }
-
- /**
- * Get metadata associated with the response as a map. The returned map
- * may be subsequently modified by the JAX-RS runtime. Values will be
- * serialized using a {@link javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate}
- * if one is available via
- * {@link javax.ws.rs.ext.RuntimeDelegate#createHeaderDelegate(java.lang.Class)}
- * for the class of the value or using the values {@code toString} method if a
- * header delegate is not available.
- *
- * @return response metadata as a map
- */
- public OutBoundHeaders getMetadata() {
- return headers;
- }
-
- /**
- * Get the response entity. The response will be serialized using a
- * MessageBodyWriter for the class and type the entity <code>E</code>.
- *
- * @return the response entity.
- * @see javax.ws.rs.ext.MessageBodyWriter
- */
- public E getEntity() {
- return entity;
- }
-
- /**
- * Get the type of the entity.
- *
- * @return the type of the entity.
- */
- public Type getType() {
- return getSuperclassTypeParameter(getClass());
- }
-
- private static Type getSuperclassTypeParameter(Class<?> subclass) {
- Type superclass = subclass.getGenericSuperclass();
- if (!(superclass instanceof ParameterizedType)) {
- return Object.class;
- }
- ParameterizedType parameterized = (ParameterizedType) superclass;
- return parameterized.getActualTypeArguments()[0];
- }
-
-
- /**
- * Create a new {@link JResponseBuilder} by performing a shallow copy of an
- * existing {@link Response}. The returned builder has its own metadata map but
- * entries are simply references to the keys and values contained in the
- * supplied Response metadata map.
- *
- * @param <E> The entity type
- * @param response a Response from which the status code, entity and metadata
- * will be copied
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> fromResponse(Response response) {
- JResponseBuilder b = status(response.getStatus());
- b.entity(response.getEntity());
- for (String headerName: response.getMetadata().keySet()) {
- List<Object> headerValues = response.getMetadata().get(headerName);
- for (Object headerValue: headerValues) {
- b.header(headerName, headerValue);
- }
- }
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} by performing a shallow copy of an
- * existing {@link JResponse}. The returned builder has its own metadata map but
- * entries are simply references to the keys and values contained in the
- * supplied Response metadata map.
- *
- * @param <E> The entity type
- * @param response a JResponse from which the status code, entity and metadata
- * will be copied
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> fromResponse(JResponse<E> response) {
- JResponseBuilder<E> b = status(response.getStatus());
- b.entity(response.getEntity());
- for (String headerName: response.getMetadata().keySet()) {
- List<Object> headerValues = response.getMetadata().get(headerName);
- for (Object headerValue: headerValues) {
- b.header(headerName, headerValue);
- }
- }
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} with the supplied status.
- *
- * @param <E> The entity type
- * @param status the response status
- * @return a new JResponseBuilder
- * @throws IllegalArgumentException if status is null
- */
- public static <E> JResponseBuilder<E> status(StatusType status) {
- JResponseBuilder<E> b = new JResponseBuilder<E>();
- b.status(status);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} with the supplied status.
- *
- * @param <E> The entity type
- * @param status the response status
- * @return a new JResponseBuilder
- * @throws IllegalArgumentException if status is null
- */
- public static <E> JResponseBuilder<E> status(Response.Status status) {
- return status((StatusType)status);
- }
-
- /**
- * Create a new {@link JResponseBuilder} with the supplied status.
- *
- * @param <E> The entity type
- * @param status the response status
- * @return a new JResponseBuilder
- * @throws IllegalArgumentException if status is less than 100 or greater
- * than 599.
- */
- public static <E> JResponseBuilder<E> status(int status) {
- JResponseBuilder<E> b = new JResponseBuilder<E>();
- b.status(status);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} with an OK status.
- *
- * @param <E> The entity type
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> ok() {
- JResponseBuilder b = status(Status.OK);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} that contains a representation.
- *
- * @param <E> The entity type
- * @param entity the representation entity data
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> ok(E entity) {
- JResponseBuilder<E> b = ok();
- b.entity(entity);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} that contains a representation.
- *
- * @param <E> The entity type
- * @param entity the representation entity data
- * @param type the media type of the entity
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> ok(E entity, MediaType type) {
- JResponseBuilder<E> b = ok();
- b.entity(entity);
- b.type(type);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} that contains a representation.
- *
- * @param <E> The entity type
- * @param entity the representation entity data
- * @param type the media type of the entity
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> ok(E entity, String type) {
- JResponseBuilder<E> b = ok();
- b.entity(entity);
- b.type(type);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} that contains a representation.
- *
- * @param <E> The entity type
- * @param entity the representation entity data
- * @param variant representation metadata
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> ok(E entity, Variant variant) {
- JResponseBuilder<E> b = ok();
- b.entity(entity);
- b.variant(variant);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} with an server error status.
- *
- * @param <E> The entity type
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> serverError() {
- JResponseBuilder<E> b = status(Status.INTERNAL_SERVER_ERROR);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} for a created resource, set the
- * location header using the supplied value.
- *
- * @param <E> The entity type
- * @param location the URI of the new resource. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the request URI (see {@link UriInfo#getRequestUri}).
- * @return a new JResponseBuilder
- * @throws java.lang.IllegalArgumentException if location is null
- */
- public static <E> JResponseBuilder<E> created(URI location) {
- JResponseBuilder<E> b = JResponse.<E>status(Status.CREATED).location(location);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} for an empty response.
- *
- * @param <E> The entity type
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> noContent() {
- JResponseBuilder<E> b = status(Status.NO_CONTENT);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} with a not-modified status.
- *
- * @param <E> The entity type
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> notModified() {
- JResponseBuilder<E> b = status(Status.NOT_MODIFIED);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} with a not-modified status.
- *
- * @param <E> The entity type
- * @param tag a tag for the unmodified entity
- * @return a new JResponseBuilder
- * @throws java.lang.IllegalArgumentException if tag is null
- */
- public static <E> JResponseBuilder<E> notModified(EntityTag tag) {
- JResponseBuilder<E> b = notModified();
- b.tag(tag);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} with a not-modified status
- * and a strong entity tag. This is a shortcut
- * for <code>notModified(new EntityTag(<i>value</i>))</code>.
- *
- * @param <E> The entity type
- * @param tag the string content of a strong entity tag. The JAX-RS
- * runtime will quote the supplied value when creating the header.
- * @return a new JResponseBuilder
- * @throws java.lang.IllegalArgumentException if tag is null
- */
- public static <E> JResponseBuilder<E> notModified(String tag) {
- JResponseBuilder b = notModified();
- b.tag(tag);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} for a redirection. Used in the
- * redirect-after-POST (aka POST/redirect/GET) pattern.
- *
- * @param <E> The entity type
- * @param location the redirection URI. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the base URI of the application (see
- * {@link UriInfo#getBaseUri}).
- * @return a new JResponseBuilder
- * @throws java.lang.IllegalArgumentException if location is null
- */
- public static <E> JResponseBuilder<E> seeOther(URI location) {
- JResponseBuilder<E> b = JResponse.<E>status(Status.SEE_OTHER).location(location);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} for a temporary redirection.
- *
- * @param <E> The entity type
- * @param location the redirection URI. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the base URI of the application (see
- * {@link UriInfo#getBaseUri}).
- * @return a new JResponseBuilder
- * @throws java.lang.IllegalArgumentException if location is null
- */
- public static <E> JResponseBuilder<E> temporaryRedirect(URI location) {
- JResponseBuilder<E> b = JResponse.<E>status(Status.TEMPORARY_REDIRECT).location(location);
- return b;
- }
-
- /**
- * Create a new {@link JResponseBuilder} for a not acceptable response.
- *
- * @param <E> The entity type
- * @param variants list of variants that were available, a null value is
- * equivalent to an empty list.
- * @return a new JResponseBuilder
- */
- public static <E> JResponseBuilder<E> notAcceptable(List<Variant> variants) {
- JResponseBuilder<E> b = JResponse.<E>status(Status.NOT_ACCEPTABLE).variants(variants);
- return b;
- }
-
- /**
- * A class used to build {@link JResponse} instances that contain metadata
- * instead of or in addition to an entity. An initial instance may be
- * obtained via static methods of the {@link JResponse} class, instance
- * methods provide the ability to set metadata. E.g. to create a response
- * that indicates the creation of a new resource:
- * <pre>&#64;POST
- * JResponse addWidget(...) {
- * Widget w = ...
- * URI widgetId = UriBuilder.fromResource(Widget.class)...
- * return JResponse.created(widgetId).build();
- * }</pre>
- * <p>
- * Several methods have parameters of type URI, {@link UriBuilder}
- * provides convenient methods to create such values as does
- * <code>URI.create()</code>.
- * <p>
- * Where multiple variants of the same method are provided, the type of
- * the supplied parameter is retained in the metadata of the built
- * {@link JResponse}.
- *
- * @param <E> The entity type
- */
- public static final class JResponseBuilder<E> extends AJResponseBuilder<E, JResponseBuilder<E>> {
- /**
- * Default constructor.
- */
- public JResponseBuilder() {}
-
- /**
- * Construct a shallow copy. The metadata map will be copied but not the
- * key/value references.
- *
- * @param that the JResponseBuilder to copy from.
- */
- public JResponseBuilder(JResponseBuilder<E> that) {
- super(that);
- }
-
- /**
- * Create a shallow copy preserving state. The metadata map will be
- * copied but not the key/value references.
- *
- * @return the copy.
- */
- @Override
- public JResponseBuilder<E> clone() {
- return new JResponseBuilder<E>(this);
- }
-
- /**
- * Create a {@link JResponse} instance from the current JResponseBuilder.
- * The builder is reset to a blank state equivalent to calling
- * {@link JResponse#ok() }.
- *
- * @return a JResponse instance
- */
- public JResponse<E> build() {
- JResponse<E> r = new JResponse<E>(this);
- reset();
- return r;
- }
- }
-
- /**
- * An abstract response builder that may be utilized to extend
- * response building and the construction of {@link JResponse}
- * instances.
- *
- * @param <E> The entity type
- * @param <B> The builder type
- */
- public static abstract class AJResponseBuilder<E, B extends AJResponseBuilder> {
- /**
- * The status type.
- */
- protected StatusType statusType = Status.NO_CONTENT;
-
- /**
- * The response metadata.
- */
- protected OutBoundHeaders headers;
-
- /**
- * The entity.
- */
- protected E entity;
-
- /**
- * Default constructor.
- */
- protected AJResponseBuilder() {}
-
- /**
- * Construct a shallow copy. The metadata map will be copied but not the
- * key/value references.
- *
- * @param that the AJResponseBuilder to copy from.
- */
- protected AJResponseBuilder(AJResponseBuilder<E, ?> that) {
- this.statusType = that.statusType;
- this.entity = that.entity;
- if (that.headers != null) {
- this.headers = new OutBoundHeaders(that.headers);
- } else {
- this.headers = null;
- }
- }
-
- /**
- * Reset to the default state.
- */
- protected void reset() {
- statusType = Status.NO_CONTENT;
- entity = null;
- headers = null;
- }
-
- /**
- * Get the status type associated with the response.
- *
- * @return the response status type.
- */
- protected StatusType getStatusType() {
- return statusType;
- }
-
- /**
- * Get the status code associated with the response.
- *
- * @return the response status code.
- */
- protected int getStatus() {
- return statusType.getStatusCode();
- }
-
- /**
- * Get the metadata associated with the response.
- *
- * @return response metadata as a map
- */
- protected OutBoundHeaders getMetadata() {
- if (headers == null)
- headers = new OutBoundHeaders();
- return headers;
- }
-
- /**
- * Get the response entity.
- *
- * @return the response entity.
- */
- protected E getEntity() {
- return entity;
- }
-
- /**
- * Set the status.
- *
- * @param status the response status
- * @return the updated instance
- * @throws IllegalArgumentException if status is less than 100 or greater
- * than 599.
- */
- public B status(int status) {
- return status(ResponseImpl.toStatusType(status));
- }
-
- /**
- * Set the status.
- *
- * @param status the response status
- * @return the updated instance.
- * @throws IllegalArgumentException if status is null
- */
- public B status(StatusType status) {
- if (status == null)
- throw new IllegalArgumentException();
- this.statusType = status;
- return (B)this;
- };
-
- /**
- * Set the status.
- *
- * @param status the response status
- * @return the updated instance.
- * @throws IllegalArgumentException if status is null
- */
- public B status(Status status) {
- return status((StatusType)status);
- };
-
- /**
- * Set the entity.
- *
- * @param entity the response entity
- * @return the updated instance
- */
- public B entity(E entity) {
- this.entity = entity;
- return (B)this;
- }
-
- /**
- * Set the response media type.
- *
- * @param type the media type of the response entity, if null any
- * existing value for type will be removed
- * @return the updated instance
- */
- public B type(MediaType type) {
- headerSingle(HttpHeaders.CONTENT_TYPE, type);
- return (B)this;
- }
-
- /**
- * Set the response media type.
- *
- * @param type the media type of the response entity, if null any
- * existing value for type will be removed
- * @return the updated instance
- * @throws IllegalArgumentException if type cannot be parsed
- */
- public B type(String type) {
- return type(type == null ? null : MediaType.valueOf(type));
- }
-
- /**
- * Set representation metadata. Equivalent to setting the values of
- * content type, content language, and content encoding separately using
- * the values of the variant properties.
- *
- * @param variant metadata of the response entity, a null value is
- * equivalent to a variant with all null properties.
- * @return the updated instance
- */
- public B variant(Variant variant) {
- if (variant == null) {
- type((MediaType)null);
- language((String)null);
- encoding(null);
- return (B)this;
- }
-
- type(variant.getMediaType());
- // TODO set charset
- language(variant.getLanguage());
- encoding(variant.getEncoding());
-
- return (B)this;
- }
-
- /**
- * Add a Vary header that lists the available variants.
- *
- * @param variants a list of available representation variants, a null
- * value will remove an existing value for vary.
- * @return the updated instance
- */
- public B variants(List<Variant> variants) {
- if (variants == null) {
- header(HttpHeaders.VARY, null);
- return (B)this;
- }
-
- if (variants.isEmpty())
- return (B)this;
-
- MediaType accept = variants.get(0).getMediaType();
- boolean vAccept = false;
-
- Locale acceptLanguage = variants.get(0).getLanguage();
- boolean vAcceptLanguage = false;
-
- String acceptEncoding = variants.get(0).getEncoding();
- boolean vAcceptEncoding = false;
-
- for (Variant v : variants) {
- vAccept |= !vAccept && vary(v.getMediaType(), accept);
- vAcceptLanguage |= !vAcceptLanguage && vary(v.getLanguage(), acceptLanguage);
- vAcceptEncoding |= !vAcceptEncoding && vary(v.getEncoding(), acceptEncoding);
- }
-
- StringBuilder vary = new StringBuilder();
- append(vary, vAccept, HttpHeaders.ACCEPT);
- append(vary, vAcceptLanguage, HttpHeaders.ACCEPT_LANGUAGE);
- append(vary, vAcceptEncoding, HttpHeaders.ACCEPT_ENCODING);
-
- if (vary.length() > 0)
- header(HttpHeaders.VARY, vary.toString());
- return (B)this;
- }
-
- private boolean vary(MediaType v, MediaType vary) {
- return v != null && !v.equals(vary);
- }
-
- private boolean vary(Locale v, Locale vary) {
- return v != null && !v.equals(vary);
- }
-
- private boolean vary(String v, String vary) {
- return v != null && !v.equalsIgnoreCase(vary);
- }
-
- private void append(StringBuilder sb, boolean v, String s) {
- if (v) {
- if (sb.length() > 0)
- sb.append(',');
- sb.append(s);
- }
- }
-
- /**
- * Set the language.
- *
- * @param language the language of the response entity, if null any
- * existing value for language will be removed
- * @return the updated instance
- */
- public B language(String language) {
- headerSingle(HttpHeaders.CONTENT_LANGUAGE, language);
- return (B)this;
- }
-
- /**
- * Set the language.
- *
- * @param language the language of the response entity, if null any
- * existing value for type will be removed
- * @return the updated instance
- */
- public B language(Locale language) {
- headerSingle(HttpHeaders.CONTENT_LANGUAGE, language);
- return (B)this;
- }
-
- /**
- * Set the location.
- *
- * @param location the location. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the base URI of the application (see
- * {@link UriInfo#getBaseUri}). If null any
- * existing value for location will be removed.
- * @return the updated instance.
- */
- public B location(URI location) {
- headerSingle(HttpHeaders.LOCATION, location);
- return (B)this;
- }
-
- /**
- * Set the content location.
- *
- * @param location the content location. Relative or absolute URIs
- * may be used for the value of content location. If null any
- * existing value for content location will be removed.
- * @return the updated instance
- */
- public B contentLocation(URI location) {
- headerSingle(HttpHeaders.CONTENT_LOCATION, location);
- return (B)this;
- }
-
- /**
- * Set the content encoding.
- *
- * @param encoding the content encoding of the response entity, if null
- * any existing value for type will be removed
- * @return the updated instance
- */
- public B encoding(String encoding) {
- headerSingle(HttpHeaders.CONTENT_ENCODING, encoding);
- return (B)this;
- }
-
- /**
- * Set an entity tag.
- *
- * @param tag the entity tag, if null any
- * existing entity tag value will be removed.
- * @return the updated instance
- */
- public B tag(EntityTag tag) {
- headerSingle(HttpHeaders.ETAG, tag);
- return (B)this;
- }
-
- /**
- * Set a strong entity tag. This is a shortcut
- * for <code>tag(new EntityTag(<i>value</i>))</code>.
- *
- * @param tag the string content of a strong entity tag. The JAX-RS
- * runtime will quote the supplied value when creating the header. If
- * null any existing entity tag value will be removed.
- * @return the updated instance
- */
- public B tag(String tag) {
- return tag(tag == null ? null : new EntityTag(tag));
- }
-
- /**
- * Set the last modified date.
- *
- * @param lastModified the last modified date, if null any existing
- * last modified value will be removed.
- * @return the updated instance
- */
- public B lastModified(Date lastModified) {
- headerSingle(HttpHeaders.LAST_MODIFIED, lastModified);
- return (B)this;
- }
-
- /**
- * Set the cache control.
- *
- * @param cacheControl the cache control directives, if null removes any
- * existing cache control directives.
- * @return the updated instance
- */
- public B cacheControl(CacheControl cacheControl) {
- headerSingle(HttpHeaders.CACHE_CONTROL, cacheControl);
- return (B)this;
- }
-
- /**
- * Set the expires date.
- *
- * @param expires the expiration date, if null removes any existing
- * expires value.
- * @return the updated instance
- */
- public B expires(Date expires) {
- headerSingle(HttpHeaders.EXPIRES, expires);
- return (B)this;
- }
-
- /**
- * Add cookies.
- *
- * @param cookies new cookies that will accompany the response. A null
- * value will remove all cookies, including those added via the
- * {@link #header(java.lang.String, java.lang.Object)} method.
- * @return the updated instance
- */
- public B cookie(NewCookie... cookies) {
- if (cookies != null) {
- for (NewCookie cookie : cookies)
- header(HttpHeaders.SET_COOKIE, cookie);
- } else {
- header(HttpHeaders.SET_COOKIE, null);
- }
- return (B)this;
- }
-
- /**
- * Add a header.
- *
- * @param name the name of the header
- * @param value the value of the header, the header will be serialized
- * using a {@link javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate} if
- * one is available via
- * {@link javax.ws.rs.ext.RuntimeDelegate#createHeaderDelegate(java.lang.Class)}
- * for the class of {@code value} or using its {@code toString} method if a
- * header delegate is not available. If {@code value} is null then all
- * current headers of the same name will be removed.
- * @return the updated instance.
- */
- public B header(String name, Object value) {
- return header(name, value, false);
- }
-
- /**
- * Add a header or replace an existing header.
- *
- * @param name the name of the header
- * @param value the value of the header, the header will be serialized
- * using a {@link javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate} if
- * one is available via
- * {@link javax.ws.rs.ext.RuntimeDelegate#createHeaderDelegate(java.lang.Class)}
- * for the class of {@code value} or using its {@code toString} method if a
- * header delegate is not available. If {@code value} is null then all
- * current headers of the same name will be removed.
- * @return the updated instance.
- */
- public B headerSingle(String name, Object value) {
- return header(name, value, true);
- }
-
- /**
- * Add a header.
- *
- * @param name the name of the header
- * @param value the value of the header, the header will be serialized
- * using a {@link javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate} if
- * one is available via
- * {@link javax.ws.rs.ext.RuntimeDelegate#createHeaderDelegate(java.lang.Class)}
- * for the class of {@code value} or using its {@code toString} method if a
- * header delegate is not available. If {@code value} is null then all
- * current headers of the same name will be removed.
- * @param single if true then replace the header if it exists, otherwise
- * add the header.
- * @return the updated instance.
- */
- public B header(String name, Object value, boolean single) {
- if (value != null) {
- if (single) {
- getMetadata().putSingle(name, value);
- } else {
- getMetadata().add(name, value);
- }
- } else {
- getMetadata().remove(name);
- }
- return (B)this;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/JResponseAsResponse.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/JResponseAsResponse.java
deleted file mode 100644
index 0a41e1f7905..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/JResponseAsResponse.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api;
-
-import com.sun.jersey.core.spi.factory.ResponseImpl;
-import java.lang.reflect.Type;
-
-/**
- * An adaption of {@link JResponse} as a {@link Response}.
- *
- * @see JResponse#toResponse()
- * @see JResponse#toResponse(java.lang.reflect.Type)
- * @author Paul.Sandoz@Sun.Com
- */
-public final class JResponseAsResponse extends ResponseImpl {
- private final JResponse<?> jr;
-
- /* package */ JResponseAsResponse(JResponse<?> jr) {
- this(jr, jr.getType());
- }
-
- /* package */ JResponseAsResponse(JResponse<?> jr, Type type) {
- super(jr.getStatusType(), jr.getMetadata(), jr.getEntity(), type);
- this.jr = jr;
- }
-
- /**
- * Get the adapted {@link JResponse} instance.
- *
- * @return the adapted JResponse instance.
- */
- public JResponse<?> getJResponse() {
- return jr;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/MessageException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/MessageException.java
deleted file mode 100644
index 3fdcebd9c51..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/MessageException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api;
-
-/**
- * This exception may be used in conjuction with WebApplicationException
- * to include a message.
- *
- * @author Paul.Sandoz@Oracle.Com
- */
-public class MessageException extends RuntimeException {
- public MessageException(String message) {
- super(message);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/NotFoundException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/NotFoundException.java
deleted file mode 100644
index ae4b780d316..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/NotFoundException.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api;
-
-import java.net.URI;
-import javax.ws.rs.WebApplicationException;
-
-/**
- * A HTTP 404 (Not Found) exception.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class NotFoundException extends WebApplicationException {
-
- private final URI notFoundUri;
-
- /**
- * Create a HTTP 404 (Not Found) exception.
- */
- public NotFoundException() {
- this((URI)null);
- }
-
- /**
- * Create a HTTP 404 (Not Found) exception.
- *
- * @param notFoundUri the URI that cannot be found.
- */
- public NotFoundException(URI notFoundUri) {
- super(Responses.notFound().build());
- this.notFoundUri = notFoundUri;
- }
-
- /**
- * Create a HTTP 404 (Not Found) exception.
- *
- * @param message the String that is the entity of the 404 response.
- */
- public NotFoundException(String message) {
- this(message, null);
- }
-
- /**
- * Create a HTTP 404 (Not Found) exception.
- *
- * @param message the String that is the entity of the 404 response.
- * @param notFoundUri the URI that cannot be found.
- */
- public NotFoundException(String message, URI notFoundUri) {
- super(Responses.notFound().
- entity(message).type("text/plain").build());
- this.notFoundUri = notFoundUri;
- }
-
- /**
- * Get the URI that is not found.
- *
- * @return the URI that is not found.
- */
- public URI getNotFoundUri() {
- return notFoundUri;
- }
-
- @Override
- public String getMessage() {
- return super.getMessage() + " for uri: " + notFoundUri;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/ParamException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/ParamException.java
deleted file mode 100644
index 944513ac10c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/ParamException.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api;
-
-import java.lang.annotation.Annotation;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.ext.ExceptionMapper;
-
-/**
- * An abstract extension of {@link WebApplicationException} for the class of
- * parameter-based exceptions.
- * <p>
- * Exceptions that are instances of this class will be thrown if the runtime
- * encounters an error obtaining a parameter value, from a request, for a
- * Java type that is annotated with a parameter-based annotation, such as
- * {@link QueryParam}. For more details see
- * <a href="https://jsr311.dev.java.net/nonav/releases/1.0/spec/index.html">section 3.2</a>
- * of the JAX-RS specfication.
- * <p>
- * An {@link ExceptionMapper} may be configured to map this class or a sub-class
- * of to customize responses for parameter-based errors.
- * <p>
- * Unless otherwise stated all such exceptions of this type will contain a
- * response with a 400 (Client error) status code.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class ParamException extends WebApplicationException {
-
- /**
- * An abstract parameter exception for the class of URI-parameter-based
- * exceptions.
- * <p>
- * All such exceptions of this type will contain a response with a 404
- * (Not Found) status code.
- */
- public static abstract class URIParamException extends ParamException {
- protected URIParamException(Throwable cause,
- Class<? extends Annotation> parameterType, String name, String defaultStringValue) {
- super(cause, Responses.NOT_FOUND, parameterType, name, defaultStringValue);
- }
- }
-
- /**
- * A URI-parameter-based exception for errors with {@link PathParam}.
- */
- public static class PathParamException extends URIParamException {
- public PathParamException(Throwable cause, String name, String defaultStringValue) {
- super(cause, PathParam.class, name, defaultStringValue);
- }
- }
-
- /**
- * A URI-parameter-based exception for errors with {@link MatrixParam}.
- */
- public static class MatrixParamException extends URIParamException {
- public MatrixParamException(Throwable cause, String name, String defaultStringValue) {
- super(cause, MatrixParam.class, name, defaultStringValue);
- }
- }
-
- /**
- * A URI-parameter-based exception for errors with {@link QueryParam}.
- */
- public static class QueryParamException extends URIParamException {
- public QueryParamException(Throwable cause, String name, String defaultStringValue) {
- super(cause, QueryParam.class, name, defaultStringValue);
- }
- }
-
- /**
- * A parameter exception for errors with {@link HeaderParam}.
- */
- public static class HeaderParamException extends ParamException {
- public HeaderParamException(Throwable cause, String name, String defaultStringValue) {
- super(cause, Responses.CLIENT_ERROR, HeaderParam.class, name, defaultStringValue);
- }
- }
-
- /**
- * A parameter exception for errors with {@link CookieParam}.
- */
- public static class CookieParamException extends ParamException {
- public CookieParamException(Throwable cause, String name, String defaultStringValue) {
- super(cause, Responses.CLIENT_ERROR, CookieParam.class, name, defaultStringValue);
- }
- }
-
- /**
- * A parameter exception for errors with {@link FormParam}.
- */
- public static class FormParamException extends ParamException {
- public FormParamException(Throwable cause, String name, String defaultStringValue) {
- super(cause, Responses.CLIENT_ERROR, FormParam.class, name, defaultStringValue);
- }
- }
-
- private final Class<? extends Annotation> parameterType;
-
- private final String name;
-
- private final String defaultStringValue;
-
- protected ParamException(Throwable cause, int status,
- Class<? extends Annotation> parameterType, String name, String defaultStringValue) {
- super(cause, status);
- this.parameterType = parameterType;
- this.name = name;
- this.defaultStringValue = defaultStringValue;
- }
-
- /**
- * Get the type of the parameter annotation.
- *
- * @return the type of the parameter annotation.
- */
- public Class<? extends Annotation> getParameterType() {
- return parameterType;
- }
-
- /**
- * Get the parameter name.
- *
- * @return the parameter name.
- */
- public String getParameterName() {
- return name;
- }
-
- /**
- * Get the default String value.
- *
- * @return the default String value.
- */
- public String getDefaultStringValue() {
- return defaultStringValue;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/Responses.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/Responses.java
deleted file mode 100644
index 473bdff6ab1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/Responses.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.Response.Status.Family;
-import javax.ws.rs.core.Response.StatusType;
-
-/**
- * Common status codes and responses.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class Responses {
- public static final int NO_CONTENT = 204;
-
- public static final int NOT_MODIFIED = 304;
-
- public static final int CLIENT_ERROR = 400;
-
- public static final int NOT_FOUND = 404;
-
- public static final int METHOD_NOT_ALLOWED = 405;
-
- public static final int NOT_ACCEPTABLE = 406;
-
- public static final int CONFLICT = 409;
-
- public static final int PRECONDITION_FAILED = 412;
-
- public static final int UNSUPPORTED_MEDIA_TYPE = 415;
-
- private static StatusType METHOD_NOT_ALLOWED_TYPE = new StatusType() {
- @Override
- public int getStatusCode() {
- return METHOD_NOT_ALLOWED;
- }
-
- @Override
- public Family getFamily() {
- return Family.CLIENT_ERROR;
- }
-
- @Override
- public String getReasonPhrase() {
- return "Method Not Allowed";
- }
- };
-
- public static ResponseBuilder noContent() {
- return status(Status.NO_CONTENT);
- }
-
- public static ResponseBuilder notModified() {
- return status(Status.NOT_MODIFIED);
- }
-
- public static ResponseBuilder clientError() {
- return status(Status.BAD_REQUEST);
- }
-
- public static ResponseBuilder notFound() {
- return status(Status.NOT_FOUND);
- }
-
- public static ResponseBuilder methodNotAllowed() {
- return status(METHOD_NOT_ALLOWED_TYPE);
- }
-
- public static ResponseBuilder notAcceptable() {
- return status(Status.NOT_ACCEPTABLE);
- }
-
- public static ResponseBuilder conflict() {
- return status(Status.CONFLICT);
- }
-
- public static ResponseBuilder preconditionFailed() {
- return status(Status.PRECONDITION_FAILED);
- }
-
- public static ResponseBuilder unsupportedMediaType() {
- return status(Status.UNSUPPORTED_MEDIA_TYPE);
- }
-
- private static ResponseBuilder status(StatusType status) {
- return Response.status(status);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AbstractClientRequestAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AbstractClientRequestAdapter.java
deleted file mode 100644
index 6f9922dd7d7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AbstractClientRequestAdapter.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-/**
- * Abstract implementation of ClientRequestAdapter that helps to adapt an
- * existing ClientRequestAdapter instance.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractClientRequestAdapter implements ClientRequestAdapter {
-
- private final ClientRequestAdapter cra;
-
- protected AbstractClientRequestAdapter(ClientRequestAdapter cra) {
- this.cra = cra;
- }
-
- /**
- * Get the adapted client request adapter.
- *
- * @return the adapted client request adapter.
- */
- public ClientRequestAdapter getAdapter() {
- return cra;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncUniformInterface.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncUniformInterface.java
deleted file mode 100644
index 34733e07e1e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncUniformInterface.java
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.async.ITypeListener;
-import java.util.concurrent.Future;
-
-/**
- * An asynchronous uniform interface for invoking HTTP requests.
- *
- * <p>
- * Any Java type for a response entity, that is supported by the client
- * configuration of the client, may be declared using
- * <code>Class&lt;T&gt;</code> where <code>T</code> is the Java type, or
- * using {@link GenericType} where the generic parameter is the Java type.
- * <p>
- * Any Java type instance for a request entity, that is supported by the client
- * configuration of the client, can be passed. If generic information is
- * required then an instance of {@link javax.ws.rs.core.GenericEntity} may
- * be used.
- * <p>
- * A type of {@link ClientResponse} declared for the response entity
- * may be used to obtain the status, headers and response entity. If any other
- * type is declared and the response status is greater than or equal to
- * 300 then a {@link UniformInterfaceException} exception will be thrown, from
- * which the {@link ClientResponse} instance can be accessed.
- *
- * @see com.sun.jersey.api.client
- * @author Paul.Sandoz@Sun.Com
- */
-public interface AsyncUniformInterface {
-
- /**
- * Invoke the HEAD method.
- *
- * @return the HTTP response.
- */
- Future<ClientResponse> head();
-
- /**
- * Invoke the HEAD method.
- *
- * @param l the listener to receive asynchronous callbacks.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- Future<ClientResponse> head(ITypeListener<ClientResponse> l);
-
-
- /**
- * Invoke the OPTIONS method.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> options(Class<T> c);
-
-
- /**
- * Invoke the OPTIONS method.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> options(GenericType<T> gt);
-
- /**
- * Invoke the OPTIONS method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> options(ITypeListener<T> l);
-
- /**
- * Invoke the GET method.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> get(Class<T> c) throws UniformInterfaceException;
-
- /**
- * Invoke the GET method.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> get(GenericType<T> gt) throws UniformInterfaceException;
-
- /**
- * Invoke the GET method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> get(ITypeListener<T> l);
-
- /**
- * Invoke the PUT method with no request entity or response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @return a void future.
- */
- Future<?> put();
-
- /**
- * Invoke the PUT method with a request entity but no response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @param requestEntity the request entity.
- * @return a void future.
- */
- Future<?> put(Object requestEntity);
-
- /**
- * Invoke the PUT method with no request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> put(Class<T> c);
-
- /**
- * Invoke the PUT method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> put(GenericType<T> gt);
-
- /**
- * Invoke the PUT method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> put(ITypeListener<T> l);
-
- /**
- * Invoke the PUT method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> put(Class<T> c, Object requestEntity);
-
- /**
- * Invoke the PUT method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> put(GenericType<T> gt, Object requestEntity);
-
- /**
- * Invoke the PUT method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @param requestEntity the request entity.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> put(ITypeListener<T> l, Object requestEntity);
-
- /**
- * Invoke the POST method with no request entity or response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @return a void future.
- */
- Future<?> post();
-
- /**
- * Invoke the POST method with a request entity but no response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @return a void future.
- * @param requestEntity the request entity.
- */
- Future<?> post(Object requestEntity);
-
- /**
- * Invoke the POST method with no request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> post(Class<T> c);
-
- /**
- * Invoke the POST method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> post(GenericType<T> gt);
-
- /**
- * Invoke the POST method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> post(ITypeListener<T> l);
-
- /**
- * Invoke the POST method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> post(Class<T> c, Object requestEntity);
-
- /**
- * Invoke the POST method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> post(GenericType<T> gt, Object requestEntity);
-
- /**
- * Invoke the POST method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @param requestEntity the request entity.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> post(ITypeListener<T> l, Object requestEntity);
-
-
- /**
- * Invoke the DELETE method with no request entity or response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @return a void future.
- */
- Future<?> delete();
-
- /**
- * Invoke the DELETE method with a request entity but no response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @return a void future.
- * @param requestEntity the request entity.
- */
- Future<?> delete(Object requestEntity);
-
- /**
- * Invoke the DELETE method with no request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> delete(Class<T> c);
-
- /**
- * Invoke the DELETE method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> delete(GenericType<T> gt);
-
- /**
- * Invoke the DELETE method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> delete(ITypeListener<T> l);
-
- /**
- * Invoke the DELETE method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> delete(Class<T> c, Object requestEntity);
-
- /**
- * Invoke the DELETE method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> delete(GenericType<T> gt, Object requestEntity);
-
- /**
- * Invoke the DELETE method.
- *
- * @param <T> the type of the response.
- * @param l the listener to receive asynchronous callbacks.
- * @param requestEntity the request entity.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> delete(ITypeListener<T> l, Object requestEntity);
-
-
- /**
- * Invoke a HTTP method with no request entity or response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @return a void future.
- * @param method the HTTP method.
- */
- Future<?> method(String method);
-
- /**
- * Invoke a HTTP method with a request entity but no response.
- * <p>
- * If the status of the HTTP response is less than 300 and a representation
- * is present then that representation is ignored.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300.
- *
- * @return a void future.
- * @param method the HTTP method.
- * @param requestEntity the request entity.
- */
- Future<?> method(String method, Object requestEntity);
-
- /**
- * Invoke a HTTP method with no request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> method(String method, Class<T> c);
-
- /**
- * Invoke a HTTP method with no request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> method(String method, GenericType<T> gt);
-
- /**
- * Invoke a HTTP method with no request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param l the listener to receive asynchronous callbacks.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> method(String method, ITypeListener<T> l);
-
- /**
- * Invoke a HTTP method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>c</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- */
- <T> Future<T> method(String method, Class<T> c, Object requestEntity);
-
- /**
- * Invoke a HTTP method with a request entity that returns a response.
- * <p>
- * The {@link Future#get} method will throw a UniformInterfaceException
- * if the status of the HTTP response is greater than or equal to 300 and
- * <code>gt</code> is not the type {@link ClientResponse}.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- */
- <T> Future<T> method(String method, GenericType<T> gt, Object requestEntity);
-
- /**
- * Invoke a HTTP method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param l the listener to receive asynchronous callbacks.
- * @param requestEntity the request entity.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- <T> Future<T> method(String method, ITypeListener<T> l, Object requestEntity);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewResource.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewResource.java
deleted file mode 100644
index 4431db4f8d9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewResource.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.async.AsyncClientHandler;
-import com.sun.jersey.api.client.async.FutureListener;
-import com.sun.jersey.api.client.filter.Filterable;
-import com.sun.jersey.client.impl.ClientRequestImpl;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.FutureTask;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-public class AsyncViewResource extends Filterable implements
- RequestBuilder<AsyncViewResource.Builder>,
- AsyncViewUniformInterface,
- AsyncClientHandler {
- private static final Logger LOGGER = Logger.getLogger(AsyncWebResource.class.getName());
-
- private final Client client;
-
- private final ExecutorService executorService;
-
- private final URI u;
-
- protected AsyncViewResource(Client c, URI u) {
- super((ClientHandler)c);
- this.client = c;
- this.executorService = c.getExecutorService();
- this.u = u;
- }
-
- protected AsyncViewResource(AsyncViewResource that, UriBuilder ub) {
- super(that);
- this.client = that.client;
- this.executorService = that.executorService;
- this.u = ub.build();
- }
-
- /**
- * Get the URI to the resource.
- *
- * @return the URI.
- */
- public URI getURI() {
- return u;
- }
-
- /**
- * Get the URI builder to the resource.
- *
- * @return the URI builder.
- */
- public UriBuilder getUriBuilder() {
- return UriBuilder.fromUri(u);
- }
-
- /**
- * Get the ClientRequest builder.
- *
- * @return the ClientRequest builder.
- */
- public Builder getRequestBuilder() {
- return new Builder();
- }
-
- /**
- * @return the URI as a String instance
- */
- @Override
- public String toString() {
- return u.toString();
- }
-
- /**
- * Returns a hash code for this <code>WebResource</code>.
- * <p>
- * The hash code is the hash code of URI of this
- * <code>WebResource</code>.
- *
- * @return a hash code for this <code>WebResource</code>.
- */
- @Override
- public int hashCode() {
- return u.hashCode();
- }
-
- /**
- * Compares this resource to the specified object.
- * <p>
- * The result is true if and only if the argument is not null and is a
- * <code>WebResource</code> object whose URI is equal to the URI of this
- * <code>WebResource</code>.
- *
- * @param obj the object to compare this <code>WebResource</code> against.
- * @return true if the <code>WebResource</code> are equal; false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
-
- if (obj instanceof AsyncViewResource) {
- final AsyncViewResource that = (AsyncViewResource) obj;
- return that.u.equals(this.u);
- }
- return false;
- }
-
- // ViewUniformInterface
-
- public <T> Future<T> head(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "HEAD"));
- }
-
- public <T> Future<T> head(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "HEAD"));
- }
-
-
- public <T> Future<T> options(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
- public <T> Future<T> options(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
-
- public <T> Future<T> get(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "GET"));
- }
-
- public <T> Future<T> get(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "GET"));
- }
-
-
- public <T> Future<T> put(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- public <T> Future<T> put(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- public <T> Future<T> put(Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- public <T> Future<T> put(T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
-
- public <T> Future<T> post(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "POST"));
- }
-
- public <T> Future<T> post(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "POST"));
- }
-
- public <T> Future<T> post(Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- public <T> Future<T> post(T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
-
- public <T> Future<T> delete(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public <T> Future<T> delete(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public <T> Future<T> delete(Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
-
- public <T> Future<T> method(String method, Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), method));
- }
-
- public <T> Future<T> method(String method, T t) {
- return handle(t, new ClientRequestImpl(getURI(), method));
- }
-
- public <T> Future<T> method(String method, Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- public <T> Future<T> method(String method, T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
-
- // RequestBuilder<WebResource.Builder>
-
- public Builder entity(Object entity) {
- return getRequestBuilder().entity(entity);
- }
-
- public Builder entity(Object entity, MediaType type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- public Builder entity(Object entity, String type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- public Builder type(MediaType type) {
- return getRequestBuilder().type(type);
- }
-
- public Builder type(String type) {
- return getRequestBuilder().type(type);
- }
-
- public Builder accept(MediaType... types) {
- return getRequestBuilder().accept(types);
- }
-
- public Builder accept(String... types) {
- return getRequestBuilder().accept(types);
- }
-
- public Builder acceptLanguage(Locale... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- public Builder acceptLanguage(String... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- public Builder cookie(Cookie cookie) {
- return getRequestBuilder().cookie(cookie);
- }
-
- public Builder header(String name, Object value) {
- return getRequestBuilder().header(name, value);
- }
-
- // URI specific building
-
- /**
- * Create a new WebResource from this web resource with an additional path
- * added to the URI of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param path the additional path.
- *
- * @return the new web resource.
- */
- public AsyncViewResource path(String path) {
- return new AsyncViewResource(this, getUriBuilder().path(path));
- }
-
- /**
- * Create a new WebResource from this web resource.
- * <p>
- * If the URI contains a path component and the path starts with a '/' then
- * the path of this web resource URI is replaced. Otherwise the path is
- * appended.
- * <p>
- * If the URI contains query parameters then those query parameters will
- * replace the query parameters (if any) of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param uri the URI.
- * @return the new web resource.
- */
- public AsyncViewResource uri(URI uri) {
- UriBuilder b = getUriBuilder();
- String path = uri.getRawPath();
- if (path != null && path.length() > 0) {
- if (path.startsWith("/")) {
- b.replacePath(path);
- } else {
- b.path(path);
- }
- }
- String query = uri.getRawQuery();
- if (query != null && query.length() > 0) {
- b.replaceQuery(query);
- }
- return new AsyncViewResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with an additional
- * query parameter added to the URI of this web resource.
- *
- * @param key the query parameter name
- * @param value the query parameter value
- * @return the new web resource.
- */
- public AsyncViewResource queryParam(String key, String value) {
- UriBuilder b = getUriBuilder();
- b.queryParam(key, value);
- return new AsyncViewResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with additional
- * query parameters added to the URI of this web resource.
- *
- * @param params the query parameters.
- * @return the new web resource.
- */
- public AsyncViewResource queryParams(MultivaluedMap<String, String> params) {
- UriBuilder b = getUriBuilder();
- for (Map.Entry<String, List<String>> e : params.entrySet()) {
- for (String value : e.getValue())
- b.queryParam(e.getKey(), value);
- }
- return new AsyncViewResource(this, b);
- }
-
- // Builder that builds client request and handles it
-
- /**
- * The builder for building a {@link ClientRequest} instance and
- * handling the request using the {@link UniformInterface}. The methods
- * of the {@link UniformInterface} are the build methods of the builder.
- */
- public final class Builder extends PartialRequestBuilder<Builder>
- implements AsyncViewUniformInterface {
-
-
- private Builder() {
- }
-
- private ClientRequest build(String method) {
- ClientRequest ro = new ClientRequestImpl(u, method, entity, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- private ClientRequest build(String method, Object e) {
- ClientRequest ro = new ClientRequestImpl(u, method, e, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- // ViewUniformInterface
-
- public <T> Future<T> head(Class<T> c) {
- return handle(c, build("HEAD"));
- }
-
- public <T> Future<T> head(T t) {
- return handle(t, build("HEAD"));
- }
-
-
- public <T> Future<T> options(Class<T> c) {
- return handle(c, build("OPTIONS"));
- }
-
- public <T> Future<T> options(T t) {
- return handle(t, build("OPTIONS"));
- }
-
-
- public <T> Future<T> get(Class<T> c) {
- return handle(c, build("GET"));
- }
-
- public <T> Future<T> get(T t) {
- return handle(t, build("GET"));
- }
-
-
- public <T> Future<T> put(Class<T> c) {
- return handle(c, build("PUT"));
- }
-
- public <T> Future<T> put(T t) {
- return handle(t, build("PUT"));
- }
-
- public <T> Future<T> put(Class<T> c, Object requestEntity) {
- return handle(c, build("PUT", requestEntity));
- }
-
- public <T> Future<T> put(T t, Object requestEntity) {
- return handle(t, build("PUT", requestEntity));
- }
-
-
- public <T> Future<T> post(Class<T> c) {
- return handle(c, build("POST"));
- }
-
- public <T> Future<T> post(T t) {
- return handle(t, build("POST"));
- }
-
- public <T> Future<T> post(Class<T> c, Object requestEntity) {
- return handle(c, build("POST", requestEntity));
- }
-
- public <T> Future<T> post(T t, Object requestEntity) {
- return handle(t, build("POST", requestEntity));
- }
-
-
- public <T> Future<T> delete(Class<T> c) {
- return handle(c, build("DELETE"));
- }
-
- public <T> Future<T> delete(T t) {
- return handle(t, build("DELETE"));
- }
-
- public <T> Future<T> delete(Class<T> c, Object requestEntity) {
- return handle(c, build("DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(T t, Object requestEntity) {
- return handle(t, build("DELETE", requestEntity));
- }
-
-
- public <T> Future<T> method(String method, Class<T> c) {
- return handle(c, build(method));
- }
-
- public <T> Future<T> method(String method, T t) {
- return handle(t, build(method));
- }
-
- public <T> Future<T> method(String method, Class<T> c, Object requestEntity) {
- return handle(c, build(method, requestEntity));
- }
-
- public <T> Future<T> method(String method, T t, Object requestEntity) {
- return handle(t, build(method, requestEntity));
- }
- }
-
-
- private <T> Future<T> handle(Class<T> c, ClientRequest ro) {
- return client.getViewProxy(c).asyncView(c, ro, this);
- }
-
- private <T> Future<T> handle(T t, ClientRequest ro) {
- return client.getViewProxy((Class<T>)t.getClass()).asyncView(t, ro, this);
- }
-
- // AsyncClientHandler
-
- public Future<ClientResponse> handle(final ClientRequest request, final FutureListener<ClientResponse> l) {
- Callable c = new Callable() {
- public Object call() throws Exception {
- return getHeadHandler().handle(request);
- }
- };
- FutureTask<ClientResponse> ft = new FutureTask<ClientResponse>(c) {
- @Override
- protected void done() {
- try {
- l.onComplete(this);
- } catch (Throwable t) {
- LOGGER.log(Level.SEVERE,
- "Throwable caught on call to ClientResponseListener.onComplete",
- t);
- }
- }
- };
-
- executorService.submit(ft);
- return ft;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewUniformInterface.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewUniformInterface.java
deleted file mode 100644
index 3a49c297ba1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncViewUniformInterface.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import java.util.concurrent.Future;
-
-public interface AsyncViewUniformInterface {
-
- <T> Future<T> head(Class<T> c);
-
- <T> Future<T> head(T c);
-
-
- <T> Future<T> options(Class<T> c);
-
- <T> Future<T> options(T c);
-
-
- <T> Future<T> get(Class<T> c);
-
- <T> Future<T> get(T c);
-
-
- <T> Future<T> put(Class<T> c);
-
- <T> Future<T> put(T c);
-
- <T> Future<T> put(Class<T> c, Object requestEntity);
-
- <T> Future<T> put(T c, Object requestEntity);
-
-
- <T> Future<T> post(Class<T> c);
-
- <T> Future<T> post(T c);
-
- <T> Future<T> post(Class<T> c, Object requestEntity);
-
- <T> Future<T> post(T c, Object requestEntity);
-
-
- <T> Future<T> delete(Class<T> c);
-
- <T> Future<T> delete(T c);
-
- <T> Future<T> delete(Class<T> c, Object requestEntity);
-
- <T> Future<T> delete(T c, Object requestEntity);
-
-
- <T> Future<T> method(String method, Class<T> c);
-
- <T> Future<T> method(String method, T c);
-
- <T> Future<T> method(String method, Class<T> c, Object requestEntity);
-
- <T> Future<T> method(String method, T c, Object requestEntity);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncWebResource.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncWebResource.java
deleted file mode 100644
index de8dec54c36..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/AsyncWebResource.java
+++ /dev/null
@@ -1,816 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.async.AsyncClientHandler;
-import com.sun.jersey.api.client.async.FutureListener;
-import com.sun.jersey.api.client.async.ITypeListener;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.filter.Filterable;
-import com.sun.jersey.client.impl.ClientRequestImpl;
-import com.sun.jersey.client.impl.CopyOnWriteHashMap;
-import com.sun.jersey.client.impl.async.FutureClientResponseListener;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.FutureTask;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An encapsulation of an asynchronous Web resource capable of building requests
- * to send to the Web resource and processing responses returned from the Web
- * resource.
- * <p>
- * An AsyncWebResource instance is obtained from the {@link Client}.
- * <p>
- * The Web resource implements the {@link AsyncUniformInterface} to invoke the HTTP
- * method on the Web resource. A client request may be built before invocation
- * on the uniform interface.
- * <p>
- * Methods to create a request and return a response are thread-safe. Methods
- * that modify filters are not guaranteed to be thread-safe.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.client
- */
-public class AsyncWebResource extends Filterable implements
- AsyncClientHandler,
- RequestBuilder<AsyncWebResource.Builder>,
- AsyncUniformInterface {
- private static final Logger LOGGER = Logger.getLogger(AsyncWebResource.class.getName());
-
- private final ExecutorService executorService;
-
- private final URI u;
-
- private CopyOnWriteHashMap<String, Object> properties;
-
- protected AsyncWebResource(Client c, CopyOnWriteHashMap<String, Object> properties, URI u) {
- super((ClientHandler)c);
- this.executorService = c.getExecutorService();
- this.u = u;
- this.properties = properties.clone();
- }
-
- protected AsyncWebResource(AsyncWebResource that, UriBuilder ub) {
- super(that);
- this.executorService = that.executorService;
- this.u = ub.build();
- }
-
- /**
- * Get the URI to the resource.
- *
- * @return the URI.
- */
- public URI getURI() {
- return u;
- }
-
- /**
- * Get the URI builder to the resource.
- *
- * @return the URI builder.
- * @deprecated
- */
- @Deprecated
- public UriBuilder getBuilder() {
- return UriBuilder.fromUri(u);
- }
-
- /**
- * Get the URI builder to the resource.
- *
- * @return the URI builder.
- */
- public UriBuilder getUriBuilder() {
- return UriBuilder.fromUri(u);
- }
-
- /**
- * Get the ClientRequest builder.
- *
- * @return the ClientRequest builder.
- */
- public Builder getRequestBuilder() {
- return new Builder();
- }
-
- /**
- * @return the URI as a String instance
- */
- @Override
- public String toString() {
- return u.toString();
- }
-
- /**
- * Returns a hash code for this <code>WebResource</code>.
- * <p>
- * The hash code is the hash code of URI of this
- * <code>WebResource</code>.
- *
- * @return a hash code for this <code>WebResource</code>.
- */
- @Override
- public int hashCode() {
- return u.hashCode();
- }
-
- /**
- * Compares this resource to the specified object.
- * <p>
- * The result is true if and only if the argument is not null and is a
- * <code>AsyncWebResource</code> object whose URI is equal to the URI of this
- * <code>AsyncWebResource</code>.
- *
- * @param obj the object to compare this <code>AsyncWebResource</code> against.
- * @return true if the <code>AsyncWebResource</code> are equal; false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
-
- if (obj instanceof AsyncWebResource) {
- final AsyncWebResource that = (AsyncWebResource)obj;
- return that.u.equals(this.u);
- }
- return false;
- }
-
- // AsyncUniformInterface
-
- public Future<ClientResponse> head() {
- return handle(ClientResponse.class, new ClientRequestImpl(getURI(), "HEAD"));
- }
-
- public Future<ClientResponse> head(ITypeListener<ClientResponse> l) {
- return handle(l, new ClientRequestImpl(getURI(), "HEAD"));
- }
-
- public <T> Future<T> options(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
- public <T> Future<T> options(GenericType<T> gt) {
- return handle(gt, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
- public <T> Future<T> options(ITypeListener<T> l) {
- return handle(l, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
- public <T> Future<T> get(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "GET"));
- }
-
- public <T> Future<T> get(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "GET"));
- }
-
- public <T> Future<T> get(ITypeListener<T> l) {
- return handle(l, new ClientRequestImpl(getURI(), "GET"));
- }
-
- public Future<?> put() throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), "PUT", null));
- }
-
- public Future<?> put(Object requestEntity) throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- public <T> Future<T> put(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- public <T> Future<T> put(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- public <T> Future<T> put(ITypeListener<T> l) {
- return handle(l, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- public <T> Future<T> put(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- public <T> Future<T> put(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- public <T> Future<T> put(ITypeListener<T> l, Object requestEntity) {
- return handle(l, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- public Future<?> post() throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), "POST"));
- }
-
- public Future<?> post(Object requestEntity) throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- public <T> Future<T> post(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "POST"));
- }
-
- public <T> Future<T> post(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "POST"));
- }
-
- public <T> Future<T> post(ITypeListener<T> l) {
- return handle(l, new ClientRequestImpl(getURI(), "POST"));
- }
-
- public <T> Future<T> post(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- public <T> Future<T> post(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- public <T> Future<T> post(ITypeListener<T> l, Object requestEntity) {
- return handle(l, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- public Future<?> delete() throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public Future<?> delete(Object requestEntity) throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public <T> Future<T> delete(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public <T> Future<T> delete(ITypeListener<T> l) {
- return handle(l, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public <T> Future<T> delete(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(ITypeListener<T> l, Object requestEntity) {
- return handle(l, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- public Future<?> method(String method) throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), method));
- }
-
- public Future<?> method(String method, Object requestEntity) throws UniformInterfaceException {
- return voidHandle(new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- public <T> Future<T> method(String method, Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), method));
- }
-
- public <T> Future<T> method(String method, GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), method));
- }
-
- public <T> Future<T> method(String method, ITypeListener<T> l) {
- return handle(l, new ClientRequestImpl(getURI(), method));
- }
-
- public <T> Future<T> method(String method, Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- public <T> Future<T> method(String method, GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- public <T> Future<T> method(String method, ITypeListener<T> l, Object requestEntity) {
- return handle(l, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
-
- // RequestBuilder<WebResource.Builder>
-
- public Builder entity(Object entity) {
- return getRequestBuilder().entity(entity);
- }
-
- public Builder entity(Object entity, MediaType type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- public Builder entity(Object entity, String type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- public Builder type(MediaType type) {
- return getRequestBuilder().type(type);
- }
-
- public Builder type(String type) {
- return getRequestBuilder().type(type);
- }
-
- public Builder accept(MediaType... types) {
- return getRequestBuilder().accept(types);
- }
-
- public Builder accept(String... types) {
- return getRequestBuilder().accept(types);
- }
-
- public Builder acceptLanguage(Locale... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- public Builder acceptLanguage(String... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- public Builder cookie(Cookie cookie) {
- return getRequestBuilder().cookie(cookie);
- }
-
- public Builder header(String name, Object value) {
- return getRequestBuilder().header(name, value);
- }
-
- // URI specific building
-
- /**
- * Create a new AsyncWebResource from this web resource with an additional path
- * added to the URI of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param path the additional path.
- *
- * @return the new web resource.
- */
- public AsyncWebResource path(String path) {
- return new AsyncWebResource(this, getUriBuilder().path(path));
- }
-
- /**
- * Create a new AsyncWebResource from this web resource.
- * <p>
- * If the URI contains a path component and the path starts with a '/' then
- * the path of this web resource URI is replaced. Otherwise the path is
- * appended.
- * <p>
- * If the URI contains query parameters then those query parameters will
- * replace the query parameters (if any) of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param uri the URI.
- * @return the new web resource.
- */
- public AsyncWebResource uri(URI uri) {
- UriBuilder b = getUriBuilder();
- String path = uri.getRawPath();
- if (path != null && path.length() > 0) {
- if (path.startsWith("/")) {
- b.replacePath(path);
- } else {
- b.path(path);
- }
- }
- String query = uri.getRawQuery();
- if (query != null && query.length() > 0) {
- b.replaceQuery(query);
- }
- return new AsyncWebResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with an additional
- * query parameter added to the URI of this web resource.
- *
- * @param key the query parameter name
- * @param value the query parameter value
- * @return the new web resource.
- */
- public AsyncWebResource queryParam(String key, String value) {
- UriBuilder b = getUriBuilder();
- b.queryParam(key, value);
- return new AsyncWebResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with additional
- * query parameters added to the URI of this web resource.
- *
- * @param params the query parameters.
- * @return the new web resource.
- */
- public AsyncWebResource queryParams(MultivaluedMap<String, String> params) {
- UriBuilder b = getUriBuilder();
- for (Map.Entry<String, List<String>> e : params.entrySet()) {
- for (String value : e.getValue())
- b.queryParam(e.getKey(), value);
- }
- return new AsyncWebResource(this, b);
- }
-
- // Builder that builds client request and handles it
-
- /**
- * The builder for building a {@link ClientRequest} instance and
- * handling the request using the {@link UniformInterface}. The methods
- * of the {@link UniformInterface} are the build methods of the builder.
- */
- public final class Builder extends PartialRequestBuilder<Builder>
- implements AsyncUniformInterface {
-
- private Builder() {
- }
-
- private ClientRequest build(String method) {
- ClientRequest ro = new ClientRequestImpl(u, method, entity, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- private ClientRequest build(String method, Object e) {
- ClientRequest ro = new ClientRequestImpl(u, method, e, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- // UniformInterface
-
- public Future<ClientResponse> head() {
- return handle(ClientResponse.class, build("HEAD"));
- }
-
- public Future<ClientResponse> head(ITypeListener<ClientResponse> l) {
- return handle(l, build("HEAD"));
- }
-
- public <T> Future<T> options(Class<T> c) {
- return handle(c, build("OPTIONS"));
- }
-
- public <T> Future<T> options(GenericType<T> gt) {
- return handle(gt, build("OPTIONS"));
- }
-
- public <T> Future<T> options(ITypeListener<T> l) {
- return handle(l, build("OPTIONS"));
- }
-
- public <T> Future<T> get(Class<T> c) {
- return handle(c, build("GET"));
- }
-
- public <T> Future<T> get(GenericType<T> gt) {
- return handle(gt, build("GET"));
- }
-
- public <T> Future<T> get(ITypeListener<T> l) {
- return handle(l, build("GET"));
- }
-
- public Future<?> put() throws UniformInterfaceException {
- return voidHandle(build("PUT"));
- }
-
- public Future<?> put(Object requestEntity) throws UniformInterfaceException {
- return voidHandle(build("PUT", requestEntity));
- }
-
- public <T> Future<T> put(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("PUT"));
- }
-
- public <T> Future<T> put(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("PUT"));
- }
-
- public <T> Future<T> put(ITypeListener<T> l) {
- return handle(l, build("PUT"));
- }
-
- public <T> Future<T> put(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build("PUT", requestEntity));
- }
-
- public <T> Future<T> put(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build("PUT", requestEntity));
- }
-
- public <T> Future<T> put(ITypeListener<T> l, Object requestEntity) {
- return handle(l, build("PUT", requestEntity));
- }
-
- public Future<?> post() throws UniformInterfaceException {
- return voidHandle(build("POST"));
- }
-
- public Future<?> post(Object requestEntity) throws UniformInterfaceException {
- return voidHandle(build("POST", requestEntity));
- }
-
- public <T> Future<T> post(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("POST"));
- }
-
- public <T> Future<T> post(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("POST"));
- }
-
- public <T> Future<T> post(ITypeListener<T> l) {
- return handle(l, build("POST"));
- }
-
- public <T> Future<T> post(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build("POST", requestEntity));
- }
-
- public <T> Future<T> post(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build("POST", requestEntity));
- }
-
- public <T> Future<T> post(ITypeListener<T> l, Object requestEntity) {
- return handle(l, build("POST", requestEntity));
- }
-
- public Future<?> delete() throws UniformInterfaceException {
- return voidHandle(build("DELETE"));
- }
-
- public Future<?> delete(Object requestEntity) throws UniformInterfaceException {
- return voidHandle(build("DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("DELETE"));
- }
-
- public <T> Future<T> delete(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("DELETE"));
- }
-
- public <T> Future<T> delete(ITypeListener<T> l) {
- return handle(l, build("DELETE"));
- }
-
- public <T> Future<T> delete(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build("DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build("DELETE", requestEntity));
- }
-
- public <T> Future<T> delete(ITypeListener<T> l, Object requestEntity) {
- return handle(l, build("DELETE", requestEntity));
- }
-
- public Future<?> method(String method) throws UniformInterfaceException {
- return voidHandle(build(method));
- }
-
- public Future<?> method(String method, Object requestEntity) throws UniformInterfaceException {
- return voidHandle(build(method, requestEntity));
- }
-
- public <T> Future<T> method(String method, Class<T> c) throws UniformInterfaceException {
- return handle(c, build(method));
- }
-
- public <T> Future<T> method(String method, GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build(method));
- }
-
- public <T> Future<T> method(String method, ITypeListener<T> l) {
- return handle(l, build(method));
- }
-
- public <T> Future<T> method(String method, Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build(method, requestEntity));
- }
-
- public <T> Future<T> method(String method, GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build(method, requestEntity));
- }
-
- public <T> Future<T> method(String method, ITypeListener<T> l, Object requestEntity) {
- return handle(l, build(method, requestEntity));
- }
- }
-
- /**
- * Sets WebResource related property.
- *
- * @param property property identifier.
- * @param value value of given property.
- */
- public void setProperty(String property, Object value) {
- this.getProperties().put(property, value);
- }
-
- /**
- * Gets WebResource related properties.
- *
- * <p>Properties are inherited, so setting propeties on "parent" WebResource
- * instance, creating child (for example via WebResource.path("subpath"))
- * will set parents properties on it. However changing child properties
- * won't cause change in parent's properties.
- *
- * <p>Methods entrySet(), keySet() and values() are returning read-only
- * results (via Collection.unmodifiableMap).
- *
- * @return map containg all properties.
- */
- public Map<String, Object> getProperties() {
- if (properties == null) {
- properties = new CopyOnWriteHashMap<String, Object>();
- }
- return properties;
- }
-
- private void setProperties(ClientRequest ro) {
- if (properties != null) {
- ro.setProperties(properties);
- }
- }
-
- private <T> Future<T> handle(final Class<T> c, final ClientRequest request) {
- setProperties(request);
- final FutureClientResponseListener<T> ftw = new FutureClientResponseListener<T>() {
- protected T get(ClientResponse response) {
- if (c == ClientResponse.class) return c.cast(response);
-
- if (response.getStatus() < 300) return response.getEntity(c);
-
- throw new UniformInterfaceException(response,
- request.getPropertyAsFeature(ClientConfig.PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true));
- }
- };
-
- ftw.setCancelableFuture(handle(request, ftw));
-
- return ftw;
- }
-
- private <T> Future<T> handle(final GenericType<T> gt, final ClientRequest request) {
- setProperties(request);
- final FutureClientResponseListener<T> ftw = new FutureClientResponseListener<T>() {
- protected T get(ClientResponse response) {
- if (gt.getRawClass() == ClientResponse.class) return gt.getRawClass().cast(response);
-
- if (response.getStatus() < 300) return response.getEntity(gt);
-
- throw new UniformInterfaceException(response,
- request.getPropertyAsFeature(ClientConfig.PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true));
- }
- };
-
- ftw.setCancelableFuture(handle(request, ftw));
-
- return ftw;
- }
-
- private <T> Future<T> handle(final ITypeListener<T> l, final ClientRequest request) {
- setProperties(request);
- final FutureClientResponseListener<T> ftw = new FutureClientResponseListener<T>() {
- @Override
- protected void done() {
- try {
- l.onComplete(this);
- } catch (Throwable t) {
- LOGGER.log(Level.SEVERE,
- "Throwable caught on call to ITypeListener.onComplete",
- t);
- }
- }
-
- protected T get(ClientResponse response) {
- if (l.getType() == ClientResponse.class) return (T)response;
-
- if (response.getStatus() < 300) {
- if (l.getGenericType() == null) {
- return response.getEntity(l.getType());
- } else {
- return response.getEntity(l.getGenericType());
- }
- }
- throw new UniformInterfaceException(response,
- request.getPropertyAsFeature(ClientConfig.PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true));
- }
- };
-
- ftw.setCancelableFuture(handle(request, ftw));
-
- return ftw;
- }
-
- private Future<?> voidHandle(final ClientRequest request) {
- setProperties(request);
- final FutureClientResponseListener<?> ftw = new FutureClientResponseListener() {
- protected Object get(ClientResponse response) {
- if (response.getStatus() >= 300)
- throw new UniformInterfaceException(response,
- request.getPropertyAsFeature(ClientConfig.PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true));
- response.close();
- return null;
- }
- };
-
- ftw.setCancelableFuture(handle(request, ftw));
-
- return ftw;
- }
-
- // AsyncClientHandler
-
- public Future<ClientResponse> handle(final ClientRequest request, final FutureListener<ClientResponse> l) {
- setProperties(request);
- Callable<ClientResponse> c = new Callable<ClientResponse>() {
- public ClientResponse call() throws Exception {
- return getHeadHandler().handle(request);
- }
- };
- FutureTask<ClientResponse> ft = new FutureTask<ClientResponse>(c) {
- @Override
- protected void done() {
- try {
- l.onComplete(this);
- } catch (Throwable t) {
- LOGGER.log(Level.SEVERE,
- "Throwable caught on call to ClientResponseListener.onComplete",
- t);
- }
- }
- };
-
- executorService.submit(ft);
- return ft;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/Client.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/Client.java
deleted file mode 100644
index 84ac333ad4f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/Client.java
+++ /dev/null
@@ -1,704 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.client.filter.ClientFilter;
-import com.sun.jersey.api.client.filter.Filterable;
-import com.sun.jersey.client.impl.CopyOnWriteHashMap;
-import com.sun.jersey.client.proxy.ViewProxy;
-import com.sun.jersey.client.proxy.ViewProxyProvider;
-import com.sun.jersey.client.urlconnection.URLConnectionClientHandler;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentInjector;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ProviderFactory;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactoryInitializer;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCProviderFactory;
-import com.sun.jersey.core.spi.factory.ContextResolverFactory;
-import com.sun.jersey.core.spi.factory.InjectableProviderFactory;
-import com.sun.jersey.core.spi.factory.MessageBodyFactory;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import com.sun.jersey.core.util.LazyVal;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import com.sun.jersey.spi.inject.ClientSide;
-import com.sun.jersey.spi.inject.Errors;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
-import com.sun.jersey.spi.service.ServiceFinder;
-
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Providers;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * The main class for creating {@link WebResource} instances and configuring
- * the properties of connections and requests.
- * <p>
- * {@link ClientFilter} instances may be added to the client for filtering
- * requests and responses, including those of {@link WebResource} instances
- * created from the client.
- * <p>
- * A client may be configured by passing a {@link ClientConfig} instance to
- * the appropriate constructor.
- * <p>
- * Methods to create instances of {@link WebResource} are thread-safe. Methods
- * that modify configuration and or filters are not guaranteed to be
- * thread-safe.
- * <p>
- * The creation of a <code>Client</code> instance is an expensive operation and
- * the instance may make use of and retain many resources. It is therefore
- * recommended that a <code>Client</code> instance is reused for the creation of
- * {@link WebResource} instances that require the same configuration settings.
- * <p>
- * A client may integrate with an IoC framework by passing a
- * {@link IoCComponentProviderFactory} instance to the appropriate constructor.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class Client extends Filterable implements ClientHandler {
-
- private static final Logger LOGGER = Logger.getLogger(Client.class.getName());
-
- private ProviderFactory componentProviderFactory;
-
- private Providers providers;
-
- private boolean destroyed = false;
-
- private LazyVal<ExecutorService> executorService;
-
- private CopyOnWriteHashMap<String, Object> properties;
-
- private Set<ViewProxyProvider> vpps;
-
- private MessageBodyFactory workers;
-
- private static class ContextInjectableProvider<T> extends
- SingletonTypeInjectableProvider<Context, T> {
-
- ContextInjectableProvider(Type type, T instance) {
- super(type, instance);
- }
- }
-
- /**
- * Create a new client instance.
- *
- */
- public Client() {
- this(createDefaultClientHander(), new DefaultClientConfig(), null);
- }
-
- /**
- * Create a new client instance.
- *
- * @param root the root client handler for dispatching a request and
- * returning a response.
- */
- public Client(ClientHandler root) {
- this(root, new DefaultClientConfig(), null);
- }
-
- /**
- * Create a new client instance with a client configuration.
- *
- * @param root the root client handler for dispatching a request and
- * returning a response.
- * @param config the client configuration.
- */
- public Client(ClientHandler root, ClientConfig config) {
- this(root, config, null);
- }
-
- /**
- * Create a new instance with a client configuration and a
- * component provider.
- *
- * @param root the root client handler for dispatching a request and
- * returning a response.
- * @param config the client configuration.
- * @param provider the IoC component provider factory.
- */
- public Client(final ClientHandler root, final ClientConfig config,
- final IoCComponentProviderFactory provider) {
- // Defer instantiation of root to component provider
- super(root);
-
- Errors.processWithErrors(new Errors.Closure<Void>() {
- @Override
- public Void f() {
- Errors.setReportMissingDependentFieldOrMethod(false);
- init(root, config, provider);
- return null;
- }
- });
- }
-
- private void init(ClientHandler root, ClientConfig config,
- IoCComponentProviderFactory provider) {
-
- final Object threadpoolSize = config.getProperties().get(ClientConfig.PROPERTY_THREADPOOL_SIZE);
-
- this.executorService = new LazyVal<ExecutorService>() {
- @Override
- protected ExecutorService instance() {
- if(threadpoolSize != null && threadpoolSize instanceof Integer && (Integer)threadpoolSize > 0) {
- return Executors.newFixedThreadPool((Integer) threadpoolSize);
- } else {
- return Executors.newCachedThreadPool();
- }
- }
- };
-
- Class<?>[] components = ServiceFinder.find("jersey-client-components").toClassArray();
- if (components.length > 0) {
- if (LOGGER.isLoggable(Level.INFO)) {
- StringBuilder b = new StringBuilder();
- b.append("Adding the following classes declared in META-INF/services/jersey-client-components to the client configuration:");
- for (Class c : components)
- b.append('\n').append(" ").append(c);
- LOGGER.log(Level.INFO, b.toString());
- }
-
- config = new ComponentsClientConfig(config, components);
- }
-
- final InjectableProviderFactory injectableFactory = new InjectableProviderFactory();
-
- getProperties().putAll(config.getProperties());
-
- if (provider != null) {
- if (provider instanceof IoCComponentProcessorFactoryInitializer) {
- IoCComponentProcessorFactoryInitializer i = (IoCComponentProcessorFactoryInitializer)provider;
- i.init(new ComponentProcessorFactoryImpl(injectableFactory));
- }
- }
-
- // Set up the component provider factory
- this.componentProviderFactory = (provider == null)
- ? new ProviderFactory(injectableFactory)
- : new IoCProviderFactory(injectableFactory, provider);
-
- ProviderServices providerServices = new ProviderServices(
- ClientSide.class,
- this.componentProviderFactory,
- config.getClasses(),
- config.getSingletons());
-
- // Get the set of WebResourceProxy
- vpps = providerServices.getServices(ViewProxyProvider.class);
-
- // Allow injection of features and properties
- injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(
- FeaturesAndProperties.class, config));
-
- // Allow injection of client config
- injectableFactory.add(new ContextInjectableProvider<ClientConfig>(
- ClientConfig.class, config));
-
- // Allow injection of client
- injectableFactory.add(new ContextInjectableProvider<Client>(
- Client.class, this));
-
- injectableFactory.configure(providerServices);
-
- // Obtain all context resolvers
- final ContextResolverFactory crf = new ContextResolverFactory();
-
- // Obtain all message body readers/writers
- final MessageBodyFactory bodyContext = new MessageBodyFactory(providerServices,
- config.getFeature(FeaturesAndProperties.FEATURE_PRE_1_4_PROVIDER_PRECEDENCE));
- workers = bodyContext;
- // Allow injection of message body context
- injectableFactory.add(new ContextInjectableProvider<MessageBodyWorkers>(
- MessageBodyWorkers.class, bodyContext));
-
- // Injection of Providers
- this.providers = new Providers() {
- @Override
- public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> c, Type t,
- Annotation[] as, MediaType m) {
- return bodyContext.getMessageBodyReader(c, t, as, m);
- }
-
- @Override
- public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> c, Type t,
- Annotation[] as, MediaType m) {
- return bodyContext.getMessageBodyWriter(c, t, as, m);
- }
-
- @Override
- public <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> c) {
- throw new IllegalArgumentException("This method is not supported on the client side");
- }
-
- @Override
- public <T> ContextResolver<T> getContextResolver(Class<T> ct, MediaType m) {
- return crf.resolve(ct, m);
- }
- };
- injectableFactory.add(
- new ContextInjectableProvider<Providers>(
- Providers.class, this.providers));
-
- injectableFactory.add(new InjectableProvider<Context, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<Injectable> getInjectable(ComponentContext ic, Context a, Type c) {
- if (c instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)c;
- if (pt.getRawType() == Injectable.class) {
- if (pt.getActualTypeArguments().length == 1) {
- final Injectable<?> i = injectableFactory.getInjectable(
- a.annotationType(),
- ic,
- a,
- pt.getActualTypeArguments()[0],
- ComponentScope.PERREQUEST_UNDEFINED_SINGLETON);
- if (i == null)
- return null;
- return new Injectable<Injectable>() {
- @Override
- public Injectable getValue() {
- return i;
- }
- };
- }
- }
- }
-
- return null;
- }
- });
-
- // Initiate context resolvers
- crf.init(providerServices, injectableFactory);
-
- // Initiate message body readers/writers
- bodyContext.init();
-
-
- // Inject on all components
- Errors.setReportMissingDependentFieldOrMethod(true);
- componentProviderFactory.injectOnAllComponents();
- componentProviderFactory.injectOnProviderInstances(config.getSingletons());
- componentProviderFactory.injectOnProviderInstance(root);
- }
-
- private class ComponentProcessorFactoryImpl implements IoCComponentProcessorFactory {
- private final InjectableProviderFactory injectableFactory;
-
- ComponentProcessorFactoryImpl(InjectableProviderFactory injectableFactory) {
- this.injectableFactory = injectableFactory;
- }
-
- @Override
- public ComponentScope getScope(Class c) {
- return ComponentScope.Singleton;
- }
-
- @Override
- public IoCComponentProcessor get(Class c, ComponentScope scope) {
- final ComponentInjector ci = new ComponentInjector(injectableFactory, c);
- return new IoCComponentProcessor() {
-
- @Override
- public void preConstruct() {
- }
-
- @Override
- public void postConstruct(Object o) {
- ci.inject(o);
- }
- };
- }
- }
-
- /**
- * Destroy the client. Any system resources associated with the client
- * will be cleaned up.
- * <p>
- * This method must be called when there are not responses pending otherwise
- * undefined behavior will occur.
- * <p>
- * The client must not be reused after this method is called otherwise
- * undefined behavior will occur.
- */
- public void destroy() {
- if (!destroyed) {
- componentProviderFactory.destroy();
- destroyed = true;
- }
- }
-
- /**
- * Defer to {@link #destroy() }
- */
- @Override
- @SuppressWarnings("FinalizeDeclaration")
- protected void finalize() throws Throwable {
- destroy();
- super.finalize();
- }
-
- /**
- * Get the {@link Providers} utilized by the client.
- *
- * @return the {@link Providers} utilized by the client.
- */
- public Providers getProviders() {
- return providers;
- }
-
- /**
- * Get the {@link MessageBodyWorkers} utilized by the client.
- *
- * @return the {@link MessageBodyWorkers} utilized by the client.
- */
- public MessageBodyWorkers getMessageBodyWorkers() {
- return workers;
- }
-
- /**
- * Create a Web resource from the client.
- *
- * @param u the URI of the resource.
- * @return the Web resource.
- */
- public WebResource resource(String u) {
- return resource(URI.create(u));
- }
-
- /**
- * Create a Web resource from the client.
- *
- * @param u the URI of the resource.
- * @return the Web resource.
- */
- public WebResource resource(URI u) {
- return new WebResource(this, this.properties, u);
- }
-
- /**
- * Create an asynchronous Web resource from the client.
- *
- * @param u the URI of the resource.
- * @return the Web resource.
- */
- public AsyncWebResource asyncResource(String u) {
- return asyncResource(URI.create(u));
- }
-
- /**
- * Create an asynchronous Web resource from the client.
- *
- * @param u the URI of the resource.
- * @return the Web resource.
- */
- public AsyncWebResource asyncResource(URI u) {
- return new AsyncWebResource(this, this.properties, u);
- }
-
- public ViewResource viewResource(String u) {
- return viewResource(URI.create(u));
- }
-
- public ViewResource viewResource(URI u) {
- return new ViewResource(this, u);
- }
-
- public AsyncViewResource asyncViewResource(String u) {
- return asyncViewResource(URI.create(u));
- }
-
- public AsyncViewResource asyncViewResource(URI u) {
- return new AsyncViewResource(this, u);
- }
-
- public <T> T view(String u, Class<T> type) {
- ViewResource vr = viewResource(u);
- return vr.get(type);
- }
-
- public <T> T view(URI uri, Class<T> type) {
- ViewResource vr = viewResource(uri);
- return vr.get(type);
- }
-
- public <T> T view(String u, T t) {
- ViewResource vr = viewResource(u);
- return vr.get(t);
- }
-
- public <T> T view(URI uri, T t) {
- ViewResource vr = viewResource(uri);
- return vr.get(t);
- }
-
- public <T> Future<T> asyncView(String u, Class<T> type) {
- AsyncViewResource vr = asyncViewResource(u);
- return vr.get(type);
- }
-
- public <T> Future<T> asyncView(URI uri, Class<T> type) {
- AsyncViewResource vr = asyncViewResource(uri);
- return vr.get(type);
- }
-
- public <T> Future<T> asyncView(String u, T t) {
- AsyncViewResource vr = asyncViewResource(u);
- return vr.get(t);
- }
-
- public <T> Future<T> asyncView(URI uri, T t) {
- AsyncViewResource vr = asyncViewResource(uri);
- return vr.get(t);
- }
-
- public <T> T view(Class<T> c, ClientResponse response) {
- return getViewProxy(c).view(c, response);
- }
-
- public <T> T view(T t, ClientResponse response) {
- return getViewProxy((Class<T>)t.getClass()).view(t, response);
- }
-
- public <T> ViewProxy<T> getViewProxy(Class<T> c) {
- for (ViewProxyProvider vpp : vpps) {
- ViewProxy<T> vp = vpp.proxy(this, c);
- if (vp != null) {
- return vp;
- }
- }
- throw new IllegalArgumentException("A view proxy is not " +
- "available for the class '" + c.getName() + "'");
- }
-
- /**
- * Set the {@link ExecutorService} for sending asynchronous
- * HTTP requests when no underlying asynchronous HTTP implementation is
- * utilized.
- *
- * @param es the {@link ExecutorService}.
- * @since 1.4
- */
- public void setExecutorService(ExecutorService es) {
- if (es == null)
- throw new IllegalArgumentException("ExecutorService service MUST not be null");
-
- this.executorService.set(es);
- }
-
- /**
- * Get the {@link ExecutorService} for sending asynchronous
- * HTTP requests when no underlying asynchronous HTTP implementation is
- * utilized.
- * <p>
- * By default the implementation returned
- * from {@link Executors#newCachedThreadPool() } is utilized.
- *
- * @return the {@link ExecutorService}.
- * @since 1.4
- */
- public ExecutorService getExecutorService() {
- return executorService.get();
- }
-
- /**
- * Get the mutable property bag.
- *
- * @return the property bag.
- */
- public Map<String, Object> getProperties() {
- if (properties == null)
- properties = new CopyOnWriteHashMap<String, Object>();
-
- return properties;
- }
-
- /**
- * Set if redirection should be performed or not.
- *
- * This method is the functional equivalent to setting the property
- * {@link ClientConfig#PROPERTY_FOLLOW_REDIRECTS} on the property bag
- * returned from {@link #getProperties}
- *
- * @param redirect if true then the client will automatically redirect
- * to the URI declared in 3xx responses.
- */
- public void setFollowRedirects(Boolean redirect) {
- getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, redirect);
- }
-
- /**
- * Set the read timeout interval, in milliseconds.
- *
- * This method is the functional equivalent to setting the property
- * {@link ClientConfig#PROPERTY_READ_TIMEOUT} on the property bag
- * returned from {@link #getProperties}
- *
- * @param interval the read timeout interval. If null or 0 then
- * an interval of infinity is declared.
- */
- public void setReadTimeout(Integer interval) {
- getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, interval);
- }
-
- /**
- * Set the connect timeout interval, in milliseconds.
- *
- * This method is the functional equivalent to setting the property
- * {@link ClientConfig#PROPERTY_CONNECT_TIMEOUT} on the property bag
- * returned from {@link #getProperties}
- *
- * @param interval the connect timeout interval. If null or 0 then
- * an interval of infinity is declared.
- */
- public void setConnectTimeout(Integer interval) {
- getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, interval);
- }
-
- /**
- * Set the client to send request entities using chunked encoding
- * with a particular chunk size.
- *
- * This method is the functional equivalent to setting the property
- * {@link ClientConfig#PROPERTY_CHUNKED_ENCODING_SIZE} on the property bag
- * returned from {@link #getProperties}
- *
- * @param chunkSize the chunked encoding size. If &lt= 0 then the default
- * size will be used. If null then chunked encoding will not be
- * utilized.
- */
- public void setChunkedEncodingSize(Integer chunkSize) {
- getProperties().put(ClientConfig.PROPERTY_CHUNKED_ENCODING_SIZE, chunkSize);
- }
-
- // ClientHandler
-
- @Override
- public ClientResponse handle(final ClientRequest request) throws ClientHandlerException {
- request.getProperties().putAll(properties);
- request.getProperties().put(Client.class.getName(), this);
-
- final ClientResponse response = getHeadHandler().handle(request);
-
- response.getProperties().put(Client.class.getName(), this);
- return response;
- }
-
- /**
- * Inject client-side bindings on an instance.
- *
- * @param o the instance to inject on.
- */
- public void inject(Object o) {
- componentProviderFactory.injectOnProviderInstance(o);
- }
-
- /**
- * Create a default client.
- *
- * @return a default client.
- */
- public static Client create() {
- return new Client(createDefaultClientHander());
- }
-
- /**
- * Create a default client with client configuration.
- *
- * @param cc the client configuration.
- * @return a default client.
- */
- public static Client create(ClientConfig cc) {
- return new Client(createDefaultClientHander(), cc);
- }
-
- /**
- * Create a default client with client configuration and component provider.
- *
- * @param cc the client configuration.
- * @param provider the IoC component provider factory.
- * @return a default client.
- */
- public static Client create(ClientConfig cc, IoCComponentProviderFactory provider) {
- return new Client(createDefaultClientHander(), cc, provider);
- }
-
- /**
- * Create a default client handler.
- * <p>
- * This implementation returns a client handler implementation that
- * utilizes {@link HttpURLConnection}.
- *
- * @return a default client handler.
- */
- private static ClientHandler createDefaultClientHander() {
- return new URLConnectionClientHandler();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandler.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandler.java
deleted file mode 100644
index 77cd7cbb23c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandler.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-/**
- * A client handler that handles a HTTP request and returns the HTTP response.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ClientHandler {
- /**
- * Handle a HTTP request as a {@link ClientRequest} and return the HTTP
- * response as a {@link ClientResponse}.
- *
- * @param cr the HTTP request.
- * @return the HTTP response.
- * @throws com.sun.jersey.api.client.ClientHandlerException if the client
- * handler fails to process the request or response.
- */
- ClientResponse handle(ClientRequest cr) throws ClientHandlerException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandlerException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandlerException.java
deleted file mode 100644
index 6be3ecb3b77..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientHandlerException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-/**
- * A runtime exception thrown by a client handler that signals a
- * failure to process the HTTP request or HTTP response.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ClientHandlerException extends RuntimeException {
- public ClientHandlerException() {
- super();
- }
-
- public ClientHandlerException(String message) {
- super(message);
- }
-
- public ClientHandlerException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ClientHandlerException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequest.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequest.java
deleted file mode 100644
index ec9a8e91d4a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequest.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.client.impl.ClientRequestImpl;
-
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.RuntimeDelegate;
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-import java.net.URI;
-import java.util.Map;
-
-/**
- * A client (out-bound) HTTP request.
- * <p>
- * Instances may be created by using the static method {@link #create} and
- * methods on {@link ClientRequest.Builder}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class ClientRequest {
-
- /**
- * Get the mutable property bag.
- *
- * @return the property bag.
- */
- public abstract Map<String, Object> getProperties();
-
- /**
- * Sets properties (replaces everything previously set).
- */
- public abstract void setProperties(Map<String, Object> properties);
-
- /**
- * Get a feature that is boolean property of the property bag.
- *
- * @param name the name of the feature;
- * @return true if the feature value is present and is an instance of
- * <code>Boolean</code> and that value is true, otherwise false.
- */
- public boolean getPropertyAsFeature(String name) {
- return getPropertyAsFeature(name, false);
- }
-
- /**
- * Get a feature that is boolean property of the property bag.
- *
- * @param name the name of the feature;
- * @param defaultValue the default boolean value if the property is absent.
- * @return true if the feature value is present and is an instance of
- * <code>Boolean</code> and that value is true, otherwise the
- * <code>defaultValue</code>.
- */
- public boolean getPropertyAsFeature(String name, boolean defaultValue) {
- Boolean v = (Boolean)getProperties().get(name);
- return (v != null) ? v : defaultValue;
- }
-
- /**
- * Get the URI of the request. The URI shall contain sufficient
- * components to correctly dispatch a request
- *
- * @return the URI of the request.
- */
- public abstract URI getURI();
-
- /**
- * Set the URI of the request. The URI shall contain sufficient
- * components to correctly dispatch a request
- *
- * @param uri the URI of the request.
- */
- public abstract void setURI(URI uri);
-
- /**
- * Get the HTTP method of the request.
- *
- * @return the HTTP method.
- */
- public abstract String getMethod();
-
- /**
- * Set the HTTP method of the request.
- *
- * @param method the HTTP method.
- */
- public abstract void setMethod(String method);
-
- /**
- * Get the entity of the request.
- *
- * @return the entity of the request.
- */
- public abstract Object getEntity();
-
- /**
- * Set the entity of the request.
- * <p>
- * Any Java type instance for a request entity, that is supported by the client
- * configuration of the client, can be passed. If generic information is
- * required then an instance of {@link javax.ws.rs.core.GenericEntity} may
- * be used.
- *
- * @param entity the entity of the request.
- */
- public abstract void setEntity(Object entity);
-
- /**
- * Get the HTTP headers of the request.
- *
- * @return the HTTP headers of the request.
- */
- @Deprecated
- public abstract MultivaluedMap<String, Object> getMetadata();
-
- /**
- * Get the HTTP headers of the request.
- *
- * @return the HTTP headers of the request.
- */
- public abstract MultivaluedMap<String, Object> getHeaders();
-
- /**
- * Get the client request adapter.
- *
- * @return the client request adapter.
- */
- public abstract ClientRequestAdapter getAdapter();
-
- /**
- * Set the client request adapter.
- * <p>
- * If an existing adapter is set then usually this adapter wrapped in the
- * new adapter to be set such that the current adaption behaviour is
- * retained and augmented with the new adpation behaviour.
- *
- * @param adapter the client request adapter.
- */
- public abstract void setAdapter(ClientRequestAdapter adapter);
-
- /**
- * Clone the request.
- *
- * @return the cloned request.
- */
- @Override
- public abstract ClientRequest clone();
-
- /**
- * Create a builder for building a new {@link ClientRequest} instance.
- *
- * @return the builder.
- */
- public static final ClientRequest.Builder create() {
- return new Builder();
- }
-
- /**
- * The builder for building a {@link ClientRequest} instance.
- */
- public static final class Builder extends PartialRequestBuilder<Builder> {
- /**
- * Build the {@link ClientRequest} instance.
- *
- * @param uri the URI of the request.
- * @param method the HTTP method.
- * @return the client request.
- */
- public ClientRequest build(URI uri, String method) {
- ClientRequest ro = new ClientRequestImpl(uri, method, entity, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
- }
-
- private static final RuntimeDelegate rd = RuntimeDelegate.getInstance();
-
- /**
- * Convert a header value, represented as a general object, to the
- * string value.
- * <p>
- * This method defers to {@link RuntimeDelegate#createHeaderDelegate} to
- * obtain a {@link HeaderDelegate} to convert the value to a string. If
- * a {@link HeaderDelegate} is not found then the <code>toString</code>
- * is utilized.
- *
- * @param headerValue the header value as an object
- * @return the string value
- */
- public static String getHeaderValue(Object headerValue) {
- HeaderDelegate hp = rd.createHeaderDelegate(headerValue.getClass());
-
- return (hp != null) ? hp.toString(headerValue) : headerValue.toString();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequestAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequestAdapter.java
deleted file mode 100644
index 3dddfcf3824..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientRequestAdapter.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * Adapter for the client request to adapt the output stream to write the
- * entity. This can enable logging or compression of the request entity.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ClientRequestAdapter {
-
- /**
- * Adapt the output stream of the client request.
- *
- * @param request the client request
- * @param out the output stream to write the request entity.
- * @return the adapted output stream to write the request entity.
- * @throws java.io.IOException
- */
- OutputStream adapt(ClientRequest request, OutputStream out) throws IOException;
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientResponse.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientResponse.java
deleted file mode 100644
index 4167c363d51..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ClientResponse.java
+++ /dev/null
@@ -1,739 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.core.header.InBoundHeaders;
-import com.sun.jersey.core.provider.CompletableReader;
-import com.sun.jersey.core.util.ReaderWriter;
-import com.sun.jersey.spi.MessageBodyWorkers;
-
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.NewCookie;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status.Family;
-import javax.ws.rs.core.Response.StatusType;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.RuntimeDelegate;
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Logger;
-
-/**
- * A client (in-bound) HTTP response.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ClientResponse {
- private static final Logger LOGGER = Logger.getLogger(ClientResponse.class.getName());
-
- /**
- * Status codes defined by HTTP, see
- * {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10">HTTP/1.1 documentation</a>}.
- * Additional status codes can be added by applications by creating an implementation of {@link StatusType}.
- */
- public enum Status implements StatusType {
- /**
- * 200 OK, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1 documentation</a>}.
- */
- OK(200, "OK"),
- /**
- * 201 Created, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1 documentation</a>}.
- */
- CREATED(201, "Created"),
- /**
- * 202 Accepted, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1 documentation</a>}.
- */
- ACCEPTED(202, "Accepted"),
- /**
- * 202 Accepted, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.4">HTTP/1.1 documentation</a>}.
- */
- NON_AUTHORITIVE_INFORMATION(203, "Non-Authoritative Information"),
- /**
- * 204 No Content, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1 documentation</a>}.
- */
- NO_CONTENT(204, "No Content"),
- /**
- * 205 Reset Content, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.6">HTTP/1.1 documentation</a>}.
- */
- RESET_CONTENT(205, "Reset Content"),
- /**
- * 206 Reset Content, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.7">HTTP/1.1 documentation</a>}.
- */
- PARTIAL_CONTENT(206, "Partial Content"),
-
-
- /**
- * 301 Moved Permantely, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1 documentation</a>}.
- */
- MOVED_PERMANENTLY(301, "Moved Permanently"),
- /**
- * 302 Found, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3">HTTP/1.1 documentation</a>}.
- */
- FOUND(302, "Found"),
- /**
- * 303 See Other, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1 documentation</a>}.
- */
- SEE_OTHER(303, "See Other"),
- /**
- * 304 Not Modified, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1 documentation</a>}.
- */
- NOT_MODIFIED(304, "Not Modified"),
- /**
- * 305 Use Proxy, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.6">HTTP/1.1 documentation</a>}.
- */
- USE_PROXY(305, "Use Proxy"),
- /**
- * 307 Temporary Redirect, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1 documentation</a>}.
- */
- TEMPORARY_REDIRECT(307, "Temporary Redirect"),
-
-
- /**
- * 400 Bad Request, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1 documentation</a>}.
- */
- BAD_REQUEST(400, "Bad Request"),
- /**
- * 401 Unauthorized, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1 documentation</a>}.
- */
- UNAUTHORIZED(401, "Unauthorized"),
- /**
- * 402 Payment Required, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3">HTTP/1.1 documentation</a>}.
- */
- PAYMENT_REQUIRED(402, "Payment Required"),
- /**
- * 403 Forbidden, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1 documentation</a>}.
- */
- FORBIDDEN(403, "Forbidden"),
- /**
- * 404 Not Found, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1 documentation</a>}.
- */
- NOT_FOUND(404, "Not Found"),
- /**
- * 405 Method Not Allowed, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6">HTTP/1.1 documentation</a>}.
- */
- METHOD_NOT_ALLOWED(405, "Method Not Allowed"),
- /**
- * 406 Not Acceptable, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1 documentation</a>}.
- */
- NOT_ACCEPTABLE(406, "Not Acceptable"),
- /**
- * 407 Proxy Authentication Required, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8">HTTP/1.1 documentation</a>}.
- */
- PROXY_AUTHENTICATION_REQUIRED(407, "Proxy Authentication Required"),
- /**
- * 408 Request Timeout, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.9">HTTP/1.1 documentation</a>}.
- */
- REQUEST_TIMEOUT(408, "Request Timeout"),
- /**
- * 409 Conflict, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1 documentation</a>}.
- */
- CONFLICT(409, "Conflict"),
- /**
- * 410 Gone, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1 documentation</a>}.
- */
- GONE(410, "Gone"),
- /**
- * 411 Length Required, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.12">HTTP/1.1 documentation</a>}.
- */
- LENGTH_REQUIRED(411, "Length Required"),
- /**
- * 412 Precondition Failed, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1 documentation</a>}.
- */
- PRECONDITION_FAILED(412, "Precondition Failed"),
- /**
- * 413 Request Entity Too Large, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14">HTTP/1.1 documentation</a>}.
- */
- REQUEST_ENTITY_TOO_LARGE(413, "Request Entity Too Large"),
- /**
- * 414 Request-URI Too Long, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.15">HTTP/1.1 documentation</a>}.
- */
- REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"),
- /**
- * 415 Unsupported Media Type, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1 documentation</a>}.
- */
- UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"),
- /**
- * 416 Requested Range Not Satisfiable, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.17">HTTP/1.1 documentation</a>}.
- */
- REQUESTED_RANGE_NOT_SATIFIABLE(416, "Requested Range Not Satisfiable"),
- /**
- * 417 Expectation Failed, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.18">HTTP/1.1 documentation</a>}.
- */
- EXPECTATION_FAILED(417, "Expectation Failed"),
-
-
- /**
- * 500 Internal Server Error, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1 documentation</a>}.
- */
- INTERNAL_SERVER_ERROR(500, "Internal Server Error"),
- /**
- * 501 Not Implemented, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">HTTP/1.1 documentation</a>}.
- */
- NOT_IMPLEMENTED(501, "Not Implemented"),
- /**
- * 502 Bad Gateway, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3">HTTP/1.1 documentation</a>}.
- */
- BAD_GATEWAY(502, "Bad Gateway"),
- /**
- * 503 Service Unavailable, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1 documentation</a>}.
- */
- SERVICE_UNAVAILABLE(503, "Service Unavailable"),
- /**
- * 504 Gateway Timeout, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5">HTTP/1.1 documentation</a>}.
- */
- GATEWAY_TIMEOUT(504, "Gateway Timeout"),
- /**
- * 505 HTTP Version Not Supported, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.6">HTTP/1.1 documentation</a>}.
- */
- HTTP_VERSION_NOT_SUPPORTED(505, "HTTP Version Not Supported");
-
-
- private final int code;
- private final String reason;
- private Family family;
-
- Status(final int statusCode, final String reasonPhrase) {
- this.code = statusCode;
- this.reason = reasonPhrase;
- switch(code/100) {
- case 1: this.family = Family.INFORMATIONAL; break;
- case 2: this.family = Family.SUCCESSFUL; break;
- case 3: this.family = Family.REDIRECTION; break;
- case 4: this.family = Family.CLIENT_ERROR; break;
- case 5: this.family = Family.SERVER_ERROR; break;
- default: this.family = Family.OTHER; break;
- }
- }
-
- /**
- * Get the class of status code.
- *
- * @return the class of status code.
- */
- public Family getFamily() {
- return family;
- }
-
- /**
- * Get the associated status code.
- *
- * @return the status code
- */
- public int getStatusCode() {
- return code;
- }
-
- /**
- * Get the reason phrase.
- *
- * @return the reason phrase.
- */
- public String getReasonPhrase() {
- return toString();
- }
-
- /**
- * Get the reason phrase.
- *
- * @return the reason phrase.
- */
- @Override
- public String toString() {
- return reason;
- }
-
- /**
- * Convert a numerical status code into the corresponding Status.
- *
- * @param statusCode the numerical status code.
- * @return the matching Status or null is no matching Status is defined.
- */
- public static Status fromStatusCode(final int statusCode) {
- for (Status s : Status.values()) {
- if (s.code == statusCode) {
- return s;
- }
- }
- return null;
- }
- }
-
- private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
-
- protected static final HeaderDelegate<EntityTag> entityTagDelegate =
- RuntimeDelegate.getInstance().createHeaderDelegate(EntityTag.class);
-
- protected static final HeaderDelegate<Date> dateDelegate =
- RuntimeDelegate.getInstance().createHeaderDelegate(Date.class);
-
- private Map<String, Object> properties;
-
- private int status;
-
- private InBoundHeaders headers;
-
- private boolean isEntityBuffered;
-
- private InputStream entity;
-
- private MessageBodyWorkers workers;
-
- public ClientResponse(int status, InBoundHeaders headers, InputStream entity, MessageBodyWorkers workers) {
- this.status = status;
- this.headers = headers;
- this.entity = entity;
- this.workers = workers;
- }
-
- /**
- * Get the client.
- *
- * @return the client.
- */
- public Client getClient() {
- return (Client)getProperties().get(Client.class.getName());
- }
-
- /**
- * Get the map of response properties.
- * <p>
- * A response property is an application-defined property that may be
- * added by the user, a filter, or the handler that is managing the
- * connection.
- *
- * @return the map of response properties.
- */
- public Map<String, Object> getProperties() {
- if (properties != null) return properties;
-
- return properties = new HashMap<String, Object>();
- }
-
- /**
- * Get the status code.
- *
- * @return the status code.
- */
- public int getStatus() {
- return status;
- }
-
- /**
- * Set the status code.
- *
- * @param status the status code.
- */
- public void setStatus(int status) {
- this.status = status;
- }
-
- /**
- * Set the status code.
- *
- * @param status the status code.
- */
- public void setStatus(Response.StatusType status) {
- setStatus(status.getStatusCode());
- }
-
- /**
- * Get the status code.
- *
- * @return the status code, or null if the underlying status code was set
- * using the method {@link #setStatus(int)} and there is no
- * mapping between the integer value and the Response.Status
- * enumeration value.
- */
- public Status getClientResponseStatus() {
- return Status.fromStatusCode(status);
- }
-
- /**
- * Get the status code.
- *
- * @return the status code, or null if the underlying status code was set
- * using the method {@link #setStatus(int)} and there is no
- * mapping between the integer value and the Response.Status
- * enumeration value.
- * @deprecated use {@link #getClientResponseStatus() }
- */
- @Deprecated
- public Response.Status getResponseStatus() {
- return Response.Status.fromStatusCode(status);
- }
-
- /**
- * Set the status code.
- *
- * @param status the status code.
- * @deprecated see {@link #setStatus(javax.ws.rs.core.Response.StatusType) }
- */
- @Deprecated
- public void setResponseStatus(Response.StatusType status) {
- setStatus(status);
- }
-
- /**
- * Get the HTTP headers of the response.
- *
- * @return the HTTP headers of the response.
- * @deprecated
- */
- @Deprecated
- public MultivaluedMap<String, String> getMetadata() {
- return getHeaders();
- }
-
- /**
- * Get the HTTP headers of the response.
- *
- * @return the HTTP headers of the response.
- */
- public MultivaluedMap<String, String> getHeaders() {
- return headers;
- }
-
- /**
- * Checks if there is an entity available.
- *
- * @return true if there is an entity present in the response.
- */
- public boolean hasEntity() {
- try {
- if (entity.available() > 0) {
- return true;
- } else if (entity.markSupported()) {
- entity.mark(1);
- int i = entity.read();
- entity.reset();
- return i != -1;
- } else {
- return false;
- }
- } catch (IOException ex) {
- throw new ClientHandlerException(ex);
- }
- }
-
- /**
- * Get the input stream of the response.
- *
- * @return the input stream of the response.
- */
- public InputStream getEntityInputStream() {
- return entity;
- }
-
- /**
- * Set the input stream of the response.
- *
- * @param entity the input stream of the response.
- */
- public void setEntityInputStream(InputStream entity) {
- this.isEntityBuffered = false;
- this.entity = entity;
- }
-
- /**
- * Get the entity of the response.
- * <p>
- * If the entity is not an instance of Closeable then the entity
- * input stream is closed.
- *
- * @param <T> the type of the response.
- * @param c the type of the entity.
- * @return an instance of the type <code>c</code>.
- *
- * @throws ClientHandlerException if there is an error processing the response.
- * @throws UniformInterfaceException if the response status is 204 (No Content).
- */
- public <T> T getEntity(Class<T> c) throws ClientHandlerException, UniformInterfaceException {
- return getEntity(c, c);
- }
-
- /**
- * Get the entity of the response.
- * <p>
- * If the entity is not an instance of Closeable then this response
- * is closed.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the entity.
- * @return an instance of the type represented by the generic type.
- *
- * @throws ClientHandlerException if there is an error processing the response.
- * @throws UniformInterfaceException if the response status is 204 (No Content).
- */
- public <T> T getEntity(GenericType<T> gt) throws ClientHandlerException, UniformInterfaceException {
- return getEntity(gt.getRawClass(), gt.getType());
- }
-
- private <T> T getEntity(Class<T> c, Type type) {
- if (getStatus() == 204) {
- throw new UniformInterfaceException(this);
- }
-
- MediaType mediaType = getType();
- if (mediaType == null) {
- mediaType = MediaType.APPLICATION_OCTET_STREAM_TYPE;
- }
-
- final MessageBodyReader<T> br = workers.getMessageBodyReader(
- c, type,
- EMPTY_ANNOTATIONS, mediaType);
- if (br == null) {
- close();
- String message = "A message body reader for Java class " + c.getName() +
- ", and Java type " + type +
- ", and MIME media type " + mediaType + " was not found";
- LOGGER.severe(message);
- Map<MediaType, List<MessageBodyReader>> m = workers.getReaders(mediaType);
- LOGGER.severe("The registered message body readers compatible with the MIME media type are:\n" +
- workers.readersToString(m));
-
- throw new ClientHandlerException(message);
- }
-
- try {
- T t = br.readFrom(c, type, EMPTY_ANNOTATIONS, mediaType, headers, entity);
- if (br instanceof CompletableReader) {
- t = ((CompletableReader<T>)br).complete(t);
- }
- if (!(t instanceof Closeable)) {
- close();
- }
- return t;
- } catch (IOException ex) {
- close();
- throw new ClientHandlerException(ex);
- }
- }
-
- /**
- * Buffer the entity.
- * <p>
- * All the bytes of the original entity input stream will be read
- * and stored in memory. The original entity input stream will
- * then be closed.
- * @throws ClientHandlerException if there is an error processing the response.
- */
- public void bufferEntity() throws ClientHandlerException {
- if (isEntityBuffered)
- return;
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try {
- ReaderWriter.writeTo(entity, baos);
- } catch(IOException ex) {
- throw new ClientHandlerException(ex);
- } finally {
- close();
- }
-
- entity = new ByteArrayInputStream(baos.toByteArray());
- isEntityBuffered = true;
- }
-
- /**
- * Close the response.
- * <p>
- * The entity input stream is closed.
- *
- * @throws ClientHandlerException if there is an error closing the response.
- */
- public void close() throws ClientHandlerException {
- try {
- entity.close();
- } catch (IOException e) {
- throw new ClientHandlerException(e);
- }
- }
-
- /**
- * Get the media type of the response.
- *
- * @return the media type.
- */
- public MediaType getType() {
- String ct = getHeaders().getFirst("Content-Type");
- return (ct != null) ? MediaType.valueOf(ct) : null;
- }
-
- /**
- * Get the location.
- *
- * @return the location, otherwise <code>null</code> if not present.
- */
- public URI getLocation() {
- String l = getHeaders().getFirst("Location");
- return (l != null) ? URI.create(l) : null;
- }
-
- /**
- * Get the entity tag.
- *
- * @return the entity tag, otherwise <code>null</code> if not present.
- */
- public EntityTag getEntityTag() {
- String t = getHeaders().getFirst("ETag");
-
- return (t != null) ? entityTagDelegate.fromString(t) : null;
- }
-
- /**
- * Get the last modified date.
- *
- * @return the last modified date, otherwise <code>null</code> if not present.
- */
- public Date getLastModified() {
- String d = getHeaders().getFirst("Last-Modified");
-
- return (d != null) ? dateDelegate.fromString(d) : null;
- }
-
- /**
- * Get response date (server side).
- *
- * @return the server side response date, otherwise <code>null</code> if not present.
- */
- public Date getResponseDate() {
- String d = getHeaders().getFirst("Date");
-
- return (d != null) ? dateDelegate.fromString(d) : null;
- }
-
- /**
- * Get the language.
- *
- * @return the language, otherwise <code>null</code> if not present.
- */
- public String getLanguage() {
- return getHeaders().getFirst("Content-Language");
- }
-
- /**
- * Get Content-Length.
- *
- * @return Content-Length as integer if present and valid number. In other
- * cases returns -1.
- */
- public int getLength() {
- int size = -1;
-
- String sizeStr = getHeaders().getFirst("Content-Length");
- if (sizeStr == null)
- return -1;
-
- try {
- size = Integer.parseInt(sizeStr);
- } catch (NumberFormatException nfe) {
- // do nothing
- }
-
- return size;
- }
-
- /**
- * Get the list of cookies.
- *
- * @return the cookies.
- */
- public List<NewCookie> getCookies() {
- List<String> hs = getHeaders().get("Set-Cookie");
- if (hs == null) return Collections.emptyList();
-
- List<NewCookie> cs = new ArrayList<NewCookie>();
- for (String h : hs) {
- cs.add(NewCookie.valueOf(h));
- }
- return cs;
- }
-
- /**
- * Get the allowed HTTP methods from the Allow HTTP header.
- * <p>
- * Note that the Allow HTTP header will be returned from an OPTIONS
- * request.
- *
- * @return the allowed HTTP methods, all methods will returned as
- * upper case strings.
- */
- public Set<String> getAllow() {
- String allow = headers.getFirst("Allow");
- if (allow == null)
- return Collections.emptySet();
-
- Set<String> allowedMethods = new HashSet<String>();
- StringTokenizer tokenizer = new StringTokenizer(allow, ",");
- while (tokenizer.hasMoreTokens()) {
- String m = tokenizer.nextToken().trim();
- if (m.length() > 0)
- allowedMethods.add(m.toUpperCase());
- }
- return allowedMethods;
- }
-
- public WebResourceLinkHeaders getLinks() {
- return new WebResourceLinkHeaders(getClient(), getHeaders());
- }
-
- @Override
- public String toString() {
- return "Client response status: " + status;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/CommittingOutputStream.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/CommittingOutputStream.java
deleted file mode 100644
index dca6fa44b6b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/CommittingOutputStream.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A commiting output stream that commits before
- * the first byte is written to the adapted {@link OutputStream}.
- * <p>
- * This class may be overridden to provide the commit functionality.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class CommittingOutputStream extends OutputStream {
-
- private OutputStream o;
-
- private boolean isCommitted;
-
- /**
- * Construct a new instance.
- * <p>
- * The method {@link #getOutputStream() } MUST be overridden
- * to return an output stream.
- */
- public CommittingOutputStream() {
- }
-
- /**
- * Construct a new instance with an output stream to adapt.
- *
- * @param o the adapted output stream.
- * @throws IllegalArgumentException if <code>o</code> is null.
- */
- public CommittingOutputStream(OutputStream o) {
- if (o == null)
- throw new IllegalArgumentException();
-
- this.o = o;
- }
-
- @Override
- public void write(byte b[]) throws IOException {
- commitWrite();
- o.write(b);
- }
-
- @Override
- public void write(byte b[], int off, int len) throws IOException {
- commitWrite();
- o.write(b, off, len);
- }
-
- public void write(int b) throws IOException {
- commitWrite();
- o.write(b);
- }
-
- @Override
- public void flush() throws IOException {
- commitWrite();
- o.flush();
- }
-
- @Override
- public void close() throws IOException {
- commitWrite();
- o.close();
- }
-
- private void commitWrite() throws IOException {
- if (!isCommitted) {
- isCommitted = true;
-
- commit();
-
- if (o == null)
- o = getOutputStream();
- }
- }
-
- /**
- * Get the adapted output stream.
- * <p>
- * This method MUST be overriden if the empty constructor is
- * utilized to construct an instance of this class.
- *
- * @return the adapted output stream.
- * @throws java.io.IOException
- */
- protected OutputStream getOutputStream() throws IOException {
- throw new IllegalStateException();
- }
-
- /**
- * Perform the commit functionality.
- *
- * @throws java.io.IOException
- */
- protected abstract void commit() throws IOException;
-}; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ComponentsClientConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ComponentsClientConfig.java
deleted file mode 100644
index 76282289685..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ComponentsClientConfig.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.config.ClientConfig;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-/* package */ class ComponentsClientConfig implements ClientConfig {
- private final ClientConfig cc;
-
- private final Set<Class<?>> providers = new LinkedHashSet<Class<?>>();
-
- public ComponentsClientConfig(ClientConfig cc, Class<?>... components) {
- this(cc, new HashSet<Class<?>>(Arrays.asList(components)));
- }
-
- public ComponentsClientConfig(ClientConfig cc, Set<Class<?>> components) {
- this.cc = cc;
-
- this.providers.addAll(cc.getClasses());
- this.providers.addAll(components);
- }
-
- public Set<Class<?>> getClasses() {
- return providers;
- }
-
- public Set<Object> getSingletons() {
- return cc.getSingletons();
- }
-
- public Map<String, Boolean> getFeatures() {
- return cc.getFeatures();
- }
-
- public boolean getFeature(String featureName) {
- return cc.getFeature(featureName);
- }
-
- public Map<String, Object> getProperties() {
- return cc.getProperties();
- }
-
- public Object getProperty(String propertyName) {
- return cc.getProperty(propertyName);
- }
-
- public boolean getPropertyAsFeature(String name) {
- return cc.getPropertyAsFeature(name);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/GenericType.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/GenericType.java
deleted file mode 100644
index f1ec0774940..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/GenericType.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-
-/**
- * Represents a generic type {@code T}.
- *
- * @param <T> the generic type parameter.
- */
-public class GenericType<T> {
-
- private final Type t;
-
- private final Class c;
-
- /**
- * Constructs a new generic type, deriving the generic type and class from
- * type parameter. Note that this constructor is protected, users should create
- * a (usually anonymous) subclass as shown above.
- *
- */
- protected GenericType() {
- Type superclass = getClass().getGenericSuperclass();
- if (!(superclass instanceof ParameterizedType)) {
- throw new RuntimeException("Missing type parameter.");
- }
- ParameterizedType parameterized = (ParameterizedType) superclass;
-
- this.t = parameterized.getActualTypeArguments()[0];
- this.c = getClass(this.t);
- }
-
- /**
- * Constructs a new generic type, supplying the generic type
- * information and derving the class.
- *
- * @param genericType the generic type.
- * @throws IllegalArgumentException if genericType
- * is null or is neither an instance of Class or ParameterizedType whose raw
- * type is not an instance of Class.
- */
- public GenericType(Type genericType) {
- if (genericType == null) {
- throw new IllegalArgumentException("Type must not be null");
- }
-
- this.t = genericType;
- this.c = getClass(this.t);
- }
-
- private static Class getClass(Type type) {
- if (type instanceof Class) {
- return (Class)type;
- } else if (type instanceof ParameterizedType) {
- ParameterizedType parameterizedType = (ParameterizedType)type;
- if (parameterizedType.getRawType() instanceof Class) {
- return (Class)parameterizedType.getRawType();
- }
- } else if (type instanceof GenericArrayType) {
- GenericArrayType array = (GenericArrayType) type;
- return ReflectionHelper.getArrayClass((Class) ((ParameterizedType) array.getGenericComponentType()).getRawType());
- }
- throw new IllegalArgumentException("Type parameter not a class or " +
- "parameterized type whose raw type is a class");
- }
-
- /**
- * Gets underlying {@code Type} instance derived from the
- * type.
- *
- * @return the type.
- */
- public final Type getType() {
- return t;
- }
-
- /**
- * Gets underlying raw class instance derived from the
- * type.
- *
- * @return the class.
- */
- public final Class<T> getRawClass() {
- return c;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/PartialRequestBuilder.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/PartialRequestBuilder.java
deleted file mode 100644
index d2f954d8b38..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/PartialRequestBuilder.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.core.header.OutBoundHeaders;
-import java.util.Locale;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * A partial implementation of {@link RequestBuilder} that implements
- * the methods on {@link RequestBuilder} but leaves undefined the build
- * methods for constructing the request.
- *
- * @param <T> the type than implements {@link RequestBuilder}.
- * @author Paul.Sandoz@Sun.Com
- */
-@SuppressWarnings("unchecked")
-public abstract class PartialRequestBuilder<T extends RequestBuilder>
- implements RequestBuilder<T> {
-
- protected Object entity;
-
- protected MultivaluedMap<String, Object> metadata;
-
- protected PartialRequestBuilder() {
- metadata = new OutBoundHeaders();
- }
-
- public T entity(Object entity) {
- this.entity = entity;
- return (T)this;
- }
-
- public T entity(Object entity, MediaType type) {
- entity(entity);
- type(type);
- return (T)this;
- }
-
- public T entity(Object entity, String type) {
- entity(entity);
- type(type);
- return (T)this;
- }
-
- public T type(MediaType type) {
- getMetadata().putSingle("Content-Type", type);
- return (T)this;
- }
-
- public T type(String type) {
- getMetadata().putSingle("Content-Type", MediaType.valueOf(type));
- return (T)this;
- }
-
- public T accept(MediaType... types) {
- for (MediaType type : types)
- getMetadata().add("Accept", type);
- return (T)this;
- }
-
- public T accept(String... types) {
- for (String type : types)
- getMetadata().add("Accept", type);
- return (T)this;
- }
-
- public T acceptLanguage(Locale... locales) {
- for (Locale locale : locales)
- getMetadata().add("Accept-Language", locale);
- return (T)this;
- }
-
- public T acceptLanguage(String... locales) {
- for (String locale : locales)
- getMetadata().add("Accept-Language", locale);
- return (T)this;
- }
-
- public T cookie(Cookie cookie) {
- getMetadata().add("Cookie", cookie);
- return (T)this;
- }
-
- public T header(String name, Object value) {
- getMetadata().add(name, value);
- return (T)this;
- }
-
- private MultivaluedMap<String, Object> getMetadata() {
- if (metadata != null) return metadata;
-
- return metadata = new OutBoundHeaders();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestBuilder.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestBuilder.java
deleted file mode 100644
index 3c132caee44..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestBuilder.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import java.util.Locale;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-
-/**
- * An interface for building requests. The build methods for constructing
- * the request from the built information are left undefined and
- * implementations must define such methods.
- *
- * @param <T> the type than implements {@link RequestBuilder}.
- * @author Paul.Sandoz@Sun.Com
- */
-public interface RequestBuilder<T extends RequestBuilder> {
-
- /**
- * Set the request entity.
- * <p>
- * Any Java type instance for a request entity, that is supported by the client
- * configuration of the client, can be passed. If generic information is
- * required then an instance of {@link javax.ws.rs.core.GenericEntity} may
- * be used.
- *
- * @param entity the request entity
- * @return the builder.
- */
- T entity(Object entity);
-
- /**
- * Set the request entity it's media type.
- * <p>
- * Any Java type instance for a request entity, that is supported by the client
- * configuration of the client, can be passed. If generic information is
- * required then an instance of {@link javax.ws.rs.core.GenericEntity} may
- * be used.
- *
- * @param entity the request entity
- * @param type the media type
- * @return the builder.
- */
- T entity(Object entity, MediaType type);
-
- /**
- * Set the request entity it's media type.
- * <p>
- * Any Java type instance for a request entity, that is supported by the client
- * configuration of the client, can be passed. If generic information is
- * required then an instance of {@link javax.ws.rs.core.GenericEntity} may
- * be used.
- *
- * @param entity the request entity
- * @param type the media type
- * @return the builder.
- */
- T entity(Object entity, String type);
-
- /**
- * Set the media type.
- *
- * @param type the media type
- * @return the builder.
- */
- T type(MediaType type);
-
- /**
- * Set the media type.
- *
- * @param type the media type
- * @return the builder.
- */
- T type(String type);
-
- /**
- * Add acceptable media types.
- *
- * @param types an array of the acceptable media types
- * @return the builder.
- */
- T accept(MediaType... types);
-
- /**
- * Add acceptable media types.
- *
- * @param types an array of the acceptable media types
- * @return the builder.
- */
- T accept(String... types);
-
- /**
- * Add acceptable languages
- *
- * @param locales an array of the acceptable languages
- * @return the builder.
- */
- T acceptLanguage(Locale... locales);
-
- /**
- * Add acceptable languages
- *
- * @param locales an array of the acceptable languages
- * @return the builder.
- */
- T acceptLanguage(String... locales);
-
- /**
- * Add a cookie to be set.
- *
- * @param cookie to be set.
- * @return the builder
- */
- T cookie(Cookie cookie);
-
- /**
- * Add an HTTP header and value.
- *
- * @param name the HTTP header name.
- * @param value the HTTP header value.
- * @return the builder.
- */
- T header(String name, Object value);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestWriter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestWriter.java
deleted file mode 100644
index e04eb1842e6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/RequestWriter.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.spi.MessageBodyWorkers;
-
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.GenericEntity;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-/**
- * A request writer for writing header values and a request entity.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class RequestWriter {
- private static final Logger LOGGER = Logger.getLogger(RequestWriter.class.getName());
-
- protected static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
-
- private MessageBodyWorkers workers;
-
- public RequestWriter() {}
-
- public RequestWriter(MessageBodyWorkers workers) {
- this.workers = workers;
- }
-
- @Context
- public void setMessageBodyWorkers(MessageBodyWorkers workers) {
- this.workers = workers;
- }
-
- public MessageBodyWorkers getMessageBodyWorkers() {
- return workers;
- }
-
- /**
- * A lister for listening to events when writing a request entity.
- * <p>
- * The listener is registered when invoking the
- * {@link TerminatingClientHandler#writeRequestEntity(com.sun.jersey.api.client.ClientRequest, com.sun.jersey.api.client.TerminatingClientHandler.RequestEntityWriterListener) }
- * method.
- *
- * @author Paul.Sandoz@Sun.Com
- */
- protected interface RequestEntityWriterListener {
-
- /**
- * Called when the size of the request entity is obtained.
- * <p>
- * Enables the appropriate setting of HTTP headers
- * for the size of the request entity and/or configure an appropriate
- * transport encoding.
- *
- * @param size the size, in bytes, of the request entity, otherwise -1
- * if the size cannot be determined before serialization.
- * @throws java.io.IOException
- */
- void onRequestEntitySize(long size) throws IOException;
-
- /**
- * Called when the output stream is required to write the request
- * entity.
- *
- * @return the output stream to write the request entity.
- * @throws java.io.IOException
- */
- OutputStream onGetOutputStream() throws IOException;
- }
-
- /**
- * A writer for writing a request entity.
- * <p>
- * An instance of a <code>RequestEntityWriter</code> is obtained by
- * invoking the {@link TerminatingClientHandler#getRequestEntityWriter(com.sun.jersey.api.client.ClientRequest) }
- * method.
- *
- */
- protected interface RequestEntityWriter {
- /**
- *
- * @return size the size, in bytes, of the request entity, otherwise -1
- * if the size cannot be determined before serialization.
- */
- long getSize();
-
- /**
- *
- * @return the media type of the request entity.
- */
- MediaType getMediaType();
-
- /**
- * Write the request entity.
- *
- * @param out the output stream to write the request entity.
- * @throws java.io.IOException
- */
- void writeRequestEntity(OutputStream out) throws IOException;
- }
-
- /**
- *
- */
- private final class RequestEntityWriterImpl implements RequestEntityWriter {
- private final ClientRequest cr;
- private final Object entity;
- private final Type entityType;
- private MediaType mediaType;
- private final long size;
- private final MessageBodyWriter bw;
-
- /**
- *
- * @param cr
- */
- public RequestEntityWriterImpl(ClientRequest cr) {
- this.cr = cr;
-
- final Object e = cr.getEntity();
- if (e == null)
- throw new IllegalArgumentException("The entity of the client request is null");
-
- if (e instanceof GenericEntity) {
- final GenericEntity ge = (GenericEntity)e;
- this.entity = ge.getEntity();
- this.entityType = ge.getType();
- } else {
- this.entity = e;
- this.entityType = entity.getClass();
- }
- final Class entityClass = entity.getClass();
-
- final MultivaluedMap<String, Object> headers = cr.getHeaders();
- this.mediaType = RequestWriter.this.
- getMediaType(entityClass, entityType, headers);
-
- this.bw = workers.getMessageBodyWriter(
- entityClass, entityType,
- EMPTY_ANNOTATIONS, mediaType);
- if (bw == null) {
- String message = "A message body writer for Java class " +
- entity.getClass().getName() +
- ", and Java type " + entityType +
- ", and MIME media type " + mediaType + " was not found";
- LOGGER.severe(message);
- Map<MediaType, List<MessageBodyWriter>> m = workers.getWriters(mediaType);
- LOGGER.severe("The registered message body writers compatible with the MIME media type are:\n" +
- workers.writersToString(m));
-
- throw new ClientHandlerException(message);
- }
-
- this.size = headers.containsKey(HttpHeaders.CONTENT_ENCODING)
- ? -1
- : bw.getSize(entity, entityClass, entityType, EMPTY_ANNOTATIONS, mediaType);
- }
-
- /**
- *
- * @return
- */
- public long getSize() {
- return size;
- }
-
- /**
- *
- * @return
- */
- public MediaType getMediaType() {
- return mediaType;
- }
-
- /**
- *
- * @param out
- * @throws java.io.IOException
- */
- public void writeRequestEntity(OutputStream out) throws IOException {
- out = cr.getAdapter().adapt(cr, out);
- try {
- bw.writeTo(entity, entity.getClass(), entityType,
- EMPTY_ANNOTATIONS, mediaType, cr.getMetadata(),
- out);
- out.flush();
- } finally {
- out.close();
- }
- }
- }
-
- /**
- * Get a request entity writer capable of writing the request entity.
- *
- * @param ro the client request.
- * @return the request entity writer.
- */
- protected RequestEntityWriter getRequestEntityWriter(final ClientRequest ro) {
- return new RequestEntityWriterImpl(ro);
- }
-
- /**
- * Write a request entity using an appropriate message body writer.
- * <p>
- * The method {@link RequestEntityWriterListener#onRequestEntitySize(long) } will be invoked
- * with the size of the request entity to be serialized.
- * The method {@link RequestEntityWriterListener#onGetOutputStream() } will be invoked
- * when the output stream is required to write the request entity.
- *
- * @param ro the client request containing the request entity. If the
- * request entity is null then the method will not write any entity.
- * @param listener the request entity listener.
- * @throws java.io.IOException
- */
- protected void writeRequestEntity(ClientRequest ro,
- RequestEntityWriterListener listener) throws IOException {
- Object entity = ro.getEntity();
- if (entity == null)
- return;
-
- Type entityType = null;
- if (entity instanceof GenericEntity) {
- final GenericEntity ge = (GenericEntity)entity;
- entityType = ge.getType();
- entity = ge.getEntity();
- } else {
- entityType = entity.getClass();
- }
- final Class entityClass = entity.getClass();
-
-
- final MultivaluedMap<String, Object> headers = ro.getHeaders();
- final MediaType mediaType = getMediaType(entityClass, entityType, headers);
-
- final MessageBodyWriter bw = workers.getMessageBodyWriter(
- entityClass, entityType,
- EMPTY_ANNOTATIONS, mediaType);
- if (bw == null) {
- throw new ClientHandlerException(
- "A message body writer for Java type, " + entity.getClass() +
- ", and MIME media type, " + mediaType + ", was not found");
- }
-
- final long size = headers.containsKey(HttpHeaders.CONTENT_ENCODING)
- ? -1
- : bw.getSize(entity, entityClass, entityType, EMPTY_ANNOTATIONS, mediaType);
- listener.onRequestEntitySize(size);
-
- final OutputStream out = ro.getAdapter().adapt(ro, listener.onGetOutputStream());
- try {
- bw.writeTo(entity, entityClass, entityType,
- EMPTY_ANNOTATIONS, mediaType, headers, out);
- out.flush();
- } catch (IOException ex) {
- try { out.close(); } catch (Exception e) { }
- throw ex;
- } catch (RuntimeException ex) {
- try { out.close(); } catch (Exception e) { }
- throw ex;
- }
-
- out.close();
- }
-
-
- private MediaType getMediaType(Class entityClass, Type entityType,
- MultivaluedMap<String, Object> headers) {
- final Object mediaTypeHeader = headers.getFirst("Content-Type");
- if (mediaTypeHeader instanceof MediaType) {
- return (MediaType)mediaTypeHeader;
- } else if (mediaTypeHeader != null) {
- return MediaType.valueOf(mediaTypeHeader.toString());
- } else {
- // Content-Type is not present choose a default type
- final List<MediaType> mediaTypes = workers.getMessageBodyWriterMediaTypes(
- entityClass, entityType, EMPTY_ANNOTATIONS);
- final MediaType mediaType = getMediaType(mediaTypes);
- headers.putSingle("Content-Type", mediaType);
- return mediaType;
- }
- }
-
- private MediaType getMediaType(List<MediaType> mediaTypes) {
- if (mediaTypes.isEmpty()) {
- return MediaType.APPLICATION_OCTET_STREAM_TYPE;
- } else {
- MediaType mediaType = mediaTypes.get(0);
- if (mediaType.isWildcardType() || mediaType.isWildcardSubtype())
- mediaType = MediaType.APPLICATION_OCTET_STREAM_TYPE;
- return mediaType;
- }
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/TerminatingClientHandler.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/TerminatingClientHandler.java
deleted file mode 100644
index 8836dbfb2bc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/TerminatingClientHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-/**
- * A terminating client handler that is invoked to produce an HTTP request
- * to send to a resource and process the HTTP response received from the resource.
- * <p>
- * This class can be extended to integrate HTTP protocol functionality with
- * the Client API. Utility methods are provided for converting header values
- * and writing a request entity.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class TerminatingClientHandler extends RequestWriter implements ClientHandler {
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterface.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterface.java
deleted file mode 100644
index a54e56f2f3b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterface.java
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.config.ClientConfig;
-
-/**
- * A uniform interface for invoking HTTP requests.
- * <p>
- * Any Java type for a response entity, that is supported by the client
- * configuration of the client, may be declared using
- * <code>Class&lt;T&gt;</code> where <code>T</code> is the Java type, or
- * using {@link GenericType} where the generic parameter is the Java type.
- * <p>
- * Any Java type instance for a request entity, that is supported by the client
- * configuration of the client, can be passed. If generic information is
- * required then an instance of {@link javax.ws.rs.core.GenericEntity} may
- * be used.
- * <p>
- * A type of {@link ClientResponse} declared
- * for the response entity may be used to obtain the status, headers and
- * response entity.
- * <p>
- * If any type, other than {@link ClientResponse},
- * is declared and the response status is greater than or equal to 300 then a
- * {@link UniformInterfaceException} exception
- * will be thrown, from which the
- * {@link ClientResponse} instance can be
- * accessed.
- * <p>
- * In the following cases it is necessary to close the response, when response
- * processing has completed, to ensure that underlying resources are
- * correctly released.
- * <p>
- * If a response entity is declared of the type
- * {@link ClientResponse}
- * or of a type that is assignable to {@link java.io.Closeable}
- * (such as {@link java.io.InputStream}) then the response must be either:
- * 1) closed by invoking the method
- * {@link ClientResponse#close() } or
- * {@link java.io.Closeable#close}; or 2) all bytes of response entity must be
- * read.
- * <p>
- * If a {@link UniformInterfaceException} is
- * thrown then by default the response entity is automatically buffered and
- * the underlying resources are correctly released. See the following property
- * for more details:
- * {@link ClientConfig#PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION}.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.client
- */
-public interface UniformInterface {
-
- /**
- * Invoke the HEAD method.
- *
- * @return the HTTP response.
- */
- ClientResponse head();
-
-
- /**
- * Invoke the OPTIONS method.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T options(Class<T> c) throws UniformInterfaceException;
-
-
- /**
- * Invoke the OPTIONS method.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T options(GenericType<T> gt) throws UniformInterfaceException;
-
- /**
- * Invoke the GET method.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T get(Class<T> c) throws UniformInterfaceException;
-
- /**
- * Invoke the GET method.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T get(GenericType<T> gt) throws UniformInterfaceException;
-
-
- /**
- * Invoke the PUT method with no request entity or response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void put() throws UniformInterfaceException;
-
- /**
- * Invoke the PUT method with a request entity but no response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @param requestEntity the request entity.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void put(Object requestEntity) throws UniformInterfaceException;
-
- /**
- * Invoke the PUT method with no request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T put(Class<T> c) throws UniformInterfaceException;
-
- /**
- * Invoke the PUT method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T put(GenericType<T> gt) throws UniformInterfaceException;
-
- /**
- * Invoke the PUT method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T put(Class<T> c, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke the PUT method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T put(GenericType<T> gt, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke the POST method with no request entity or response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void post() throws UniformInterfaceException;
-
- /**
- * Invoke the POST method with a request entity but no response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @param requestEntity the request entity.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void post(Object requestEntity) throws UniformInterfaceException;
-
- /**
- * Invoke the POST method with no request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T post(Class<T> c) throws UniformInterfaceException;
-
- /**
- * Invoke the POST method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T post(GenericType<T> gt) throws UniformInterfaceException;
-
- /**
- * Invoke the POST method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T post(Class<T> c, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke the POST method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T post(GenericType<T> gt, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke the DELETE method with no request entity or response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void delete() throws UniformInterfaceException;
-
- /**
- * Invoke the DELETE method with a request entity but no response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @param requestEntity the request entity.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void delete(Object requestEntity) throws UniformInterfaceException;
-
- /**
- * Invoke the DELETE method with no request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T delete(Class<T> c) throws UniformInterfaceException;
-
- /**
- * Invoke the DELETE method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T delete(GenericType<T> gt) throws UniformInterfaceException;
-
- /**
- * Invoke the DELETE method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T delete(Class<T> c, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke the DELETE method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T delete(GenericType<T> gt, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke a HTTP method with no request entity or response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @param method the HTTP method.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void method(String method) throws UniformInterfaceException;
-
- /**
- * Invoke a HTTP method with a request entity but no response.
- * <p>
- * If the status code is less than 300 and a representation is present
- * then that representation is ignored.
- *
- * @param method the HTTP method.
- * @param requestEntity the request entity.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300.
- */
- void method(String method, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke a HTTP method with no request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param c the type of the returned response.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T method(String method, Class<T> c) throws UniformInterfaceException;
-
- /**
- * Invoke a HTTP method with no request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param gt the generic type of the returned response.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T method(String method, GenericType<T> gt) throws UniformInterfaceException;
-
- /**
- * Invoke a HTTP method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param c the type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type <code>c</code>.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>c</code> is not the type
- * {@link ClientResponse}.
- */
- <T> T method(String method, Class<T> c, Object requestEntity)
- throws UniformInterfaceException;
-
- /**
- * Invoke a HTTP method with a request entity that returns a response.
- *
- * @param <T> the type of the response.
- * @param method the HTTP method.
- * @param gt the generic type of the returned response.
- * @param requestEntity the request entity.
- * @return an instance of type represented by the generic type.
- * @throws UniformInterfaceException if the status of the HTTP response is
- * greater than or equal to 300 and <code>gt</code> does not
- * represent the type {@link ClientResponse}.
- */
- <T> T method(String method, GenericType<T> gt, Object requestEntity)
- throws UniformInterfaceException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterfaceException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterfaceException.java
deleted file mode 100644
index a28bf7b6ade..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/UniformInterfaceException.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-/**
- * A runtime exception thrown by a method on the {@link UniformInterface} or
- * {@link ClientResponse} when the status code of the HTTP response indicates
- * a response that is not expected.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class UniformInterfaceException extends RuntimeException {
- transient private final ClientResponse r;
-
- /**
- * Construct a uniform interface exception.
- * <p>
- * The client response entity will be buffered by calling
- * {@link ClientResponse#bufferEntity() }.
- *
- * @param r the client response. The message of the exception is set to
- * r.toString();
- */
- public UniformInterfaceException(ClientResponse r) {
- this(r, true);
- }
-
- /**
- * Construct a uniform interface exception.
- *
- * @param r the client response. The message of the exception is set to
- * r.toString();
- * @param bufferResponseEntity if true buffer the client response entity by calling
- * {@link ClientResponse#bufferEntity() }.
- */
- public UniformInterfaceException(ClientResponse r, boolean bufferResponseEntity) {
- super(r.toString());
- if (bufferResponseEntity)
- r.bufferEntity();
- this.r = r;
- }
-
- /**
- * Construct a uniform interface exception.
- * <p>
- * The client response entity will be buffered by calling
- * {@link ClientResponse#bufferEntity() }.
- *
- * @param message the message of the exception.
- * @param r the client response.
- *
- */
- public UniformInterfaceException(String message, ClientResponse r) {
- this(message, r, true);
- }
-
- /**
- * Construct a uniform interface exception.
- *
- * @param message the message of the exception.
- * @param r the client response.
- * @param bufferResponseEntity if true buffer the client response entity by calling
- * {@link ClientResponse#bufferEntity() }.
- *
- */
- public UniformInterfaceException(String message, ClientResponse r, boolean bufferResponseEntity) {
- super(message);
- if (bufferResponseEntity)
- r.bufferEntity();
- this.r = r;
- }
-
- /**
- * Get the client response assocatiated with the exception.
-
- * @return the client response.
- */
- public ClientResponse getResponse() {
- return r;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewResource.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewResource.java
deleted file mode 100644
index bdddfe7bb8a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewResource.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.filter.Filterable;
-import com.sun.jersey.client.impl.ClientRequestImpl;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-public class ViewResource extends Filterable implements
- RequestBuilder<ViewResource.Builder>,
- ViewUniformInterface {
- private final Client client;
-
- private final URI u;
-
- /* package */ ViewResource(Client c, URI u) {
- super((ClientHandler)c);
- this.client = c;
- this.u = u;
- }
-
- private ViewResource(ViewResource that, UriBuilder ub) {
- super(that);
- this.client = that.client;
- this.u = ub.build();
- }
-
- /**
- * Get the URI to the resource.
- *
- * @return the URI.
- */
- public URI getURI() {
- return u;
- }
-
- /**
- * Get the URI builder to the resource.
- *
- * @return the URI builder.
- */
- public UriBuilder getUriBuilder() {
- return UriBuilder.fromUri(u);
- }
-
- /**
- * Get the ClientRequest builder.
- *
- * @return the ClientRequest builder.
- */
- public Builder getRequestBuilder() {
- return new Builder();
- }
-
- /**
- * @return the URI as a String instance
- */
- @Override
- public String toString() {
- return u.toString();
- }
-
- /**
- * Returns a hash code for this <code>WebResource</code>.
- * <p>
- * The hash code is the hash code of URI of this
- * <code>WebResource</code>.
- *
- * @return a hash code for this <code>WebResource</code>.
- */
- @Override
- public int hashCode() {
- return u.hashCode();
- }
-
- /**
- * Compares this resource to the specified object.
- * <p>
- * The result is true if and only if the argument is not null and is a
- * <code>WebResource</code> object whose URI is equal to the URI of this
- * <code>WebResource</code>.
- *
- * @param obj the object to compare this <code>WebResource</code> against.
- * @return true if the <code>WebResource</code> are equal; false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
-
- if (obj instanceof ViewResource) {
- final ViewResource that = (ViewResource) obj;
- return that.u.equals(this.u);
- }
- return false;
- }
-
- // ViewUniformInterface
-
- public <T> T head(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "HEAD"));
- }
-
- public <T> T head(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "HEAD"));
- }
-
-
- public <T> T options(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
- public <T> T options(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
-
- public <T> T get(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "GET"));
- }
-
- public <T> T get(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "GET"));
- }
-
-
- public <T> T put(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- public <T> T put(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- public <T> T put(Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- public <T> T put(T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
-
- public <T> T post(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "POST"));
- }
-
- public <T> T post(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "POST"));
- }
-
- public <T> T post(Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- public <T> T post(T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
-
- public <T> T delete(Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public <T> T delete(T t) {
- return handle(t, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- public <T> T delete(Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- public <T> T delete(T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
-
- public <T> T method(String method, Class<T> c) {
- return handle(c, new ClientRequestImpl(getURI(), method));
- }
-
- public <T> T method(String method, T t) {
- return handle(t, new ClientRequestImpl(getURI(), method));
- }
-
- public <T> T method(String method, Class<T> c, Object requestEntity) {
- return handle(c, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- public <T> T method(String method, T t, Object requestEntity) {
- return handle(t, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
-
- // RequestBuilder<WebResource.Builder>
-
- public Builder entity(Object entity) {
- return getRequestBuilder().entity(entity);
- }
-
- public Builder entity(Object entity, MediaType type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- public Builder entity(Object entity, String type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- public Builder type(MediaType type) {
- return getRequestBuilder().type(type);
- }
-
- public Builder type(String type) {
- return getRequestBuilder().type(type);
- }
-
- public Builder accept(MediaType... types) {
- return getRequestBuilder().accept(types);
- }
-
- public Builder accept(String... types) {
- return getRequestBuilder().accept(types);
- }
-
- public Builder acceptLanguage(Locale... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- public Builder acceptLanguage(String... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- public Builder cookie(Cookie cookie) {
- return getRequestBuilder().cookie(cookie);
- }
-
- public Builder header(String name, Object value) {
- return getRequestBuilder().header(name, value);
- }
-
- // URI specific building
-
- /**
- * Create a new WebResource from this web resource with an additional path
- * added to the URI of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param path the additional path.
- *
- * @return the new web resource.
- */
- public ViewResource path(String path) {
- return new ViewResource(this, getUriBuilder().path(path));
- }
-
- /**
- * Create a new WebResource from this web resource.
- * <p>
- * If the URI contains a path component and the path starts with a '/' then
- * the path of this web resource URI is replaced. Otherwise the path is
- * appended.
- * <p>
- * If the URI contains query parameters then those query parameters will
- * replace the query parameters (if any) of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param uri the URI.
- * @return the new web resource.
- */
- public ViewResource uri(URI uri) {
- UriBuilder b = getUriBuilder();
- String path = uri.getRawPath();
- if (path != null && path.length() > 0) {
- if (path.startsWith("/")) {
- b.replacePath(path);
- } else {
- b.path(path);
- }
- }
- String query = uri.getRawQuery();
- if (query != null && query.length() > 0) {
- b.replaceQuery(query);
- }
- return new ViewResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with an additional
- * query parameter added to the URI of this web resource.
- *
- * @param key the query parameter name
- * @param value the query parameter value
- * @return the new web resource.
- */
- public ViewResource queryParam(String key, String value) {
- UriBuilder b = getUriBuilder();
- b.queryParam(key, value);
- return new ViewResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with additional
- * query parameters added to the URI of this web resource.
- *
- * @param params the query parameters.
- * @return the new web resource.
- */
- public ViewResource queryParams(MultivaluedMap<String, String> params) {
- UriBuilder b = getUriBuilder();
- for (Map.Entry<String, List<String>> e : params.entrySet()) {
- for (String value : e.getValue())
- b.queryParam(e.getKey(), value);
- }
- return new ViewResource(this, b);
- }
-
- // Builder that builds client request and handles it
-
- /**
- * The builder for building a {@link ClientRequest} instance and
- * handling the request using the {@link UniformInterface}. The methods
- * of the {@link UniformInterface} are the build methods of the builder.
- */
- public final class Builder extends PartialRequestBuilder<Builder>
- implements ViewUniformInterface {
-
-
- private Builder() {
- }
-
- private ClientRequest build(String method) {
- ClientRequest ro = new ClientRequestImpl(u, method, entity, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- private ClientRequest build(String method, Object e) {
- ClientRequest ro = new ClientRequestImpl(u, method, e, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- // ViewUniformInterface
-
- public <T> T head(Class<T> c) {
- return handle(c, build("HEAD"));
- }
-
- public <T> T head(T t) {
- return handle(t, build("HEAD"));
- }
-
-
- public <T> T options(Class<T> c) {
- return handle(c, build("OPTIONS"));
- }
-
- public <T> T options(T t) {
- return handle(t, build("OPTIONS"));
- }
-
-
- public <T> T get(Class<T> c) {
- return handle(c, build("GET"));
- }
-
- public <T> T get(T t) {
- return handle(t, build("GET"));
- }
-
-
- public <T> T put(Class<T> c) {
- return handle(c, build("PUT"));
- }
-
- public <T> T put(T t) {
- return handle(t, build("PUT"));
- }
-
- public <T> T put(Class<T> c, Object requestEntity) {
- return handle(c, build("PUT", requestEntity));
- }
-
- public <T> T put(T t, Object requestEntity) {
- return handle(t, build("PUT", requestEntity));
- }
-
-
- public <T> T post(Class<T> c) {
- return handle(c, build("POST"));
- }
-
- public <T> T post(T t) {
- return handle(t, build("POST"));
- }
-
- public <T> T post(Class<T> c, Object requestEntity) {
- return handle(c, build("POST", requestEntity));
- }
-
- public <T> T post(T t, Object requestEntity) {
- return handle(t, build("POST", requestEntity));
- }
-
-
- public <T> T delete(Class<T> c) {
- return handle(c, build("DELETE"));
- }
-
- public <T> T delete(T t) {
- return handle(t, build("DELETE"));
- }
-
- public <T> T delete(Class<T> c, Object requestEntity) {
- return handle(c, build("DELETE", requestEntity));
- }
-
- public <T> T delete(T t, Object requestEntity) {
- return handle(t, build("DELETE", requestEntity));
- }
-
-
- public <T> T method(String method, Class<T> c) {
- return handle(c, build(method));
- }
-
- public <T> T method(String method, T t) {
- return handle(t, build(method));
- }
-
- public <T> T method(String method, Class<T> c, Object requestEntity) {
- return handle(c, build(method, requestEntity));
- }
-
- public <T> T method(String method, T t, Object requestEntity) {
- return handle(t, build(method, requestEntity));
- }
- }
-
-
- private <T> T handle(Class<T> c, ClientRequest ro) {
- return client.getViewProxy(c).view(c, ro, getHeadHandler());
- }
-
- private <T> T handle(T t, ClientRequest ro) {
- return client.getViewProxy((Class<T>)t.getClass()).view(t, ro, getHeadHandler());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewUniformInterface.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewUniformInterface.java
deleted file mode 100644
index 09023d0bb58..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/ViewUniformInterface.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-public interface ViewUniformInterface {
-
- <T> T head(Class<T> c);
-
- <T> T head(T c);
-
-
- <T> T options(Class<T> c);
-
- <T> T options(T c);
-
-
- <T> T get(Class<T> c);
-
- <T> T get(T c);
-
-
- <T> T put(Class<T> c);
-
- <T> T put(T c);
-
- <T> T put(Class<T> c, Object requestEntity);
-
- <T> T put(T c, Object requestEntity);
-
-
- <T> T post(Class<T> c);
-
- <T> T post(T c);
-
- <T> T post(Class<T> c, Object requestEntity);
-
- <T> T post(T c, Object requestEntity);
-
-
- <T> T delete(Class<T> c);
-
- <T> T delete(T c);
-
- <T> T delete(Class<T> c, Object requestEntity);
-
- <T> T delete(T c, Object requestEntity);
-
-
- <T> T method(String method, Class<T> c);
-
- <T> T method(String method, T c);
-
- <T> T method(String method, Class<T> c, Object requestEntity);
-
- <T> T method(String method, T c, Object requestEntity);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResource.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResource.java
deleted file mode 100644
index 3ab2fd5e40e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResource.java
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.filter.Filterable;
-import com.sun.jersey.client.impl.ClientRequestImpl;
-import com.sun.jersey.client.impl.CopyOnWriteHashMap;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * An encapsulation of a Web resource capable of building requests
- * to send to the Web resource and processing responses returned from the Web
- * resource.
- * <p>
- * A WebResource instance is obtained from the {@link Client}.
- * <p>
- * The Web resource implements the {@link UniformInterface} to invoke the HTTP
- * method on the Web resource. A client request may be built before invocation
- * on the uniform interface.
- * <p>
- * Methods to create a request and return a response are thread-safe. Methods
- * that modify filters are not guaranteed to be thread-safe.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.client
- */
-public class WebResource extends Filterable implements
- RequestBuilder<WebResource.Builder>,
- UniformInterface {
- private final URI u;
- private CopyOnWriteHashMap<String, Object> properties;
-
- /* package */ WebResource(ClientHandler c, CopyOnWriteHashMap<String, Object> properties, URI u) {
- super(c);
- this.u = u;
- this.properties = properties.clone();
- }
-
- private WebResource(WebResource that, UriBuilder ub) {
- super(that);
- this.u = ub.build();
- properties = (that.properties == null ? null : that.properties.clone());
- }
-
- /**
- * Get the URI to the resource.
- *
- * @return the URI.
- */
- public URI getURI() {
- return u;
- }
-
- /**
- * Get the URI builder to the resource.
- *
- * @return the URI builder.
- * @deprecated
- */
- @Deprecated
- public UriBuilder getBuilder() {
- return UriBuilder.fromUri(u);
- }
-
- /**
- * Get the URI builder to the resource.
- *
- * @return the URI builder.
- */
- public UriBuilder getUriBuilder() {
- return UriBuilder.fromUri(u);
- }
-
- /**
- * Get the ClientRequest builder.
- *
- * @return the ClientRequest builder.
- */
- public Builder getRequestBuilder() {
- return new Builder();
- }
-
- /**
- * @return the URI as a String instance
- */
- @Override
- public String toString() {
- return u.toString();
- }
-
- /**
- * Returns a hash code for this <code>WebResource</code>.
- * <p>
- * The hash code is the hash code of URI of this
- * <code>WebResource</code>.
- *
- * @return a hash code for this <code>WebResource</code>.
- */
- @Override
- public int hashCode() {
- return u.hashCode();
- }
-
- /**
- * Compares this resource to the specified object.
- * <p>
- * The result is true if and only if the argument is not null and is a
- * <code>WebResource</code> object whose URI is equal to the URI of this
- * <code>WebResource</code>.
- *
- * @param obj the object to compare this <code>WebResource</code> against.
- * @return true if the <code>WebResource</code> are equal; false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) return true;
-
- if (obj instanceof WebResource) {
- final WebResource that = (WebResource) obj;
- return that.u.equals(this.u);
- }
- return false;
- }
-
- // UniformInterface
-
- @Override
- public ClientResponse head() {
- return getHeadHandler().handle(new ClientRequestImpl(getURI(), "HEAD"));
- }
-
- @Override
- public <T> T options(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
- @Override
- public <T> T options(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "OPTIONS"));
- }
-
- @Override
- public <T> T get(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "GET"));
- }
-
- @Override
- public <T> T get(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "GET"));
- }
-
- @Override
- public void put() throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), "PUT", null));
- }
-
- @Override
- public void put(Object requestEntity) throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- @Override
- public <T> T put(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- @Override
- public <T> T put(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "PUT"));
- }
-
- @Override
- public <T> T put(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- @Override
- public <T> T put(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "PUT", requestEntity));
- }
-
- @Override
- public void post() throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), "POST"));
- }
-
- @Override
- public void post(Object requestEntity) throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- @Override
- public <T> T post(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "POST"));
- }
-
- @Override
- public <T> T post(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "POST"));
- }
-
- @Override
- public <T> T post(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- @Override
- public <T> T post(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "POST", requestEntity));
- }
-
- @Override
- public void delete() throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- @Override
- public void delete(Object requestEntity) throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- @Override
- public <T> T delete(Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- @Override
- public <T> T delete(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "DELETE"));
- }
-
- @Override
- public <T> T delete(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- @Override
- public <T> T delete(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), "DELETE", requestEntity));
- }
-
- @Override
- public void method(String method) throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), method));
- }
-
- @Override
- public void method(String method, Object requestEntity) throws UniformInterfaceException {
- voidHandle(new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- @Override
- public <T> T method(String method, Class<T> c) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), method));
- }
-
- @Override
- public <T> T method(String method, GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), method));
- }
-
- @Override
- public <T> T method(String method, Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- @Override
- public <T> T method(String method, GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, new ClientRequestImpl(getURI(), method, requestEntity));
- }
-
- // RequestBuilder<WebResource.Builder>
-
- @Override
- public Builder entity(Object entity) {
- return getRequestBuilder().entity(entity);
- }
-
- @Override
- public Builder entity(Object entity, MediaType type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- @Override
- public Builder entity(Object entity, String type) {
- return getRequestBuilder().entity(entity, type);
- }
-
- @Override
- public Builder type(MediaType type) {
- return getRequestBuilder().type(type);
- }
-
- @Override
- public Builder type(String type) {
- return getRequestBuilder().type(type);
- }
-
- @Override
- public Builder accept(MediaType... types) {
- return getRequestBuilder().accept(types);
- }
-
- @Override
- public Builder accept(String... types) {
- return getRequestBuilder().accept(types);
- }
-
- @Override
- public Builder acceptLanguage(Locale... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- @Override
- public Builder acceptLanguage(String... locales) {
- return getRequestBuilder().acceptLanguage(locales);
- }
-
- @Override
- public Builder cookie(Cookie cookie) {
- return getRequestBuilder().cookie(cookie);
- }
-
- @Override
- public Builder header(String name, Object value) {
- return getRequestBuilder().header(name, value);
- }
-
- // URI specific building
-
- /**
- * Create a new WebResource from this web resource with an additional path
- * added to the URI of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param path the additional path.
- *
- * @return the new web resource.
- */
- public WebResource path(String path) {
- return new WebResource(this, getUriBuilder().path(path));
- }
-
- /**
- * Create a new WebResource from this web resource.
- * <p>
- * If the URI contains a path component and the path starts with a '/' then
- * the path of this web resource URI is replaced. Otherwise the path is
- * appended.
- * <p>
- * If the URI contains query parameters then those query parameters will
- * replace the query parameters (if any) of this web resource.
- * <p>
- * Any filters on this web resource are inherited. Removal of filters
- * may cause undefined behaviour.
- *
- * @param uri the URI.
- * @return the new web resource.
- */
- public WebResource uri(URI uri) {
- UriBuilder b = getUriBuilder();
- String path = uri.getRawPath();
- if (path != null && path.length() > 0) {
- if (path.startsWith("/")) {
- b.replacePath(path);
- } else {
- b.path(path);
- }
- }
- String query = uri.getRawQuery();
- if (query != null && query.length() > 0) {
- b.replaceQuery(query);
- }
- return new WebResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with an additional
- * query parameter added to the URI of this web resource.
- *
- * @param key the query parameter name
- * @param value the query parameter value
- * @return the new web resource.
- */
- public WebResource queryParam(String key, String value) {
- UriBuilder b = getUriBuilder();
- b.queryParam(key, value);
- return new WebResource(this, b);
- }
-
- /**
- * Create a new WebResource from this web resource with additional
- * query parameters added to the URI of this web resource.
- *
- * @param params the query parameters.
- * @return the new web resource.
- */
- public WebResource queryParams(MultivaluedMap<String, String> params) {
- UriBuilder b = getUriBuilder();
- for (Map.Entry<String, List<String>> e : params.entrySet()) {
- for (String value : e.getValue())
- b.queryParam(e.getKey(), value);
- }
- return new WebResource(this, b);
- }
-
- // Builder that builds client request and handles it
-
- /**
- * The builder for building a {@link ClientRequest} instance and
- * handling the request using the {@link UniformInterface}. The methods
- * of the {@link UniformInterface} are the build methods of the builder.
- */
- public final class Builder extends PartialRequestBuilder<Builder>
- implements UniformInterface {
-
-
- private Builder() {
- }
-
- private ClientRequest build(String method) {
- ClientRequest ro = new ClientRequestImpl(u, method, entity, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- private ClientRequest build(String method, Object e) {
- ClientRequest ro = new ClientRequestImpl(u, method, e, metadata);
- entity = null;
- metadata = null;
- return ro;
- }
-
- // UniformInterface
-
- @Override
- public ClientResponse head() {
- return getHeadHandler().handle(build("HEAD"));
- }
-
- @Override
- public <T> T options(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("OPTIONS"));
- }
-
- @Override
- public <T> T options(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("OPTIONS"));
- }
-
- @Override
- public <T> T get(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("GET"));
- }
-
- @Override
- public <T> T get(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("GET"));
- }
-
- @Override
- public void put() throws UniformInterfaceException {
- voidHandle(build("PUT"));
- }
-
- @Override
- public void put(Object requestEntity) throws UniformInterfaceException {
- voidHandle(build("PUT", requestEntity));
- }
-
- @Override
- public <T> T put(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("PUT"));
- }
-
- @Override
- public <T> T put(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("PUT"));
- }
-
- @Override
- public <T> T put(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build("PUT", requestEntity));
- }
-
- @Override
- public <T> T put(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build("PUT", requestEntity));
- }
-
- @Override
- public void post() throws UniformInterfaceException {
- voidHandle(build("POST"));
- }
-
- @Override
- public void post(Object requestEntity) throws UniformInterfaceException {
- voidHandle(build("POST", requestEntity));
- }
-
- @Override
- public <T> T post(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("POST"));
- }
-
- @Override
- public <T> T post(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("POST"));
- }
-
- @Override
- public <T> T post(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build("POST", requestEntity));
- }
-
- @Override
- public <T> T post(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build("POST", requestEntity));
- }
-
- @Override
- public void delete() throws UniformInterfaceException {
- voidHandle(build("DELETE"));
- }
-
- @Override
- public void delete(Object requestEntity) throws UniformInterfaceException {
- voidHandle(build("DELETE", requestEntity));
- }
-
- @Override
- public <T> T delete(Class<T> c) throws UniformInterfaceException {
- return handle(c, build("DELETE"));
- }
-
- @Override
- public <T> T delete(GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build("DELETE"));
- }
-
- @Override
- public <T> T delete(Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build("DELETE", requestEntity));
- }
-
- @Override
- public <T> T delete(GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build("DELETE", requestEntity));
- }
-
- @Override
- public void method(String method) throws UniformInterfaceException {
- voidHandle(build(method));
- }
-
- @Override
- public void method(String method, Object requestEntity) throws UniformInterfaceException {
- voidHandle(build(method, requestEntity));
- }
-
- @Override
- public <T> T method(String method, Class<T> c) throws UniformInterfaceException {
- return handle(c, build(method));
- }
-
- @Override
- public <T> T method(String method, GenericType<T> gt) throws UniformInterfaceException {
- return handle(gt, build(method));
- }
-
- @Override
- public <T> T method(String method, Class<T> c, Object requestEntity) throws UniformInterfaceException {
- return handle(c, build(method, requestEntity));
- }
-
- @Override
- public <T> T method(String method, GenericType<T> gt, Object requestEntity) throws UniformInterfaceException {
- return handle(gt, build(method, requestEntity));
- }
- }
-
- /**
- * Sets WebResource related property.
- *
- * @param property property identifier.
- * @param value value of given property.
- */
- public void setProperty(String property, Object value) {
- this.getProperties().put(property, value);
- }
-
- /**
- * Gets WebResource related properties.
- *
- * <p>Properties are inherited, so setting properties on "parent" WebResource
- * instance, creating child (for example via WebResource.path("subpath"))
- * will set parents properties on it. However changing child properties
- * won't cause change in parent's properties.
- *
- * <p>Methods entrySet(), keySet() and values() are returning read-only
- * results (via Collection.unmodifiableMap).
- *
- * @return map containing all properties.
- */
- public Map<String, Object> getProperties() {
- if (properties == null) {
- properties = new CopyOnWriteHashMap<String, Object>();
- }
- return properties;
- }
-
- private void setProperties(ClientRequest ro) {
- if (properties != null) {
- ro.setProperties(properties);
- }
- }
-
- private <T> T handle(Class<T> c, ClientRequest ro) throws UniformInterfaceException {
- setProperties(ro);
- ClientResponse r = getHeadHandler().handle(ro);
-
- if (c == ClientResponse.class) return c.cast(r);
-
- if (r.getStatus() < 300) return r.getEntity(c);
-
- throw new UniformInterfaceException(r,
- ro.getPropertyAsFeature(ClientConfig.PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true));
- }
-
- private <T> T handle(GenericType<T> gt, ClientRequest ro) throws UniformInterfaceException {
- setProperties(ro);
- ClientResponse r = getHeadHandler().handle(ro);
-
- if (gt.getRawClass() == ClientResponse.class) return gt.getRawClass().cast(r);
-
- if (r.getStatus() < 300) return r.getEntity(gt);
-
- throw new UniformInterfaceException(r,
- ro.getPropertyAsFeature(ClientConfig.PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true));
- }
-
- private void voidHandle(ClientRequest ro) throws UniformInterfaceException {
- setProperties(ro);
- ClientResponse r = getHeadHandler().handle(ro);
-
- if (r.getStatus() >= 300)
- throw new UniformInterfaceException(r,
- ro.getPropertyAsFeature(ClientConfig.PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true));
-
- r.close();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResourceLinkHeaders.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResourceLinkHeaders.java
deleted file mode 100644
index 45e5510b8dc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/WebResourceLinkHeaders.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client;
-
-import com.sun.jersey.core.header.LinkHeader;
-import com.sun.jersey.core.header.LinkHeaders;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WebResourceLinkHeaders extends LinkHeaders {
-
- private final Client c;
-
- public WebResourceLinkHeaders(Client c, MultivaluedMap<String, String> headers) {
- super(headers);
- this.c = c;
- }
-
- public WebResource resource(String rel) {
- LinkHeader lh = getLink(rel);
- if (lh == null)
- return null;
- return c.resource(lh.getUri());
- }
-
- public ViewResource viewResource(String rel) {
- LinkHeader lh = getLink(rel);
- if (lh == null)
- return null;
- return c.viewResource(lh.getUri());
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/AsyncClientHandler.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/AsyncClientHandler.java
deleted file mode 100644
index f1ceeabf69a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/AsyncClientHandler.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.async;
-
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientResponse;
-import java.util.concurrent.Future;
-
-/**
- * An asynchronous client handler for invoking asynchronous client requests.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface AsyncClientHandler {
-
- /**
- * Invoke an asynchronous client request. This method returns without
- * waiting for the client response.
- *
- * @param r the client request.
- * @param l the future listener to receive a completed Future with the
- * client response.
- * @return a future that may be used to wait until the future completes and
- * obtain the client response state, or cancel the request.
- */
- Future<ClientResponse> handle(ClientRequest r, FutureListener<ClientResponse> l);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/FutureListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/FutureListener.java
deleted file mode 100644
index 6fb7a7e2dad..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/FutureListener.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.async;
-
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-/**
- * A future listener to receive an event when a Future has reached the
- * completed termination state of normal termination, an exception
- * or cancellation.
- *
- * @param <T> the type held by the future.
- * @author Paul.Sandoz@Sun.Com
- */
-public interface FutureListener<T> {
-
- /**
- * Invoked when a Future has reached the completed termination state.
- * <p>
- * The catching of a {@link ExecutionException} when
- * <code>Future.get</code> is invoked may be utilized to determine if the
- * future terminated with an exception. The exception can be obtained
- * by invoking {@link ExecutionException#getCause() }.
- * <p>
- * The catching of a {@link CancellationException} when
- * <code>Future.get</code> is invoked may be utilized to determine if the
- * future terminated with a cancellation.
- *
- * @param f the completed Future. Invocation of {@link Future#isDone() }
- * will return true. Since the future is complete invocation of
- * {@link Future#get() } and {@link Future#get(long, java.util.concurrent.TimeUnit) }
- * will not result in the throwing of an {@link InterruptedException}.
- * @throws InterruptedException this exception is declared so that the
- * developer does not need to catch it when invoking
- * <code>Future.get</code>.
- */
- void onComplete(Future<T> f) throws InterruptedException;
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/ITypeListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/ITypeListener.java
deleted file mode 100644
index 7308abef221..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/ITypeListener.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client.async;
-
-import com.sun.jersey.api.client.GenericType;
-
-
-/**
- * A listener to be implemented by clients that wish to receive callback
- * notification of the completion of requests invoked asynchronously.
- * <p>
- * Developers may wish to extend from the class {@link TypeListener} rather
- * than implement this interface directly.
- *
- * @see TypeListener
- * @param <T> the type of the response.
- */
-public interface ITypeListener<T> extends FutureListener<T> {
-
- /**
- * Get the class of the instance to receive for
- * {@link #onComplete(java.util.concurrent.Future) }.
- *
- * @return the class of the response.
- */
- Class<T> getType();
-
- /**
- * Get the generic type declaring the Java type of the instance to
- * receive for {@link #onComplete(java.util.concurrent.Future) }.
- *
- * @return the generic type of the response. If null then the method
- * {@link #getType() } must not return null. Otherwise, if not null,
- * the type information declared by the generic type takes
- * precedence over the value returned by {@link #getType() }.
- */
- GenericType<T> getGenericType();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/TypeListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/TypeListener.java
deleted file mode 100644
index 976bac4a2a1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/async/TypeListener.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client.async;
-
-import com.sun.jersey.api.client.AsyncUniformInterface;
-import com.sun.jersey.api.client.AsyncWebResource;
-import com.sun.jersey.api.client.GenericType;
-
-/**
- * A listener to be implemented by clients that wish to receive callback
- * notification of the completion of requests invoked asynchronously.
- * <p>
- * This listener is a helper class providing implementions for the methods
- * {@link ITypeListener#getType() } and {@link ITypeListener#getGenericType() }.
- * <p>
- * Instances of this class may be passed to appropriate methods on
- * {@link AsyncWebResource} (or more specifically methods on
- * {@link AsyncUniformInterface}). For example,
- * <blockquote><pre>
- * AsyncWebResource r = ..
- * Future&lt;String&gt; f = r.get(new TypeListener&lt;String&gt;(String.class) {
- * public void onComplete(Future&lt;String&gt; f) throws InterruptedException {
- * try {
- * String s = f.get();
- * } catch (ExecutionException ex) {
- * // Do error processing
- * if (t instanceof UniformInterfaceException) {
- * // Request/response error
- * } else
- * // Error making request e.g. timeout
- * }
- *
- * }
- * }
- * });
- * </pre></blockquote>
- *
- * @param <T> the type of the response.
- */
-public abstract class TypeListener<T> implements ITypeListener<T> {
-
- private final Class<T> type;
-
- private final GenericType<T> genericType;
-
- // TODO
-// public TypeListener() {
-// // determine type or genericType from reflection
-// }
-
- /**
- * Construct a new listener defining the class of the response to receive.
- *
- * @param type the class of the response.
- */
- public TypeListener(Class<T> type) {
- this.type = type;
- this.genericType = null;
- }
-
- /**
- * Construct a new listener defining the generic type of the response to
- * receive.
- *
- * @param genericType the generic type of the response.
- */
- public TypeListener(GenericType<T> genericType) {
- this.type = genericType.getRawClass();
- this.genericType = genericType;
- }
-
- public Class<T> getType() {
- return type;
- }
-
- public GenericType<T> getGenericType() {
- return genericType;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/ClientConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/ClientConfig.java
deleted file mode 100644
index a10293a84f7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/ClientConfig.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.config;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-
-import java.util.Set;
-
-/**
- * The client configuration that declares common property names,
- * features, properties, provider classes and singleton instances that
- * may be used by a {@link Client} instance.
- * <p>
- * An instance of this interface may be passed to the {@link Client} when
- * the client is created as follows:
- * <p>
- * <blockquote><pre>
- * ClientConfig cc = ...
- * Client c = Client.create(cc);
- * </pre></blockquote>
- * The client configuration may be used to register provider classes such
- * as those, for example, that support JAXB with JSON as follows:
- * <blockquote><pre>
- * ClientConfig cc = new DefaultClientConfig();
- * cc.getClasses().add(com.sun.jersey.impl.provider.entity.JSONRootElementProvider.class);
- * Client c = Client.create(cc);
- * </pre></blockquote>
- * Alternatively an implementation of ClientConfig could perform such
- * registration.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ClientConfig extends FeaturesAndProperties {
- /**
- * Redirection property. A value of "true" declares that the client will
- * automatically redirect to the URI declared in 3xx responses.
- *
- * The value MUST be an instance of {@link java.lang.Boolean}.
- * If the property is absent then the default value is "true".
- */
- public static final String PROPERTY_FOLLOW_REDIRECTS =
- "com.sun.jersey.client.property.followRedirects";
-
- /**
- * Read timeout interval property, in milliseconds.
- *
- * The value MUST be an instance of {@link java.lang.Integer}.
- *
- * If the property is absent then the default value is an interval of
- * infinity. A value of zero 0 is equivalent to an interval of
- * infinity
- */
- public static final String PROPERTY_READ_TIMEOUT =
- "com.sun.jersey.client.property.readTimeout";
-
- /**
- * Connect timeout interval property, in milliseconds.
- *
- * The value MUST be an instance of {@link java.lang.Integer}.
- *
- * If the property is absent then the default value is an interval of
- * infinity. A value of 0 is equivalent to an interval of
- * infinity
- */
- public static final String PROPERTY_CONNECT_TIMEOUT =
- "com.sun.jersey.client.property.connectTimeout";
-
- /**
- * Chunked encoding property.
- *
- * The value MUST be an instance of {@link java.lang.Integer}.
- *
- * If the property is absent then chunked encoding will not be used.
- * A value &lt = 0 declares that chunked encoding will be used with
- * the default chunk size. A value &gt 0 declares that chunked encoding
- * will be used with the value as the declared chunk size.
- */
- public static final String PROPERTY_CHUNKED_ENCODING_SIZE =
- "com.sun.jersey.client.property.chunkedEncodingSize";
-
- /**
- * A value of "true" declares that the client will
- * automatically buffer the response entity (if any) and close resources
- * when a UniformInterfaceException is thrown.
- *
- * The value MUST be an instance of {@link java.lang.Boolean}.
- * If the property is absent then the default value is "true".
- */
- public static final String PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION =
- "com.sun.jersey.client.property.bufferResponseEntityOnException";
-
- /**
- * Threadpool size property.
- *
- * The value MUST be an instance of {@link java.lang.Integer}.
- *
- * If the property is absent then threadpool used for async requests will
- * be initialized as default cached threadpool, which creates new thread
- * for every new request, see {@link java.util.concurrent.Executors}. When
- * value bigger than zero is provided, cached threadpool limited to that
- * number of threads will be utilized.
- */
- public static final String PROPERTY_THREADPOOL_SIZE =
- "com.sun.jersey.client.property.threadpoolSize";
-
- /**
- * Get the set of provider classes to be instantiated in the scope
- * of the Client
- * <p>
- * A provider class is a Java class with a {@link javax.ws.rs.ext.Provider}
- * annotation declared on the class that implements a specific service
- * interface.
- *
- * @return the mutable set of provider classes. After initialization of
- * the client modification of this value will have no effect.
- * The returned value shall never be null.
- */
- Set<Class<?>> getClasses();
-
- /**
- * Get the singleton provider instances to be utilized by the client.
- * <p>
- * When the client is initialized the set of provider instances
- * will be combined and take precedence over the instances of provider
- * classes.
- *
- * @return the mutable set of provider instances. After initialization of
- * the client modification of this value will have no effect.
- * The returned value shall never be null.
- */
- public Set<Object> getSingletons();
-
- /**
- * Get a feature that is boolean property of the property bag.
- *
- * @param featureName the name of the feature;
- * @return true if the feature value is present and is an instance of
- * <code>Boolean</code> and that value is true, otherwise false.
- */
- public boolean getPropertyAsFeature(String featureName);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/DefaultClientConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/DefaultClientConfig.java
deleted file mode 100644
index 088ebe6a371..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/DefaultClientConfig.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.config;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A default client configuration.
- * <p>
- * This class may be extended for specific configuration purposes.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class DefaultClientConfig implements ClientConfig {
- private final Set<Class<?>> providers = new LinkedHashSet<Class<?>>();
-
- private final Set<Object> providerInstances = new LinkedHashSet<Object>();
-
- private final Map<String, Boolean> features = new HashMap<String, Boolean>();
-
- private final Map<String, Object> properties = new HashMap<String, Object>();
-
- /**
- * Create a new DefaultClientConfig instance
- *
- */
- public DefaultClientConfig() {}
-
- /**
- * Create a new DefaultClientConfig instance
- *
- * @param providers provider classes used during request processing.
- */
- public DefaultClientConfig(Class<?>... providers) {
- Collections.addAll(this.providers, providers);
- }
-
- /**
- * Create a new DefaultClientConfig instance
- *
- * @param providers set of provider classes used during request processing.
- */
- public DefaultClientConfig(Set<Class<?>> providers) {
- this.providers.addAll(providers);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Set<Class<?>> getClasses() {
- return providers;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Set<Object> getSingletons() {
- return providerInstances;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<String, Boolean> getFeatures() {
- return features;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean getFeature(String featureName) {
- final Boolean v = features.get(featureName);
- return (v != null) ? v : false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<String, Object> getProperties() {
- return properties;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object getProperty(String propertyName) {
- return properties.get(propertyName);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean getPropertyAsFeature(String name) {
- Boolean v = (Boolean)getProperties().get(name);
- return (v != null) ? v : false;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/package-info.java
deleted file mode 100644
index 1f3505dac08..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/config/package-info.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for configuration of a
- * {@link com.sun.jersey.api.client.Client}.
- * <p>
- */
-package com.sun.jersey.api.client.config;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ClientFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ClientFilter.java
deleted file mode 100644
index 6e31a197e7f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ClientFilter.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.ClientHandler;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientResponse;
-
-
-/**
- * A client filter capable of modifying the outbound HTTP request or
- * the inbound HTTP response.
- * <p>
- * An application-based filter extends this class and implements the
- * {@link ClientHandler#handle} method. The general implementation pattern
- * is as follows:
- * <blockquote><pre>
- * class AppClientFilter extends ClientFilter {
- *
- * public ClientResponse handle(ClientRequest cr) {
- * // Modify the request
- * ClientRequest mcr = modifyRequest(cr);
- *
- * // Call the next client handler in the filter chain
- * ClientResponse resp = getNext().handle(mcr);
- *
- * // Modify the response
- * return modifyResponse(resp);
- * }
- *
- * }
- * </pre></blockquote>
- * <p>
- * A client filter is re-entrant and may be called by by more than one thread
- * at the same time.
- * <p>
- * A client filter instance MUST be occur at most once in any {@link Filterable}
- * instance, otherwise unexpected results may occur.
- * If it is necessary to add the same type of client filter more than once
- * to the same {@link Filterable} instance or to more than one {@link Filterable}
- * instance then a new instance of that filter MUST be added.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class ClientFilter implements ClientHandler {
- private ClientHandler next;
-
- /* package */ final void setNext(ClientHandler next) {
- this.next = next;
- }
-
- /**
- * Get the next client handler to invoke in the chain
- * of filters.
- *
- * @return the next client handler.
- */
- public final ClientHandler getNext() {
- return next;
- }
-
- public abstract ClientResponse handle(ClientRequest cr)
- throws ClientHandlerException;
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ConnectionListenerFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ConnectionListenerFilter.java
deleted file mode 100644
index 37fb77a71a8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ConnectionListenerFilter.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.AbstractClientRequestAdapter;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientRequestAdapter;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.core.util.UnmodifiableMultivaluedMap;
-
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URI;
-import java.util.Collections;
-import java.util.Map;
-
-
-
-/**
- * ConnectionListener filter
- *
- * This filter does not modify input/output stream
- *
- *
- * @author pavel.bucek@sun.com
- */
-public class ConnectionListenerFilter extends ClientFilter {
-
- private static final class Adapter extends AbstractClientRequestAdapter {
-
- private final ContainerListener listener;
-
- Adapter(ClientRequestAdapter cra, ContainerListener listener) {
- super(cra);
- this.listener = listener;
- }
-
- public OutputStream adapt(ClientRequest request, OutputStream out) throws IOException {
- return new ReportingOutputStream(getAdapter().adapt(request, out), listener);
- }
- }
-
- private final OnStartConnectionListener listenerFactory;
-
- /**
- * Creates ConnectionListenerFilter.
- *
- * @param listenerFactory {@link OnStartConnectionListener} instance
- *
- */
- public ConnectionListenerFilter(OnStartConnectionListener listenerFactory) {
-
- if (listenerFactory == null) {
- throw new IllegalArgumentException("ConnectionListenerFilter can't be initiated without OnStartConnectionListener");
- }
-
- this.listenerFactory = listenerFactory;
- }
-
- @Override
- public ClientResponse handle(ClientRequest request) throws ClientHandlerException {
-
- // try catch finally block - onFinish() can be called.
-
- ContainerListener listener = listenerFactory.onStart(new ClientRequestContainer(request));
-
- request.setAdapter(new Adapter(request.getAdapter(), listener));
-
- ClientResponse response = getNext().handle(request);
-
- if (response.hasEntity()) {
-
- InputStream entityInputStream = response.getEntityInputStream();
-
- listener.onReceiveStart(response.getLength());
-
- response.setEntityInputStream(new ReportingInputStream(entityInputStream, listener));
-
- } else {
- listener.onFinish();
- }
-
- return response;
- }
-}
-
-class ReportingOutputStream extends OutputStream {
-
- private final OutputStream outputStream;
- private final ContainerListener listener;
- private long totalBytes = 0;
-
- public ReportingOutputStream(OutputStream outputStream, ContainerListener listener) {
- this.outputStream = outputStream;
- this.listener = listener;
- }
-
- private void report(long bytes) {
- totalBytes += bytes;
- listener.onSent(bytes, totalBytes);
- }
-
- @Override
- public void write(byte[] b) throws IOException {
- outputStream.write(b);
- report(b.length);
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- outputStream.write(b, off, len);
- report(len);
- }
-
- @Override
- public void write(int b) throws IOException {
- outputStream.write(b);
- report(1);
- }
-
- @Override
- public void flush() throws IOException {
- outputStream.flush();
- }
-}
-
-
-class ReportingInputStream extends InputStream {
-
- private final InputStream inputStream;
- private final ContainerListener listener;
- private int markPosition = 0;
- private long totalBytes = 0;
-
- private boolean finished = false;
-
- public ReportingInputStream(InputStream inputStream, ContainerListener listener) {
- this.inputStream = inputStream;
- this.listener = listener;
- }
-
- private void report(long bytes) { // return int and call read(*) like: return report(read(...)); ?
- if(bytes == -1) {
- finished = true;
- listener.onFinish();
- } else {
- totalBytes += bytes;
- listener.onReceived(bytes, totalBytes);
- }
- }
-
- @Override
- public int read() throws IOException {
- int readBytes = inputStream.read();
- if(readBytes == -1) {
- report(-1);
- } else {
- report(1);
- }
- return readBytes;
- }
-
- @Override
- public int read(byte[] b) throws IOException {
- int readBytes = inputStream.read(b);
- report(readBytes);
- return readBytes;
- }
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
- int readBytes = inputStream.read(b, off, len);
- report(readBytes);
- return readBytes;
- }
-
- @Override
- public long skip(long n) throws IOException {
- report(n);
- return inputStream.skip(n);
- }
-
- @Override
- public void close() throws IOException {
- if(!finished) listener.onFinish();
- inputStream.close();
- }
-
- @Override
- public synchronized void mark(int readlimit) {
- markPosition = readlimit;
- inputStream.mark(readlimit);
- }
-
- @Override
- public synchronized void reset() throws IOException {
- totalBytes = markPosition;
- inputStream.reset();
- }
-
- @Override
- public boolean markSupported() {
- return inputStream.markSupported();
- }
-
- @Override
- public int available() throws IOException {
- return inputStream.available();
- }
-}
-
-/**
- * Read-only version of ClientRequest
- *
- */
-class ClientRequestContainer extends ClientRequest {
-
- private ClientRequest request;
-
- /* package */ ClientRequestContainer(ClientRequest request) {
- this.request = request;
- }
-
- @Override
- public Map<String, Object> getProperties() {
- if (request.getProperties() != null) {
- return Collections.unmodifiableMap(request.getProperties());
- } else {
- return null;
- }
- }
-
- @Override
- public void setProperties(Map<String, Object> properties) {
- throw new UnsupportedOperationException("Read only instance.");
- }
-
- @Override
- public URI getURI() {
- return request.getURI();
- }
-
- @Override
- public void setURI(URI uri) {
- throw new UnsupportedOperationException("Not supported.");
- }
-
- @Override
- public String getMethod() {
- return request.getMethod();
- }
-
- @Override
- public void setMethod(String method) {
- throw new UnsupportedOperationException("Not supported.");
- }
-
- @Override
- public Object getEntity() {
- return request.getEntity();
- }
-
- @Override
- public void setEntity(Object entity) {
- throw new UnsupportedOperationException("Not supported.");
- }
-
- @Override
- public MultivaluedMap<String, Object> getMetadata() {
- return getHeaders();
- }
-
- /**
- * changing anything in returned multivalued map has to be forbidden
- *
- */
- @Override
- public MultivaluedMap<String, Object> getHeaders() {
- if (request.getHeaders() != null) {
- return new UnmodifiableMultivaluedMap(request.getHeaders());
- } else {
- return null;
- }
- }
-
- @Override
- public ClientRequestAdapter getAdapter() {
- return request.getAdapter();
- }
-
- @Override
- public void setAdapter(ClientRequestAdapter adapter) {
- throw new UnsupportedOperationException("Not supported.");
- }
-
- @Override
- public ClientRequest clone() {
- throw new UnsupportedOperationException("Not supported.");
- }
-}
-
-
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ContainerListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ContainerListener.java
deleted file mode 100644
index d4a027d3a76..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/ContainerListener.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.filter;
-
-/**
- * ContainerListener abstract class
- *
- * @author pavel.bucek@sun.com
- */
-public abstract class ContainerListener {
-
- /**
- * Called when any amount of bytes from request entity is sent.
- *
- * @param delta the number of bytes sent for this event
- * @param bytes the total number of bytes sent so far
- */
- public void onSent(long delta, long bytes) {};
-
- /**
- * Called when receive starts.
- *
- * @param totalBytes entity size in response (taken from http header
- * "Content-Length"; set to -1 if it's missing)
- */
- public void onReceiveStart(long totalBytes) {};
-
- /**
- * Called when any amount of bytes is read from responses entity
- *
- * @param delta the number of bytes received for this event
- * @param bytes the total number of bytes received so far
- */
- public void onReceived(long delta, long bytes) {};
-
- /**
- * Called when last byte of response entity is read or (if entity is not
- * present in response) after sending request.
- *
- */
- public void onFinish() {};
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/Filterable.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/Filterable.java
deleted file mode 100644
index 2dba8e4837b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/Filterable.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.ClientHandler;
-
-
-/**
- * An abstract class providing support for registering and managing a chain
- * of {@link ClientFilter} instances.
- * <p>
- * A {@link ClientFilter} instance MUST be occur at most once in any
- * {@link Filterable} instance, otherwise unexpected results may occur.
- * If it is necessary to add the same type of {@link ClientFilter} more than once
- * to the same {@link Filterable} instance or to more than one {@link Filterable}
- * instance then a new instance of that {@link ClientFilter} MUST be added.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class Filterable {
- private final ClientHandler root;
-
- private ClientHandler head;
-
- /**
- * Construct with a root client handler.
- *
- * @param root the root handler to handle the request and return a response.
- */
- protected Filterable(ClientHandler root) {
- this.root = this.head = root;
- }
-
- /**
- * Construct from an existing filterable instance.
- *
- * @param that the filter to copy.
- */
- protected Filterable(Filterable that) {
- this.root = that.root;
- this.head = that.head;
- }
-
- /**
- * Add a filter to the filter chain.
- *
- * @param f the filter to add.
- */
- public void addFilter(ClientFilter f) {
- f.setNext(head);
- this.head = f;
- }
-
- /**
- * Remove a filter from the chain.
- *
- * @param f the filter to remove.
- */
- public void removeFilter(ClientFilter f) {
- // No filters added
- if (head == root) {
- return;
- }
-
- // Filter is at the head
- if (head == f) {
- head = f.getNext();
- return;
- }
-
- ClientFilter e = (ClientFilter)head;
- while (e.getNext() != f) {
- if (e.getNext() == root) return;
-
- e = (ClientFilter)e.getNext();
- }
-
- e.setNext(f.getNext());
- }
-
- /**
- * Check if a filter is present in the chain.
- *
- * @param f the filter to remove.
- * @return return true if the filter is present, otherwise false.
- */
- public boolean isFilterPreset(ClientFilter f) {
- if (head == root) {
- return false;
- }
-
- if (head == f) {
- return true;
- }
-
- ClientFilter e = (ClientFilter)head;
- while (e.getNext() != f) {
- if (e.getNext() == root) return false;
-
- e = (ClientFilter)e.getNext();
- }
-
- return true;
- }
-
- /**
- * Remove all filters from the filter chain.
- */
- public void removeAllFilters() {
- this.head = root;
- }
-
- /**
- * Get the head client handler of the filter chain.
- *
- * @return the head client handler of the filter chain.
- */
- public ClientHandler getHeadHandler() {
- return head;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.java
deleted file mode 100644
index 6e968be3356..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.AbstractClientRequestAdapter;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientRequestAdapter;
-import com.sun.jersey.api.client.ClientResponse;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-import javax.ws.rs.core.HttpHeaders;
-
-/**
- * A GZIP content encoding filter.
- * <p>
- * The request will be modified to set the Accept-Encoding header to "gzip"
- * if that header has not already been set by the client.
- * <p>
- * If the request contains an entity and a Content-Encoding header of "gzip"
- * then the entity will be compressed using gzip.
- * If configured, and there does not exist a Content-Encoding header of "gzip"
- * then such a header is added to the request and the entity will be compressed
- * using gzip.
- * <p>
- * If the response has a Content-Encoding header of "gzip" then
- * then the response entity will be uncompressed using gzip.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class GZIPContentEncodingFilter extends ClientFilter {
-
- private static final class Adapter extends AbstractClientRequestAdapter {
- Adapter(ClientRequestAdapter cra) {
- super(cra);
- }
-
- public OutputStream adapt(ClientRequest request, OutputStream out) throws IOException {
- return new GZIPOutputStream(getAdapter().adapt(request, out));
- }
- }
-
- private final boolean compressRequestEntity;
-
- /**
- * Create a GZIP Content-Encoding filter that compresses the request
- * entity.
- */
- public GZIPContentEncodingFilter() {
- this(true);
- }
-
- /**
- * Create a GZIP Content-Encoding filter.
- *
- * @param compressRequestEntity if true the request entity (if any)
- * is always compressed, otherwise the request entity is compressed
- * only if there exists a Content-Encoding header whose
- * value is "gzip".
- */
- public GZIPContentEncodingFilter(boolean compressRequestEntity) {
- this.compressRequestEntity = compressRequestEntity;
- }
-
- @Override
- public ClientResponse handle(ClientRequest request) throws ClientHandlerException {
- if (!request.getHeaders().containsKey(HttpHeaders.ACCEPT_ENCODING)) {
- request.getHeaders().add(HttpHeaders.ACCEPT_ENCODING, "gzip");
- }
-
- if (request.getEntity() != null) {
- Object o = request.getHeaders().getFirst(HttpHeaders.CONTENT_ENCODING);
- if (o != null && o.equals("gzip")) {
- request.setAdapter(new Adapter(request.getAdapter()));
- } else if (compressRequestEntity) {
- request.getHeaders().add(HttpHeaders.CONTENT_ENCODING, "gzip");
- request.setAdapter(new Adapter(request.getAdapter()));
- }
- }
-
- ClientResponse response = getNext().handle(request);
-
- if (response.hasEntity() &&
- response.getHeaders().containsKey(HttpHeaders.CONTENT_ENCODING)) {
- String encodings = response.getHeaders().getFirst(HttpHeaders.CONTENT_ENCODING);
-
- if (encodings.equals("gzip")) {
- response.getHeaders().remove(HttpHeaders.CONTENT_ENCODING);
- try {
- response.setEntityInputStream(new GZIPInputStream(response.getEntityInputStream()));
- } catch (IOException ex) {
- throw new ClientHandlerException(ex);
- }
- }
- }
-
- return response;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.java
deleted file mode 100644
index bd59251e1a7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.core.util.Base64;
-import java.io.UnsupportedEncodingException;
-import javax.ws.rs.core.HttpHeaders;
-
-/**
- * Client filter adding HTTP Basic Authentication header to the HTTP request,
- * if no such header is already present
- *
- * @author Jakub.Podlesak@Sun.COM, Craig.McClanahan@Sun.COM
- */
-public final class HTTPBasicAuthFilter extends ClientFilter {
-
- private final String authentication;
-
- /**
- * Creates a new HTTP Basic Authentication filter using provided username
- * and password credentials
- *
- * @param username
- * @param password
- */
- public HTTPBasicAuthFilter(final String username, final String password) {
- try {
- authentication = "Basic " + new String(Base64.encode(username + ":" + password), "ASCII");
- } catch (UnsupportedEncodingException ex) {
- // This should never occur
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public ClientResponse handle(final ClientRequest cr) throws ClientHandlerException {
-
- if (!cr.getMetadata().containsKey(HttpHeaders.AUTHORIZATION)) {
- cr.getMetadata().add(HttpHeaders.AUTHORIZATION, authentication);
- }
- return getNext().handle(cr);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.java
deleted file mode 100644
index ad18b0a2411..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.java
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.ClientResponse.Status;
-
-import javax.ws.rs.core.HttpHeaders;
-import java.security.MessageDigest;
-import java.security.SecureRandom;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Client filter adding HTTP Digest authentication headers in the request
- *
- * @author raphael.jolivet@gmail.com
- */
-public final class HTTPDigestAuthFilter extends ClientFilter {
-
- // -------------------------------------------------------
- // Static constants
- // -------------------------------------------------------
-
- /**
- * Number of bytes use in the random number generated by client
- */
- static private final int CNONCE_NB_BYTES = 4;
-
- /**
- * Init random generator
- */
- static private final SecureRandom randomGenerator;
-
- static {
- try {
- randomGenerator = SecureRandom.getInstance("SHA1PRNG");
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- /**
- * Pattern to parse key value pairs like: 'foobar="foo bar",toto=titi,...'
- */
- static private final Pattern TOKENS_PATTERN = Pattern.compile("(\\w+)\\s*=\\s*(\"([^\"]+)\"|(\\w+))\\s*,?\\s*");
-
- // -------------------------------------------------------
- // Inner enums
- // -------------------------------------------------------
-
- /**
- * Types of "qop"
- */
- private enum QOP {
- AUTH,
- AUTH_INT
- }
-
- // -------------------------------------------------------
- // Attributes
- // -------------------------------------------------------
-
- private final String user;
- private final String pass;
-
- // State
- private class State {
- String nextNonce;
- String realm;
- String opaque;
- String algorithm;
- String domain;
- QOP qop = null;
- int counter = 1;
- }
-
- private final ThreadLocal<State> state = new ThreadLocal<State>() {
- @Override
- protected State initialValue() {
- return new State();
- }
- };
-
-
-
- // -------------------------------------------------------
- // Constructor
- // -------------------------------------------------------
-
- /**
- * Creates a new HTTP Digest Authentication filter using provided username
- * and password credentials
- *
- * @param user
- * @param pass
- */
- public HTTPDigestAuthFilter (
- final String user,
- final String pass) {
- this.user = user;
- this.pass = pass;
- }
-
- // -------------------------------------------------------
- // Private utils
- // -------------------------------------------------------
-
- /**
- * Append 'key="val",' to a buffer
- */
- static private void addKeyVal(
- StringBuffer buffer,
- String key,
- String val,
- boolean withQuotes) {
-
- String quote = (withQuotes) ? "\"" : "";
- buffer.append(
- key + '=' + quote + val + quote + ',');
- }
-
- static private void addKeyVal(
- StringBuffer buffer,
- String key,
- String val) {
- addKeyVal(buffer, key, val, true);
- }
-
- /**
- * Converts array of bytes in hexadecimal format
- */
- private static String convertToHex(byte[] data) {
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < data.length; i++) {
- int halfbyte = (data[i] >>> 4) & 0x0F;
- int two_halfs = 0;
- do {
- if ((0 <= halfbyte) && (halfbyte <= 9))
- buf.append((char) ('0' + halfbyte));
- else
- buf.append((char) ('a' + (halfbyte - 10)));
- halfbyte = data[i] & 0x0F;
- } while (two_halfs++ < 1);
- }
- return buf.toString();
- }
-
- /**
- * Compute md5 hash of a string and returns the hexadecimal representation of it
- */
- static String MD5(String text) {
- try {
- MessageDigest md;
- md = MessageDigest.getInstance("MD5");
- md.update(text.getBytes("iso-8859-1"), 0, text.length());
- byte[] md5hash = md.digest();
- String result = convertToHex(md5hash);
- return result;
- } catch (Exception e) {
- throw new Error(e);
- }
- }
-
- /**
- * Concatenate the strings with ':' and then pass it to md5
- */
- static String concatMD5(String... vals) {
-
- // Loop on vals : populate a buffer
- StringBuffer buff = new StringBuffer();
- for (String val : vals) {
- buff.append(val);
- buff.append(':');
- } // End of loop on vals
-
- // Remove last separator
- buff.deleteCharAt(buff.length() - 1);
-
- return MD5(buff.toString());
- }
-
-
- /**
- * Generate a random sequence of bytes and return it hexadecimal representation
- */
- String randHexBytes(int nbBytes) {
-
- // Init array of bytes
- byte[] bytes = new byte[nbBytes];
-
- // Fill it with randomness
- randomGenerator.nextBytes(bytes);
-
- // Transform to Hexa
- return convertToHex(bytes);
-
- }
-
- /**
- * Parse the "authenticate" header of the server response.
- * Key/Value pairs are filled.
- * If several schemes are found, only the DIGEST one is returned.
- * If no www-authenticate field is found with the "Digest" scheme, null is returned
- *
- * @param lines All www-authenticate lines of the header.
- */
- static HashMap<String, String> parseHeaders(Collection<String> lines) {
-
- // Loop on lines
- for (String line : lines) {
-
- // Split spaces
- String[] parts = line.trim().split("\\s+", 2);
-
- // There should be 2 parts
- if (parts.length != 2) continue;
-
- // Check the scheme
- if (!parts[0].toLowerCase().equals("digest")) continue;
-
- // Parse the tokens
- Matcher match = TOKENS_PATTERN.matcher(parts[1]);
-
- // Create map
- HashMap<String, String> result = new HashMap<String, String>();
-
- // Find next pair
- while (match.find()) {
-
- // Defensive check, we should have 4 groups (key)=("(val)" | (val))
- int nbGroups = match.groupCount();
- if (nbGroups != 4) continue;
-
- // Key without quotes
- String key = match.group(1);
- String valNoQuotes = match.group(3);
- String valQuotes = match.group(4);
-
- // Put pairs in maps
- result.put(
- key,
- (valNoQuotes == null) ? valQuotes : valNoQuotes);
-
- } // End of loop on pairs
-
- return result;
-
- } // End of loop on lines
-
- // No line with scheme "digest" found
- return null;
- }
-
- // -------------------------------------------------------
- // Main filter method
- // -------------------------------------------------------
-
- @Override
- public ClientResponse handle(final ClientRequest request) throws ClientHandlerException {
-
- // Remember if we sent a request a with headers
- boolean reqHadAuthHeaders = false;
-
- // Have we already login ? : Then add authorization info to the headers
- if (state.get().nextNonce != null) {
-
- // Remember we sent headers
- reqHadAuthHeaders = true;
-
- // Alias to string representation of qop
- String qopStr = null;
- if (state.get().qop != null) qopStr = (state.get().qop == QOP.AUTH_INT) ? "auth-int" : "auth";
-
- // Init the value of the "authorized" header
- StringBuffer buff = new StringBuffer();
-
- // Authorization scheme
- buff.append("Digest ");
-
- // Key/val pairs
- addKeyVal(buff, "username", this.user);
- addKeyVal(buff, "realm", state.get().realm);
- addKeyVal(buff, "nonce", state.get().nextNonce);
- if (state.get().opaque != null) addKeyVal(buff, "opaque", state.get().opaque);
- if (state.get().algorithm != null) addKeyVal(buff, "algorithm", state.get().algorithm, false);
- if (state.get().qop != null) addKeyVal(buff, "qop", qopStr, false);
- //if (this.domain != null) addKeyVal(buff, "domain", this.domain);
-
- // -------------------------------------------------------
- // Compute the Digest Hash
- // -------------------------------------------------------
-
- // HA1
- String HA1 = concatMD5(
- this.user,
- state.get().realm,
- this.pass);
-
- // Get exact requested URI
- String uri = request.getURI().getPath();
-
-
- // Repeat URI in header
- addKeyVal(buff, "uri", uri);
-
- // HA2 : Switch on qop
- String HA2;
- if (state.get().qop == QOP.AUTH_INT && (request.getEntity() != null)) {
- HA2 = concatMD5(
- request.getMethod(),
- uri,
- request.getEntity().toString());
- } else {
- HA2 = concatMD5(
- request.getMethod(),
- uri);
- }
-
- // Compute response
- String response;
- if (state.get().qop == null) { // Simple response
-
- response = concatMD5(
- HA1,
- state.get().nextNonce,
- HA2);
-
- } else { // Quality of protection is set
-
- // Generate client nonce (UID)
- String cnonce = randHexBytes(CNONCE_NB_BYTES);
-
- // Counter in hexadecimal
- String nc = String.format("%08x", state.get().counter);
- state.get().counter += 1;
-
- // Add them to key/value pairs
- addKeyVal(buff, "cnonce", cnonce);
- addKeyVal(buff, "nc", nc, false);
-
- response = concatMD5(
- HA1,
- state.get().nextNonce,
- nc,
- cnonce,
- qopStr,
- HA2);
- }
-
- // Append the response
- addKeyVal(buff, "response", response);
-
- // Remove the last coma
- buff.deleteCharAt(buff.length() - 1);
- String authLine = buff.toString();
-
- // Add the whole Authoriation line to the header
- request.getHeaders().add(
- HttpHeaders.AUTHORIZATION,
- authLine);
-
- } // End of "we already logged in ?"
-
- // Forward the request to the next filter and get the result back
- ClientResponse response = getNext().handle(request);
-
- // The server asked for authentication ? (status 401)
- if (response.getClientResponseStatus() == Status.UNAUTHORIZED) {
-
- // Parse the www-authentication headers
- HashMap<String, String> map = parseHeaders(
- response.getHeaders().get(
- HttpHeaders.WWW_AUTHENTICATE));
-
- // No digest authentication request found ? => We can do nothing more
- if (map == null) return response;
-
- // Get header values
- state.get().realm = map.get("realm");
- state.get().nextNonce = map.get("nonce");
- state.get().opaque = map.get("opaque");
- state.get().algorithm = map.get("algorithm");
- state.get().domain = map.get("domain");
-
- // Parse Qop
- String qop = map.get("qop");
- if (qop == null) {
- state.get().qop = null;
- } else {
- if (qop.contains("auth-int")) {
- state.get().qop = QOP.AUTH_INT;
- } else if (qop.contains("auth")) {
- state.get().qop = QOP.AUTH;
- } else {
- state.get().qop = null;
- }
- }
-
- // Parse "stale"
- String staleStr = map.get("stale");
-
-
- boolean stale = (staleStr != null) && staleStr.toLowerCase().equals("true");
-
- // Did we send the initial request without headers ?
- // Or the server asked to retry with new nonce ?
- if (stale || !reqHadAuthHeaders) {
- // Then try to resent same request with updated headers
- return this.handle(request);
- } else {
- // We already tried to log, but the authentication failed :
- // Just forward this response
- return response;
- }
- }
-
- // Not 401 status : no authentication issue
- return response;
-
- } // End of #handle()
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/LoggingFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/LoggingFilter.java
deleted file mode 100644
index 3d8163f1e72..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/LoggingFilter.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.AbstractClientRequestAdapter;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientRequestAdapter;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.core.util.ReaderWriter;
-
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-/**
- * A logging filter.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class LoggingFilter extends ClientFilter {
-
- private static final Logger LOGGER = Logger.getLogger(LoggingFilter.class.getName());
-
- private static final String NOTIFICATION_PREFIX = "* ";
-
- private static final String REQUEST_PREFIX = "> ";
-
- private static final String RESPONSE_PREFIX = "< ";
-
- private final class Adapter extends AbstractClientRequestAdapter {
- private final StringBuilder b;
-
- Adapter(ClientRequestAdapter cra, StringBuilder b) {
- super(cra);
- this.b = b;
- }
-
- public OutputStream adapt(ClientRequest request, OutputStream out) throws IOException {
- return new LoggingOutputStream(getAdapter().adapt(request, out), b);
- }
-
- }
-
- private final class LoggingOutputStream extends OutputStream {
- private final OutputStream out;
-
- private final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
- private final StringBuilder b;
-
- LoggingOutputStream(OutputStream out, StringBuilder b) {
- this.out = out;
- this.b = b;
- }
-
- @Override
- public void write(byte[] b) throws IOException {
- baos.write(b);
- out.write(b);
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- baos.write(b, off, len);
- out.write(b, off, len);
- }
-
- @Override
- public void write(int b) throws IOException {
- baos.write(b);
- out.write(b);
- }
-
- @Override
- public void close() throws IOException {
- printEntity(b, baos.toByteArray());
- log(b);
- out.close();
- }
- }
-
- private final PrintStream loggingStream;
-
- private final Logger logger;
-
- private long _id = 0;
-
- /**
- * Create a logging filter logging the request and response to
- * a default JDK logger, named as the fully qualified class name of this
- * class.
- */
- public LoggingFilter() {
- this(LOGGER);
- }
-
- /**
- * Create a logging filter logging the request and response to
- * a JDK logger.
- *
- * @param logger the logger to log requests and responses.
- */
- public LoggingFilter(Logger logger) {
- this.loggingStream = null;
- this.logger = logger;
- }
-
- /**
- * Create a logging filter logging the request and response to
- * print stream.
- *
- * @param loggingStream the print stream to log requests and responses.
- */
- public LoggingFilter(PrintStream loggingStream) {
- this.loggingStream = loggingStream;
- this.logger = null;
- }
-
- private void log(StringBuilder b) {
- if (logger != null) {
- logger.info(b.toString());
- } else {
- loggingStream.print(b);
- }
- }
-
- private StringBuilder prefixId(StringBuilder b, long id) {
- b.append(Long.toString(id)).append(" ");
- return b;
- }
-
- @Override
- public ClientResponse handle(ClientRequest request) throws ClientHandlerException {
- long id = ++this._id;
-
- logRequest(id, request);
-
- ClientResponse response = getNext().handle(request);
-
- logResponse(id, response);
-
- return response;
- }
-
- private void logRequest(long id, ClientRequest request) {
- StringBuilder b = new StringBuilder();
-
- printRequestLine(b, id, request);
- printRequestHeaders(b, id, request.getHeaders());
-
- if (request.getEntity() != null) {
- request.setAdapter(new Adapter(request.getAdapter(), b));
- } else {
- log(b);
- }
- }
-
- private void printRequestLine(StringBuilder b, long id, ClientRequest request) {
- prefixId(b, id).append(NOTIFICATION_PREFIX).append("Client out-bound request").append("\n");
- prefixId(b, id).append(REQUEST_PREFIX).append(request.getMethod()).append(" ").
- append(request.getURI().toASCIIString()).append("\n");
- }
-
- private void printRequestHeaders(StringBuilder b, long id, MultivaluedMap<String, Object> headers) {
- for (Map.Entry<String, List<Object>> e : headers.entrySet()) {
- List<Object> val = e.getValue();
- String header = e.getKey();
-
- if(val.size() == 1) {
- prefixId(b, id).append(REQUEST_PREFIX).append(header).append(": ").append(ClientRequest.getHeaderValue(val.get(0))).append("\n");
- } else {
- StringBuilder sb = new StringBuilder();
- boolean add = false;
- for(Object o : val) {
- if(add) sb.append(',');
- add = true;
- sb.append(ClientRequest.getHeaderValue(o));
- }
- prefixId(b, id).append(REQUEST_PREFIX).append(header).append(": ").append(sb.toString()).append("\n");
- }
- }
- }
-
- private void logResponse(long id, ClientResponse response) {
- StringBuilder b = new StringBuilder();
-
- printResponseLine(b, id, response);
- printResponseHeaders(b, id, response.getHeaders());
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- InputStream in = response.getEntityInputStream();
- try {
- ReaderWriter.writeTo(in, out);
-
- byte[] requestEntity = out.toByteArray();
- printEntity(b, requestEntity);
- response.setEntityInputStream(new ByteArrayInputStream(requestEntity));
- } catch (IOException ex) {
- throw new ClientHandlerException(ex);
- }
- log(b);
- }
-
- private void printResponseLine(StringBuilder b, long id, ClientResponse response) {
- prefixId(b, id).append(NOTIFICATION_PREFIX).
- append("Client in-bound response").append("\n");
- prefixId(b, id).append(RESPONSE_PREFIX).
- append(Integer.toString(response.getStatus())).
- append("\n");
- }
-
- private void printResponseHeaders(StringBuilder b, long id, MultivaluedMap<String, String> headers) {
- for (Map.Entry<String, List<String>> e : headers.entrySet()) {
- String header = e.getKey();
- for (String value : e.getValue()) {
- prefixId(b, id).append(RESPONSE_PREFIX).append(header).append(": ").
- append(value).append("\n");
- }
- }
- prefixId(b, id).append(RESPONSE_PREFIX).append("\n");
- }
-
- private void printEntity(StringBuilder b, byte[] entity) throws IOException {
- if (entity.length == 0)
- return;
- b.append(new String(entity)).append("\n");
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/OnStartConnectionListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/OnStartConnectionListener.java
deleted file mode 100644
index 96801eb0c92..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/OnStartConnectionListener.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.client.filter;
-
-import com.sun.jersey.api.client.ClientRequest;
-
-/**
- *
- * @author pavel.bucek@sun.com
- */
-public interface OnStartConnectionListener {
-
- /**
- * Factory method for ContainerListener.
- *
- * @param cr read-only copy of ClientRequest
- * @return ContainerListener instance
- */
- public ContainerListener onStart(ClientRequest cr);
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/package-info.java
deleted file mode 100644
index 254832b9599..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/filter/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for client filter chains and filters.
- */
-package com.sun.jersey.api.client.filter;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/client/package-info.java
deleted file mode 100644
index f06df656b9d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/client/package-info.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for client-side communication with HTTP-based
- * RESTful Web services.
- * <p>
- * The client API is high-level API that reuses many aspects of the JAX-RS
- * API. It is designed to be quick, easy to use and is especially useful
- * and productive when developing tests for Web services.
- * <p>
- * The client API can be used as follows to make simple GET and POST requests
- * to a Web resource:
- * <blockquote><pre>
- * Client c = Client.create();
- * WebResource r = c.resource("http://host/base");
- * String s = r.get(String.class);
- * s = r.post(String.class, s);
- * </pre></blockquote>
- * <p>
- * A key concept of REST is the uniform interface and this is encapsulated in
- * the {@link com.sun.jersey.api.client.WebResource} class, which implements
- * {@link com.sun.jersey.api.client.UniformInterface}.
- * A request is built up and when the corresponding HTTP method on the
- * {@link com.sun.jersey.api.client.UniformInterface} is invoked the request
- * is sent to the Web resource and the returned response is processed. This enables
- * efficient production of requests as follows:
- * <blockquote><pre>
- * WebResource r = ...
- * String s = r.accept("application/xml").get(String.class);
- * s = r.accept("application/xml").type("application/xml").post(String.class, s);
- * </pre></blockquote>
- * In the above example a GET request occurs stating that the
- * "application/xml" is acceptable. After that a POST request occurs stating
- * the same acceptable media type and that the content type of the request entity is
- * "application/xml".
- * <p>
- * The Java types that may be used for request and response entities are not
- * restricted to <code>String</code>. The client API reuses the same infrastrucure
- * as JAX-RS server-side. Thus the same types that can be used on the server-side
- * can also be used on the client-side, such as JAXB-based types. Further more
- * the supported Java types can be extended by implementing
- * {@link javax.ws.rs.ext.MessageBodyReader} and
- * {@link javax.ws.rs.ext.MessageBodyWriter}. For registration of such support
- * for new Java types see
- * {@link com.sun.jersey.api.client.config.ClientConfig}.
- * <p>
- * A type of {@link com.sun.jersey.api.client.ClientResponse} declared
- * for the response entity may be used to obtain the status, headers and
- * response entity.
- * <p>
- * If any type, other than {@link com.sun.jersey.api.client.ClientResponse},
- * is declared and the response status is greater than or equal to 300 then a
- * {@link com.sun.jersey.api.client.UniformInterfaceException} exception
- * will be thrown, from which the
- * {@link com.sun.jersey.api.client.ClientResponse} instance can be
- * accessed.
- * <p>
- * In the following cases it is necessary to close the response, when response
- * processing has completed, to ensure that underlying resources are
- * correctly released.
- * <p>
- * If a response entity is declared of the type
- * {@link com.sun.jersey.api.client.ClientResponse}
- * or of a type that is assignable to {@link java.io.Closeable}
- * (such as {@link java.io.InputStream}) then the response must be either:
- * 1) closed by invoking the method
- * {@link com.sun.jersey.api.client.ClientResponse#close() } or
- * {@link java.io.Closeable#close}; or 2) all bytes of response entity must be
- * read.
- * <p>
- * If a {@link com.sun.jersey.api.client.UniformInterfaceException} is
- * thrown then by default the response entity is automatically buffered and
- * the underlying resources are correctly released. See the following property
- * for more details:
- * {@link com.sun.jersey.api.client.config.ClientConfig#PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION}.
- *
- */
-package com.sun.jersey.api.client; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerException.java
deleted file mode 100644
index 756679b1d9c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerException.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.container;
-
-/**
- * Runtime exception to be caught by the container.
- * <p>
- * This exception may be thrown by the application signaling that the
- * container should handle the exception to produce an appropriate HTTP response.
- * <p>
- * This exception may also be thrown by the runtime if an exception
- * occurs that should be handled by the container.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ContainerException extends RuntimeException {
-
- /**
- * Construct a new instance with the supplied message
- */
- public ContainerException() {
- super();
- }
-
- /**
- * Construct a new instance with the supplied message
- * @param message the message
- */
- public ContainerException(String message) {
- super(message);
- }
-
- /**
- * Construct a new instance with the supplied message and cause
- * @param message the message
- * @param cause the Throwable that caused the exception to be thrown
- */
- public ContainerException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Construct a new instance with the supplied cause
- * @param cause the Throwable that caused the exception to be thrown
- */
- public ContainerException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerFactory.java
deleted file mode 100644
index dec5c4ce6eb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/ContainerFactory.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.container;
-
-import com.sun.jersey.api.core.DefaultResourceConfig;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.core.ClasspathResourceConfig;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.spi.container.ContainerProvider;
-import com.sun.jersey.spi.container.ContainerListener;
-import com.sun.jersey.spi.container.ContainerNotifier;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.container.WebApplicationFactory;
-import com.sun.jersey.spi.service.ServiceFinder;
-import java.io.File;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Factory for creating specific HTTP-based containers.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ContainerFactory {
-
- private ContainerFactory() {
- }
-
- /**
- * Create a container according to the class requested.
- * <p>
- * The list of service-provider supporting the {@link ContainerProvider}
- * service-provider will be iterated over until one returns a non-null
- * container instance.
- * <p>
- * @param <A> the type of the container.
- * @param type the type of the container.
- * @param resourceClasses the list of Web resources to be managed by the
- * Web application.
- * @return the container.
- * @throws ContainerException if there is an error creating the container.
- * @throws IllegalArgumentException if no container provider supports the type.
- */
- @SuppressWarnings("unchecked")
- public static <A> A createContainer(Class<A> type, Class<?>... resourceClasses)
- throws ContainerException, IllegalArgumentException {
- Set<Class<?>> resourceClassesSet = new HashSet<Class<?>>(
- Arrays.asList(resourceClasses));
-
- return createContainer(type, new DefaultResourceConfig(resourceClassesSet),
- null);
- }
-
- /**
- * Create a container according to the class requested.
- * <p>
- * The list of service-provider supporting the {@link ContainerProvider}
- * service-provider will be iterated over until one returns a non-null
- * container instance.
- * <p>
- * @param <A> the type of the container.
- * @param type the type of the container.
- * @param resourceClasses the set of Web resources to be managed by the
- * Web application.
- * @return the container.
- * @throws ContainerException if there is an error creating the container.
- * @throws IllegalArgumentException if no container provider supports the type.
- */
- @SuppressWarnings("unchecked")
- public static <A> A createContainer(Class<A> type, Set<Class<?>> resourceClasses)
- throws ContainerException, IllegalArgumentException {
- return createContainer(type, new DefaultResourceConfig(resourceClasses),
- null);
- }
-
- /**
- * Create a container according to the class requested.
- * <p>
- * The list of service-provider supporting the {@link ContainerProvider}
- * service-provider will be iterated over until one returns a non-null
- * container instance.
- * <p>
- * @param <A> the type of the container.
- * @param type the type of the container.
- * @param resourceConfig the resource configuration containing the set
- * of Web resources to be managed by the Web application.
- * @return the container.
- * @throws ContainerException if there is an error creating the container.
- * @throws IllegalArgumentException if no container provider supports the type.
- */
- public static <A> A createContainer(Class<A> type, ResourceConfig resourceConfig)
- throws ContainerException, IllegalArgumentException {
- return createContainer(type, resourceConfig, null);
- }
-
- /**
- * Create a container according to the class requested.
- * <p>
- * The list of service-provider supporting the {@link ContainerProvider}
- * service-provider will be iterated over until one returns a non-null
- * container instance.
- * <p>
- * @param <A> the type of the container.
- * @param type the type of the container.
- * @param resourceConfig the resource configuration containing the set
- * of Web resources to be managed by the Web application.
- * @param factory the IoC component provider factory the web application
- * delegates to for obtaining instances of resource and provider
- * classes. May be null if the web application is responsible for
- * instantiating resource and provider classes.
- * @return the container.
- * @throws ContainerException if there is an error creating the container.
- * @throws IllegalArgumentException if no container provider supports the type.
- */
- @SuppressWarnings("unchecked")
- public static <A> A createContainer(Class<A> type, ResourceConfig resourceConfig,
- IoCComponentProviderFactory factory)
- throws ContainerException, IllegalArgumentException {
- WebApplication wa = WebApplicationFactory.createWebApplication();
-
- // Reverse the order so that applications may override
- LinkedList<ContainerProvider> cps = new LinkedList<ContainerProvider>();
- for (ContainerProvider cp : ServiceFinder.find(ContainerProvider.class, true))
- cps.addFirst(cp);
-
- for (ContainerProvider<A> cp : cps) {
- A c = cp.createContainer(type, resourceConfig, wa);
- if (c != null) {
- // Initiate the web application
- if (!wa.isInitiated()) {
- wa.initiate(resourceConfig, factory);
- }
-
- // Register a container listener
- Object o = resourceConfig.getProperties().get(
- ResourceConfig.PROPERTY_CONTAINER_NOTIFIER);
- if (o instanceof List) {
- List list = (List) o;
- for (Object elem : list) {
- if (elem instanceof ContainerNotifier &&
- c instanceof ContainerListener) {
- ContainerNotifier crf = (ContainerNotifier) elem;
- crf.addListener((ContainerListener) c);
- }
- }
- } else if (o instanceof ContainerNotifier &&
- c instanceof ContainerListener) {
- ContainerNotifier crf = (ContainerNotifier) o;
- crf.addListener((ContainerListener) c);
- }
- return c;
- }
- }
-
- throw new IllegalArgumentException("No container provider supports the type " + type);
- }
-
- /**
- * Create an instance of a container according to the class requested.
- *
- * @param <A> the type of the container.
- * @param type the type of the container.
- * @param packageName the name of the package where to find the resource configuration
- * class.
- * @return the HTTP handler, if a handler could not be created then null is
- * returned.
- * @throws ContainerException if the resource configuration class could not
- * be found and instantiated or there is an error creating the container.
- * @throws IllegalArgumentException if no container provider supports the type.
- * @deprecated
- */
- @Deprecated
- @SuppressWarnings("unchecked")
- public static <A> A createContainer(Class<A> type, String packageName)
- throws ContainerException, IllegalArgumentException {
- String resourcesClassName = packageName + ".WebResources";
- try {
- Class<?> resourcesClass = ContainerFactory.class.getClassLoader().loadClass(resourcesClassName);
- ResourceConfig config = (ResourceConfig) resourcesClass.newInstance();
- return createContainer(type, config, null);
- } catch (ClassNotFoundException e) {
- throw new ContainerException(e);
- } catch (InstantiationException e) {
- throw new ContainerException(e);
- } catch (IllegalAccessException e) {
- throw new ContainerException(e);
- }
- }
-
- /**
- * Create an instance of a container according to the class requested.
- * <p>
- * All java classpath will be scanned for Root Resource Classes.
- * </p>
- * @param <A> the type of the container.
- * @param type the type of the container.
- *
- * @return the HTTP handler, if a handler could not be created then null is
- * returned.
- * @throws IllegalArgumentException if no container provider supports the type.
- */
- public static <A> A createContainer(Class<A> type) {
- String classPath = System.getProperty("java.class.path");
- String[] paths = classPath.split(File.pathSeparator);
- return createContainer(type, paths);
- }
-
- /**
- * Create an instance of a container according to the class requested.
- * <p>
- * Root Resource Classes will be scanned in paths.
- * </p>
- * @param <A> the type of the container.
- * @param type the type of the container.
- * @param paths a list of paths to be scanned for resource classes.
- *
- * @return the HTTP handler, if a handler could not be created then null is
- * returned.
- * @throws IllegalArgumentException if no container provider supports the type.
- */
- public static <A> A createContainer(Class<A> type, String... paths) {
- ClasspathResourceConfig config = new ClasspathResourceConfig(paths);
- return createContainer(type, config, null);
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/MappableContainerException.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/MappableContainerException.java
deleted file mode 100644
index 00e4471afcd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/MappableContainerException.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container;
-
-/**
- * A runtime exception that contains a cause, a checked or runtime exception,
- * that may be mapped to a {@link javax.ws.rs.core.Response} instance.
- * <p>
- * The runtime will catch such exceptions and attempt to map the cause
- * exception to a registered {@link javax.ws.rs.ext.ExceptionMapper} that
- * provides an appropriate {@link javax.ws.rs.core.Response} instance.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class MappableContainerException extends ContainerException {
-
- /**
- * @param cause the cause. If the cause is an instance of
- * {@link MappableContainerException} then the cause of this exception
- * will be obtained from the cause of that MappableContainerException
- * instance, and the process will repeat until a cause is obtained
- * that is not an instance of MappableContainerException.
- */
- public MappableContainerException(Throwable cause) {
- super(strip(cause));
- }
-
- private static Throwable strip(Throwable cause) {
- if (cause instanceof MappableContainerException) {
- do {
- MappableContainerException mce = (MappableContainerException)cause;
- cause = mce.getCause();
- } while (cause instanceof MappableContainerException);
- }
-
- return cause;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.java
deleted file mode 100644
index a46387518fb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container.filter;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.container.ContainerResponseWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
-import javax.ws.rs.core.HttpHeaders;
-
-/**
- * A GZIP content encoding filter.
- * <p>
- * If the request contains a Content-Encoding header of "gzip"
- * then the request entity (if any) is uncompressed using gzip.
- * <p>
- * If the request contains a Accept-Encoding header that contains
- * "gzip" then the response entity (if any) is compressed using gzip and a
- * Content-Encoding header of "gzip" is added to the response.
- * <p>
- * When an application is deployed as a Servlet or Filter this Jersey filter can be
- * registered using the following initialization parameters:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerRequestFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.GZIPContentEncodingFilter&lt;/param-value&gt;
- * &lt;/init-param&gt
- * &lt;init-param&gt
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerResponseFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.GZIPContentEncodingFilter&lt;/param-value&gt;
- * &lt;/init-param&gt;
- * </pre></blockquote>
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public class GZIPContentEncodingFilter implements ContainerRequestFilter, ContainerResponseFilter {
-
- public ContainerRequest filter(ContainerRequest request) {
- if (request.getRequestHeaders().containsKey(HttpHeaders.CONTENT_ENCODING)) {
- if (request.getRequestHeaders().getFirst(HttpHeaders.CONTENT_ENCODING).trim().equals("gzip")) {
- request.getRequestHeaders().remove(HttpHeaders.CONTENT_ENCODING);
- try {
- request.setEntityInputStream(
- new GZIPInputStream(request.getEntityInputStream()));
- } catch (IOException ex) {
- throw new ContainerException(ex);
- }
- }
- }
- return request;
- }
-
- private static final class Adapter implements ContainerResponseWriter {
- private final ContainerResponseWriter crw;
-
- private GZIPOutputStream gos;
-
- Adapter(ContainerResponseWriter crw) {
- this.crw = crw;
- }
-
- public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException {
- gos = new GZIPOutputStream(crw.writeStatusAndHeaders(-1, response));
- return gos;
- }
-
- public void finish() throws IOException {
- gos.finish();
- crw.finish();
- }
- }
-
- public ContainerResponse filter(ContainerRequest request, ContainerResponse response) {
- if (response.getEntity() != null &&
- request.getRequestHeaders().containsKey(HttpHeaders.ACCEPT_ENCODING) &&
- !response.getHttpHeaders().containsKey(HttpHeaders.CONTENT_ENCODING)) {
- if (request.getRequestHeaders().getFirst(HttpHeaders.ACCEPT_ENCODING).contains("gzip")) {
- response.getHttpHeaders().add(HttpHeaders.CONTENT_ENCODING, "gzip");
- response.setContainerResponseWriter(
- new Adapter(response.getContainerResponseWriter()));
- }
- }
- return response;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/LoggingFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/LoggingFilter.java
deleted file mode 100644
index b1fc4378145..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/LoggingFilter.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container.filter;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.util.ReaderWriter;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.container.ContainerResponseWriter;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * A logging filter.
- * <p>
- * The request headers, request entity, response headers and response entity
- * will be logged. By default logging will be output to System.out.
- * <p>
- * When an application is deployed as a Servlet or Filter this Jersey filter can be
- * registered using the following initialization parameters:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerRequestFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.LoggingFilter&lt;/param-value&gt;
- * &lt;/init-param&gt
- * &lt;init-param&gt
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerResponseFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.LoggingFilter&lt;/param-value&gt;
- * &lt;/init-param&gt;
- * </pre></blockquote>
- * <p>
- * The logging of entities may be disabled by setting the feature
- * {@link #FEATURE_LOGGING_DISABLE_ENTITY} to true. When an application is
- * deployed as a Servlet or Filter this feature can be
- * registered using the following initialization parameter:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.config.feature.logging.DisableEntitylogging&lt;/param-name&gt;
- * &lt;param-value&gt;true&lt;/param-value&gt;
- * &lt;/init-param&gt
- * </pre></blockquote>
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public class LoggingFilter implements ContainerRequestFilter, ContainerResponseFilter {
- /**
- * If true the request and response entities (if present) will not be logged.
- * If false the request and response entities will be logged.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_LOGGING_DISABLE_ENTITY
- = "com.sun.jersey.config.feature.logging.DisableEntitylogging";
-
- private static final Logger LOGGER = Logger.getLogger(LoggingFilter.class.getName());
-
- private static final String NOTIFICATION_PREFIX = "* ";
-
- private static final String REQUEST_PREFIX = "> ";
-
- private static final String RESPONSE_PREFIX = "< ";
-
- private final Logger logger;
-
- private @Context HttpContext hc;
-
- private @Context ResourceConfig rc;
-
- private long id = 0;
-
- /**
- * Create a logging filter logging the request and response to
- * a default JDK logger, named as the fully qualified class name of this
- * class.
- */
- public LoggingFilter() {
- this(LOGGER);
- }
-
- /**
- * Create a logging filter logging the request and response to
- * a JDK logger.
- *
- * @param logger the logger to log requests and responses.
- */
- public LoggingFilter(Logger logger) {
- this.logger = logger;
- }
-
- private synchronized void setId() {
- if ( hc.getProperties().get("request-id") == null) {
- hc.getProperties().put("request-id", Long.toString(++id));
- }
- }
-
- private StringBuilder prefixId(StringBuilder b) {
- b.append(hc.getProperties().get("request-id").toString()).
- append(" ");
- return b;
- }
-
- public ContainerRequest filter(ContainerRequest request) {
- setId();
-
- final StringBuilder b = new StringBuilder();
- printRequestLine(b, request);
- printRequestHeaders(b, request.getRequestHeaders());
-
- if (rc.getFeature(FEATURE_LOGGING_DISABLE_ENTITY)) {
- logger.info(b.toString());
- return request;
- } else {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- InputStream in = request.getEntityInputStream();
- try {
- if(in.available() > 0) {
- ReaderWriter.writeTo(in, out);
-
- byte[] requestEntity = out.toByteArray();
- printEntity(b, requestEntity);
-
- request.setEntityInputStream(new ByteArrayInputStream(requestEntity));
- }
- return request;
- } catch (IOException ex) {
- throw new ContainerException(ex);
- } finally {
- logger.info(b.toString());
- }
- }
- }
-
- private void printRequestLine(StringBuilder b, ContainerRequest request) {
- prefixId(b).append(NOTIFICATION_PREFIX).append("Server in-bound request").append('\n');
- prefixId(b).append(REQUEST_PREFIX).append(request.getMethod()).append(" ").
- append(request.getRequestUri().toASCIIString()).append('\n');
- }
-
- private void printRequestHeaders(StringBuilder b, MultivaluedMap<String, String> headers) {
- for (Map.Entry<String, List<String>> e : headers.entrySet()) {
- String header = e.getKey();
- for (String value : e.getValue()) {
- prefixId(b).append(REQUEST_PREFIX).append(header).append(": ").
- append(value).append('\n');
- }
- }
- prefixId(b).append(REQUEST_PREFIX).append('\n');
- }
-
- private void printEntity(StringBuilder b, byte[] entity) throws IOException {
- if (entity.length == 0)
- return;
- b.append(new String(entity)).append("\n");
- }
-
- private final class Adapter implements ContainerResponseWriter {
- private final ContainerResponseWriter crw;
-
- private final boolean disableEntity;
-
- private long contentLength;
-
- private ContainerResponse response;
-
- private ByteArrayOutputStream baos;
-
- private StringBuilder b = new StringBuilder();
-
- Adapter(ContainerResponseWriter crw) {
- this.crw = crw;
- this.disableEntity = rc.getFeature(FEATURE_LOGGING_DISABLE_ENTITY);
- }
-
- public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) throws IOException {
- printResponseLine(b, response);
- printResponseHeaders(b, response.getHttpHeaders());
-
- if (disableEntity) {
- logger.info(b.toString());
- return crw.writeStatusAndHeaders(contentLength, response);
- } else {
- this.contentLength = contentLength;
- this.response = response;
- return this.baos = new ByteArrayOutputStream();
- }
- }
-
- public void finish() throws IOException {
- if (!disableEntity) {
- byte[] entity = baos.toByteArray();
- printEntity(b, entity);
-
- // Output to log
- logger.info(b.toString());
-
- // Write out the headers and buffered entity
- OutputStream out = crw.writeStatusAndHeaders(contentLength, response);
- out.write(entity);
- }
- crw.finish();
- }
- }
-
- public ContainerResponse filter(ContainerRequest request, ContainerResponse response) {
- setId();
- response.setContainerResponseWriter(
- new Adapter(response.getContainerResponseWriter()));
- return response;
- }
-
- private void printResponseLine(StringBuilder b, ContainerResponse response) {
- prefixId(b).append(NOTIFICATION_PREFIX).
- append("Server out-bound response").append('\n');
- prefixId(b).append(RESPONSE_PREFIX).append(Integer.toString(response.getStatus())).append('\n');
- }
-
- private void printResponseHeaders(StringBuilder b, MultivaluedMap<String, Object> headers) {
- for (Map.Entry<String, List<Object>> e : headers.entrySet()) {
- String header = e.getKey();
- for (Object value : e.getValue()) {
- prefixId(b).append(RESPONSE_PREFIX).append(header).append(": ").
- append(ContainerResponse.getHeaderValue(value)).append('\n');
- }
- }
- prefixId(b).append(RESPONSE_PREFIX).append('\n');
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/PostReplaceFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/PostReplaceFilter.java
deleted file mode 100644
index af677ca50ec..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/PostReplaceFilter.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container.filter;
-
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-
-/**
- * A filter to support HTTP method replacing of a POST request to a request
- * utilizing another HTTP method for the case where proxies or HTTP
- * servers would otherwise block that HTTP method.
- * <p>
- * This filter may be used to replace a POST request with a PUT or DELETE
- * request.
- * <p>
- * Replacement will occur if the request method is POST and there exists an
- * a request header "X-HTTP-Method-Override" with a non-empty value. That value
- * will be the HTTP method that replaces the POST method.
- * <p>
- * When an application is deployed as a Servlet or Filter this Jersey filter can be
- * registered using the following initialization parameter:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerRequestFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.PostReplaceFilter&lt;/param-value&gt;
- * &lt;/init-param&gt
- * </pre></blockquote>
- * <p>
- * TODO support query parameter for declaring the replacing method.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public class PostReplaceFilter implements ContainerRequestFilter {
-
- public ContainerRequest filter(ContainerRequest request) {
- if (!request.getMethod().equalsIgnoreCase("POST"))
- return request;
-
- String override = request.getRequestHeaders().getFirst("X-HTTP-Method-Override");
- if (override == null)
- return request;
- override = override.trim();
- if (override.length() == 0)
- return request;
-
- request.setMethod(override);
- return request;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.java
deleted file mode 100644
index 97f6b453e72..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.container.filter;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.model.AbstractSubResourceMethod;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.container.ResourceFilter;
-import com.sun.jersey.spi.container.ResourceFilterFactory;
-import java.util.Collections;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.core.Context;
-
-/**
- * A {@link ResourceFilterFactory} provides tracking of resource
- * matching. Every successful match is logged and developers can easily discover
- * which resource / method was matched and see how the request path is being
- * consumed.
- *
- * When an application is deployed as a Servlet or Filter this Jersey resource
- * filter can be registered using the following initialization parameter:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ResourceFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.ResourceDebuggingFilterFactory&lt;/param-value&gt;
- * &lt;/init-param&gt
- * </pre></blockquote>
- *
- * @author pavel.bucek@sun.com
- * @see com.sun.jersey.api.container.filter
- */
-public class ResourceDebuggingFilterFactory implements ResourceFilterFactory {
-
- private final HttpContext context;
-
- public ResourceDebuggingFilterFactory(@Context HttpContext hc) {
- this.context = hc;
- }
-
- abstract class AbstractRequestFilter implements ResourceFilter, ContainerRequestFilter {
-
- protected Logger LOGGER = Logger.getLogger(AbstractRequestFilter.class.getCanonicalName());
-
- public ContainerRequestFilter getRequestFilter() {
- return this;
- }
-
- public ContainerResponseFilter getResponseFilter() {
- return null;
- }
- }
-
- private class ResourceMethodFilter extends AbstractRequestFilter {
-
- private final AbstractResourceMethod arm;
-
- public ResourceMethodFilter(AbstractResourceMethod arm) {
- this.arm = arm;
- }
-
- public ContainerRequest filter(ContainerRequest request) {
- LOGGER.log(Level.INFO,
- "Resource Method matched." +
- "\n HttpMethod: " + arm.getHttpMethod() +
- "\n Resource: " + arm.getDeclaringResource().getResourceClass().getName() +
- "\n Method: " + arm.getMethod().toGenericString());
-
- return request;
- }
- }
-
- private class SubResourceMethodFilter extends AbstractRequestFilter {
-
- private final AbstractSubResourceMethod asrm;
-
- public SubResourceMethodFilter(AbstractSubResourceMethod asrm) {
- this.asrm = asrm;
- }
-
- public ContainerRequest filter(ContainerRequest request) {
- LOGGER.log(Level.INFO,
- "Sub-Resource Method matched." +
- "\n Path: " + asrm.getPath().getValue() +
- (context != null ? "\n Matched Result: " + context.getUriInfo().getMatchedResults().get(0) : "") +
- "\n HttpMethod: " + asrm.getHttpMethod() +
- "\n Resource: " + asrm.getDeclaringResource().getResourceClass().getName() +
- "\n Method: " + asrm.getMethod().toGenericString());
-
- return request;
- }
- }
-
- private class SubResourceLocatorFilter extends AbstractRequestFilter {
-
- private final AbstractSubResourceLocator asrl;
-
- public SubResourceLocatorFilter(AbstractSubResourceLocator asrl) {
- this.asrl = asrl;
- }
-
- public ContainerRequest filter(ContainerRequest request) {
- LOGGER.log(Level.INFO,
- "Sub-Resource Locator matched. " +
- "\n Path: " + asrl.getPath().getValue() +
- (context != null ? "\n Matched Result: " + context.getUriInfo().getMatchedResults().get(0) : "") +
- "\n Resource: " + asrl.getResource().getResourceClass().getName() +
- "\n Method: " + asrl.getMethod().toGenericString());
-
- return request;
- }
- }
-
- public List<ResourceFilter> create(AbstractMethod am) {
-
- if(am instanceof AbstractSubResourceMethod) {
- return Collections.<ResourceFilter>singletonList(new SubResourceMethodFilter((AbstractSubResourceMethod)am));
- } else if(am instanceof AbstractResourceMethod) {
- return Collections.<ResourceFilter>singletonList(new ResourceMethodFilter((AbstractResourceMethod)am));
- } else if(am instanceof AbstractSubResourceLocator) {
- return Collections.<ResourceFilter>singletonList(new SubResourceLocatorFilter((AbstractSubResourceLocator)am));
- } else {
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.java
deleted file mode 100644
index c24ce81058c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container.filter;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.container.ResourceFilter;
-import com.sun.jersey.spi.container.ResourceFilterFactory;
-import java.util.Collections;
-import java.util.List;
-
-import javax.annotation.security.DenyAll;
-import javax.annotation.security.PermitAll;
-import javax.annotation.security.RolesAllowed;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.SecurityContext;
-
-/**
- * A {@link ResourceFilterFactory} supporting the {@link RolesAllowed},
- * {@link PermitAll} and {@link DenyAll} on resource methods sub-resource methods,
- * and sub-resource locators.
- * <p>
- * The {@link SecurityContext} is utilized, using the
- * {@link SecurityContext#isUserInRole(java.lang.String) } method,
- * to ascertain if the user is in one
- * of the roles declared in by a {@link RolesAllowed}. If a user is in none of
- * the declared roles then a 403 (Forbidden) response is returned.
- * <p>
- * If the {@link DenyAll} annotation is declared then a 403 (Forbidden) response
- * is returned.
- * <p>
- * If the {@link PermitAll} annotation is declared and is not overridden then
- * this filter will not be applied.
- * <p>
- * When an application is deployed as a Servlet or Filter this Jersey resource
- * filter can be registered using the following initialization parameter:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ResourceFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.RolesAllowedResourceFilterFactory&lt;/param-value&gt;
- * &lt;/init-param&gt
- * </pre></blockquote>
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public class RolesAllowedResourceFilterFactory implements ResourceFilterFactory {
-
- private @Context SecurityContext sc;
-
- private class Filter implements ResourceFilter, ContainerRequestFilter {
-
- private final boolean denyAll;
- private final String[] rolesAllowed;
-
- protected Filter() {
- this.denyAll = true;
- this.rolesAllowed = null;
- }
-
- protected Filter(String[] rolesAllowed) {
- this.denyAll = false;
- this.rolesAllowed = (rolesAllowed != null) ? rolesAllowed : new String[] {};
- }
-
- // ResourceFilter
-
- @Override
- public ContainerRequestFilter getRequestFilter() {
- return this;
- }
-
- @Override
- public ContainerResponseFilter getResponseFilter() {
- return null;
- }
-
- // ContainerRequestFilter
-
- @Override
- public ContainerRequest filter(ContainerRequest request) {
- if (!denyAll) {
- for (String role : rolesAllowed) {
- if (sc.isUserInRole(role))
- return request;
- }
- }
-
- throw new WebApplicationException(Response.Status.FORBIDDEN);
- }
- }
-
- @Override
- public List<ResourceFilter> create(AbstractMethod am) {
- // DenyAll on the method take precedence over RolesAllowed and PermitAll
- if (am.isAnnotationPresent(DenyAll.class))
- return Collections.<ResourceFilter>singletonList(new Filter());
-
- // RolesAllowed on the method takes precedence over PermitAll
- RolesAllowed ra = am.getAnnotation(RolesAllowed.class);
- if (ra != null)
- return Collections.<ResourceFilter>singletonList(new Filter(ra.value()));
-
- // PermitAll takes precedence over RolesAllowed on the class
- if (am.isAnnotationPresent(PermitAll.class))
- return null;
-
- // RolesAllowed on the class takes precedence over PermitAll
- ra = am.getResource().getAnnotation(RolesAllowed.class);
- if (ra != null)
- return Collections.<ResourceFilter>singletonList(new Filter(ra.value()));
-
- // No need to check whether PermitAll is present.
- return null;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/UriConnegFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/UriConnegFilter.java
deleted file mode 100644
index 00c1639b35b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/UriConnegFilter.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container.filter;
-
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.PathSegment;
-
-/**
- * A URI-based content negotiation filter mapping a dot-declared suffix in
- * URI to media type that is the value of the <code>Accept</code> header
- * or a language that is the value of the <code>Accept-Language</code> header.
- * <p>
- * This filter may be used when the accetable media type and acceptable
- * language need to be declared in the URI.
- * <p>
- * This class may be extended to declare the mappings and the extending class,
- * <code>foo.MyUriConnegFilter</code> say, can be registered as a container request
- * filter. When an application is deployed as a Servlet or Filter such a filter
- * can be registered using the following initialization parameters:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerRequestFilters&lt;/param-name&gt;
- * &lt;param-value&gt;foo.MyUriConnegFilter&lt;/param-value&gt;
- * &lt;/init-param&gt
- * </pre></blockquote>
- * <p>
- * If a suffix of "atom" is regstered with a media type of
- * "application/atom+xml" then a GET request of:
- * <pre>GET /resource.atom</pre>
- * <p>is transformed to:</p>
- * <pre>GET /resource
- *Accept: application/atom+xml</pre>
- * Any existing "Accept" header value will be replaced.
- * <p>
- * If a suffix of "english: is regstered with a language of
- * "en" then a GET request of:
- * <pre>GET /resource.english</pre>
- * <p>is transformed to:</p>
- * <pre>GET /resource
- *Accept-Language: en</pre>
- * Any existing "Accept-Language"header value will be replaced.
- * <p>
- * The media type mappings are processed before the language type mappings.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public class UriConnegFilter implements ContainerRequestFilter {
-
- private final Map<String, MediaType> mediaExtentions;
-
- private final Map<String, String> languageExtentions;
-
- /**
- * Create a filter with suffix to media type mappings.
- *
- * @param mediaExtentions the suffix to media type mappings.
- */
- public UriConnegFilter(Map<String, MediaType> mediaExtentions) {
- if (mediaExtentions == null)
- throw new IllegalArgumentException();
-
- this.mediaExtentions = mediaExtentions;
- this.languageExtentions = Collections.emptyMap();
- }
-
- /**
- * Create a filter with suffix to media type mappings and suffix to
- * langauge mappings.
- *
- * @param mediaExtentions the suffix to media type mappings.
- * @param languageExtentions the syffix to language mappings.
- */
- public UriConnegFilter(Map<String, MediaType> mediaExtentions, Map<String, String> languageExtentions) {
- if (mediaExtentions == null)
- throw new IllegalArgumentException();
- if (languageExtentions == null)
- throw new IllegalArgumentException();
-
- this.mediaExtentions = mediaExtentions;
- this.languageExtentions = languageExtentions;
- }
-
- public ContainerRequest filter(ContainerRequest request) {
- // Quick check for a '.' character
- String path = request.getRequestUri().getRawPath();
- if (path.indexOf('.') == -1)
- return request;
-
- List<PathSegment> l = request.getPathSegments(false);
- if (l.isEmpty())
- return request;
-
- // Get the last non-empty path segment
- PathSegment segment = null;
- for (int i = l.size() - 1; i >= 0; i--) {
- segment = l.get(i);
- if (segment.getPath().length() > 0)
- break;
- }
- if (segment == null)
- return request;
-
- final int length = path.length();
- // Get the suffixes
- final String[] suffixes = segment.getPath().split("\\.");
-
- for (int i = suffixes.length - 1; i >= 1; i--) {
- final String suffix = suffixes[i];
- if (suffix.length() == 0)
- continue;
-
- final MediaType accept = mediaExtentions.get(suffix);
- if (accept != null) {
- request.getRequestHeaders().putSingle("Accept", accept.toString());
-
- final int index = path.lastIndexOf('.' + suffix);
- path = new StringBuilder(path).delete(index, index + suffix.length() + 1).toString();
- suffixes[i] = "";
- break;
- }
- }
-
- for (int i = suffixes.length - 1; i >= 1; i--) {
- final String suffix = suffixes[i];
- if (suffix.length() == 0)
- continue;
-
- final String acceptLanguage = languageExtentions.get(suffix);
- if (acceptLanguage != null) {
- request.getRequestHeaders().putSingle("Accept-Language", acceptLanguage);
-
- final int index = path.lastIndexOf('.' + suffix);
- path = new StringBuilder(path).delete(index, index + suffix.length() + 1).toString();
- suffixes[i] = "";
- break;
- }
- }
-
- if (length != path.length()) {
- request.setUris(
- request.getBaseUri(),
- request.getRequestUriBuilder().replacePath(path).build());
- }
-
- return request;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/package-info.java
deleted file mode 100644
index 788337729f6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/filter/package-info.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-/**
- * Provides common server-side filters.
- * <p>
- * There are two types of filter that may be registered with Jersey:
- * <ol>
- * <li>Container filters, which are filters that are registered to filter
- * the request before the request is matched and dispatched to a root
- * resource class, and filters that are registered to filter the response
- * after the response has returned from a resource method.</li>
- * <li>Resource filters, which are filters that are registered to filter
- * requests and responses specific to resource methods, sub-resource methods
- * and sub-resource locators.</li>
- * <p>
- * </ol>
- * A request will be filtered by container filters before the request is filtered
- * by resource filters. A response will be filtered by resource filters before
- * the response is filtered by container filters.
- * <p>
- * Container filters are registered as properties of the {@link com.sun.jersey.api.core.ResourceConfig}.
- * Container request filters, of the class {@link com.sun.jersey.spi.container.ContainerRequestFilter}, are
- * registered using the property {@link com.sun.jersey.api.core.ResourceConfig#PROPERTY_CONTAINER_REQUEST_FILTERS}.
- * Container response filters, of the class {@link com.sun.jersey.spi.container.ContainerResponseFilter}, are
- * registered using the property {@link com.sun.jersey.api.core.ResourceConfig#PROPERTY_CONTAINER_RESPONSE_FILTERS}.
- * <p>
- * For example, to log requests and responses when an application is deployed
- * as a Servlet or Filter a {@link com.sun.jersey.api.container.filter.LoggingFilter} can be registered using
- * the following initialization parameters:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerRequestFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.LoggingFilter&lt;/param-value&gt;
- * &lt;/init-param&gt
- * &lt;init-param&gt
- * &lt;param-name&gt;com.sun.jersey.spi.container.ContainerResponseFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.LoggingFilter&lt;/param-value&gt;
- * &lt;/init-param&gt;
- * </pre></blockquote>
- * Note that two or more request or response filters may be registered as a ';' separated list of fully
- * qualified class names.
- * <p>
- * Resource filters are registered using two mechanisms:
- * <ol>
- * <li>As resource filter factories. Resource filter factories, of the class
- * {@link com.sun.jersey.spi.container.ResourceFilterFactory}, are registered using the
- * property {@link com.sun.jersey.api.core.ResourceConfig#PROPERTY_RESOURCE_FILTER_FACTORIES}.</li>
- * <li>As resource filters, of the class
- * {@link com.sun.jersey.spi.container.ResourceFilter}, declared using the
- * annotation {@link com.sun.jersey.spi.container.ResourceFilters}, which may
- * occur on a resource class, resource method, sub-resource method or sub-resource locator.</li>
- * </ol>
- * A request will be filtered by filters produced by resource filter factories before a request is filtered
- * by resource filters declared by annotation. A response will be filtered by resource filters declared by annotation
- * before the response is filtered by filters produced by resource filter factories.
- * <p>
- * For example, to support {@link javax.annotation.security.RolesAllowed} on resource classes when an application
- * is deployed as a Servlet or Filter a
- * {@link com.sun.jersey.api.container.filter.RolesAllowedResourceFilterFactory}
- * can be registered using the following initialization parameter:
- * <blockquote><pre>
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.spi.container.ResourceFilters&lt;/param-name&gt;
- * &lt;param-value&gt;com.sun.jersey.api.container.filter.RolesAllowedResourceFilterFactory&lt;/param-value&gt;
- * &lt;/init-param&gt
- * </pre></blockquote>
- * Note that two or more resource filter factories may be registered as a ';' separated list of fully
- * qualified class names.
- * <p>
- * The use of resource filter factories allow the application of filters to any
- * method of a resource class that conforms to a certain pattern as defined by
- * a resource filter factory implementation. For example, the support for the
- * annotation {@link com.sun.jersey.spi.container.ResourceFilters} is implemented
- * as a resource filter factory, that is registered after all user-registered
- * resource filter factories.
- * <p>
- * If an exception is thrown by a request filter (registered using any mechanism)
- * then:
- * <ol>
- * <li>the request processing is terminated;</li>
- * <li>the exception is mapped to a response; and</li>
- * <li>the response is filtered by the response filters.</li>
- * </ol>
- * If an exception is thrown by a response filter (registered using any mechanism)
- * then:
- * <ol>
- * <li>the response processing is terminated;</li>
- * <li>the exception is mapped to a response; and</li>
- * <li>the response is returned to the client.</li>
- * </ol>
- */
-package com.sun.jersey.api.container.filter; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.java
deleted file mode 100644
index 505fb638bbe..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container.grizzly;
-
-import com.sun.grizzly.http.SelectorThread;
-import com.sun.grizzly.standalone.StaticStreamAlgorithm;
-import com.sun.grizzly.tcp.Adapter;
-import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
-import com.sun.jersey.api.container.ContainerFactory;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import java.io.IOException;
-import java.net.URI;
-
-/**
- * Factory for creating and starting Grizzly {@link SelectorThread} instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class GrizzlyServerFactory {
-
- /**
- * {@link ResourceConfig feature to enable encoded slashes in URIs.
- * If set to false (the default behavior), requests containing encoded slashes
- * will get rejected by Grizzly and will never make it to the Jersey runtime.
- */
- public final static String FEATURE_ALLOW_ENCODED_SLASH = "com.sun.jersey.api.container.grizzly.AllowEncodedSlashFeature";
-
- private GrizzlyServerFactory() {}
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes found by searching the classes
- * referenced in the java classath.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class)} method for creating
- * an Adapter that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u));
- }
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes found by searching
- * the classes referenced in the java classath.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class)} method for creating
- * an Adapter that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(URI u)
- throws IOException, IllegalArgumentException {
- return create(u, ContainerFactory.createContainer(Adapter.class));
- }
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig)} method
- * for creating an Adapter that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param rc the resource configuration.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u, ResourceConfig rc)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), rc);
- }
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig)} method
- * for creating an Adapter that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param rc the resource configuration.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(URI u, ResourceConfig rc)
- throws IOException, IllegalArgumentException {
- return create(u, ContainerFactory.createContainer(Adapter.class, rc));
- }
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig, IoCComponentProviderFactory)} method
- * for creating an Adapter that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param rc the resource configuration.
- * @param factory the IoC component provider factory the web application
- * delegates to for obtaining instances of resource and provider
- * classes. May be null if the web application is responsible for
- * instantiating resource and provider classes.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u, ResourceConfig rc,
- IoCComponentProviderFactory factory)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), rc, factory);
- }
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig, IoCComponentProviderFactory)} method
- * for creating an Adapter that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param rc the resource configuration.
- * @param factory the IoC component provider factory the web application
- * delegates to for obtaining instances of resource and provider
- * classes. May be null if the web application is responsible for
- * instantiating resource and provider classes.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(URI u, ResourceConfig rc,
- IoCComponentProviderFactory factory)
- throws IOException, IllegalArgumentException {
- return create(u, ContainerFactory.createContainer(Adapter.class, rc, factory));
- }
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes found by searching the classes
- * referenced in the java classath.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param adapter the Adapter
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u, Adapter adapter)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), adapter);
- }
-
- /**
- * Create a {@link SelectorThread} that registers an {@link Adapter} that
- * in turn manages all root resource and provder classes found by searching the classes
- * referenced in the java classath.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path will be set as the resources context root
- * value, which must be an empty String or begin with a "/".
- * The URI query and fragment components are ignored.
- * @param adapter the Adapter
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null or the URI
- * path does not begin with a "/".
- */
- public static SelectorThread create(URI u, Adapter adapter)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- // TODO support https
- final String scheme = u.getScheme();
- if (!scheme.equalsIgnoreCase("http"))
- throw new IllegalArgumentException("The URI scheme, of the URI " + u +
- ", must be equal (ignoring case) to 'http'");
-
- if (adapter instanceof GrizzlyAdapter) {
- GrizzlyAdapter ga = (GrizzlyAdapter)adapter;
- ga.setResourcesContextPath(u.getRawPath());
- }
-
- final SelectorThread selectorThread = new SelectorThread();
-
- selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());
-
- final int port = (u.getPort() == -1) ? 80 : u.getPort();
- selectorThread.setPort(port);
-
- selectorThread.setAdapter(adapter);
-
- try {
- selectorThread.listen();
- } catch (InstantiationException e) {
- IOException _e = new IOException();
- _e.initCause(e);
- throw _e;
- }
- return selectorThread;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.java
deleted file mode 100644
index f115ecae103..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.container.grizzly;
-
-import com.sun.grizzly.http.SelectorThread;
-import com.sun.grizzly.http.servlet.ServletAdapter;
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ClasspathResourceConfig;
-import com.sun.jersey.spi.container.servlet.ServletContainer;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Map;
-import javax.servlet.Servlet;
-
-/**
- * Factory for creating and starting Grizzly {@link SelectorThread} instances
- * for deploying a Servlet.
- * <p>
- * The default deployed server is an instance of {@link ServletContainer}.
- * <p>
- * If no initialization parameters are declared (or is null) then root
- * resource and provider classes will be found by searching the classes
- * referenced in the java classpath.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class GrizzlyWebContainerFactory {
-
- private GrizzlyWebContainerFactory() {}
-
- /**
- * Create a {@link SelectorThread} that registers the {@link ServletContainer}.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u));
- }
-
- /**
- * Create a {@link SelectorThread} that registers the {@link ServletContainer}.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param initParams the servlet initialization parameters.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u, Map<String, String> initParams)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), initParams);
- }
-
- /**
- * Create a {@link SelectorThread} that registers the {@link ServletContainer}.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(URI u)
- throws IOException, IllegalArgumentException {
- return create(u, ServletContainer.class);
- }
-
- /**
- * Create a {@link SelectorThread} that registers the {@link ServletContainer}.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param initParams the servlet initialization parameters.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(URI u,
- Map<String, String> initParams) throws IOException {
- return create(u, ServletContainer.class, initParams);
- }
-
- /**
- * Create a {@link SelectorThread} that registers the declared
- * servlet class.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param c the servlet class
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u, Class<? extends Servlet> c) throws IOException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), c);
- }
-
- /**
- * Create a {@link SelectorThread} that registers the declared
- * servlet class.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param c the servlet class
- * @param initParams the servlet initialization parameters.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(String u, Class<? extends Servlet> c,
- Map<String, String> initParams) throws IOException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), c, initParams);
- }
-
- /**
- * Create a {@link SelectorThread} that registers the declared
- * servlet class.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param c the servlet class
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(URI u, Class<? extends Servlet> c) throws IOException {
- return create(u, c, null);
- }
-
- /**
- * Create a {@link SelectorThread} that registers the declared
- * servlet class.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path, query and fragment components are ignored.
- * @param c the servlet class
- * @param initParams the servlet initialization parameters.
- * @return the select thread, with the endpoint started
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static SelectorThread create(URI u, Class<? extends Servlet> c,
- Map<String, String> initParams) throws IOException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- ServletAdapter adapter = new ServletAdapter();
- if (initParams == null) {
- adapter.addInitParameter(ClasspathResourceConfig.PROPERTY_CLASSPATH,
- System.getProperty("java.class.path").replace(File.pathSeparatorChar, ';'));
- } else {
- for (Map.Entry<String, String> e : initParams.entrySet()) {
- adapter.addInitParameter(e.getKey(), e.getValue());
- }
- }
-
- adapter.setServletInstance(getInstance(c));
-
- String path = u.getPath();
- if (path == null)
- throw new IllegalArgumentException("The URI path, of the URI " + u +
- ", must be non-null");
- else if (path.length() == 0)
- throw new IllegalArgumentException("The URI path, of the URI " + u +
- ", must be present");
- else if (path.charAt(0) != '/')
- throw new IllegalArgumentException("The URI path, of the URI " + u +
- ". must start with a '/'");
-
- if (path.length() > 1) {
- if (path.endsWith("/"))
- path = path.substring(0, path.length() - 1);
- adapter.setContextPath(path);
- }
-
- return GrizzlyServerFactory.create(u, adapter);
- }
-
- private static Servlet getInstance(Class<? extends Servlet> c){
- try{
- return c.newInstance();
- } catch (Exception e) {
- throw new ContainerException(e);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/package-info.java
deleted file mode 100644
index 96e52a0381b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/grizzly/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for creating Grizzly-based HTTP containers.
- */
-package com.sun.jersey.api.container.grizzly; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/HttpServerFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/HttpServerFactory.java
deleted file mode 100644
index 020e12a4ae3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/HttpServerFactory.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.container.httpserver;
-
-import com.sun.net.httpserver.HttpHandler;
-import com.sun.net.httpserver.HttpServer;
-import com.sun.net.httpserver.HttpsServer;
-import com.sun.jersey.api.container.ContainerFactory;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.URI;
-import java.util.concurrent.Executors;
-
-/**
- * Factory for creating {@link HttpServer} instances.
- * <p>
- * The {@link HttpServer} executor will be configued with instance returned from
- * {@link Executors#newCachedThreadPool() }. This behaviour may be overridden
- * before {@link HttpServer#start() } is called.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class HttpServerFactory {
-
- private HttpServerFactory() {}
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that in turn
- * manages all root resource classes found by searching the classes
- * referenced in the java classpath.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class)} method for creating
- * an HttpHandler that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(String u)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u));
- }
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that in turn
- * manages all root resource classes found by searching the classes
- * referenced in the java classath.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class)} method for creating
- * an HttpHandler that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(URI u)
- throws IOException, IllegalArgumentException {
- return create(u, ContainerFactory.createContainer(HttpHandler.class));
- }
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig)} method
- * for creating an HttpHandler that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @param rc the resource configuration.
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(String u, ResourceConfig rc)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), rc);
- }
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig)} method
- * for creating an HttpHandler that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @param rc the resource configuration.
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(URI u, ResourceConfig rc)
- throws IOException, IllegalArgumentException {
- return create(u, ContainerFactory.createContainer(HttpHandler.class, rc));
- }
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig)} method
- * for creating an HttpHandler that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @param rc the resource configuration.
- * @param factory the IoC component provider factory the web application
- * delegates to for obtaining instances of resource and provider
- * classes. May be null if the web application is responsible for
- * instantiating resource and provider classes.
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(String u, ResourceConfig rc,
- IoCComponentProviderFactory factory)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), rc, factory);
- }
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that
- * in turn manages all root resource and provder classes declared by the
- * resource configuration.
- * <p>
- * This implementation defers to the
- * {@link ContainerFactory#createContainer(Class, ResourceConfig)} method
- * for creating an HttpHandler that manages the root resources.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @param rc the resource configuration.
- * @param factory the IoC component provider factory the web application
- * delegates to for obtaining instances of resource and provider
- * classes. May be null if the web application is responsible for
- * instantiating resource and provider classes.
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(URI u, ResourceConfig rc,
- IoCComponentProviderFactory factory)
- throws IOException, IllegalArgumentException {
- return create(u, ContainerFactory.createContainer(HttpHandler.class, rc, factory));
- }
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that in turn
- * manages all root resource classes found by searching the classes
- * referenced in the java classath.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @param handler the HTTP handler
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(String u, HttpHandler handler)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- return create(URI.create(u), handler);
- }
-
- /**
- * Create a {@link HttpServer} that registers a HttpHandler that in turn
- * manages all root resource classes found by searching the classes
- * referenced in the java classath.
- *
- * @param u the URI to create the http server. The URI scheme must be
- * equal to "http" or "https". The URI user information and host
- * are ignored If the URI port is not present then port 80 will be
- * used. The URI path must not be null or an empty string, and must
- * not absolute (start with a '/' character). The URI path is used
- * as the context of the HTTP handler (and corresponds to the base
- * path). The URI query and fragment components are ignored.
- * @param handler the HTTP handler
- * @return the http server
- * @throws IOException if an error occurs creating the container.
- * @throws IllegalArgumentException if <code>u</code> is null
- */
- public static HttpServer create(URI u, HttpHandler handler)
- throws IOException, IllegalArgumentException {
- if (u == null)
- throw new IllegalArgumentException("The URI must not be null");
-
- final String scheme = u.getScheme();
- if (!scheme.equalsIgnoreCase("http") && !scheme.equalsIgnoreCase("https"))
- throw new IllegalArgumentException("The URI scheme, of the URI " + u +
- ", must be equal (ignoring case) to 'http' or 'https'");
-
- final String path = u.getPath();
- if (path == null)
- throw new IllegalArgumentException("The URI path, of the URI " + u +
- ", must be non-null");
- else if (path.length() == 0)
- throw new IllegalArgumentException("The URI path, of the URI " + u +
- ", must be present");
- else if (path.charAt(0) != '/')
- throw new IllegalArgumentException("The URI path, of the URI " + u +
- ". must start with a '/'");
-
- final int port = (u.getPort() == -1) ? 80 : u.getPort();
- final HttpServer server = (scheme.equalsIgnoreCase("http")) ?
- HttpServer.create(new InetSocketAddress(port), 0) :
- HttpsServer.create(new InetSocketAddress(port), 0);
-
- server.setExecutor(Executors.newCachedThreadPool());
- server.createContext(path, handler);
- return server;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/package-info.java
deleted file mode 100644
index c8f89dd6e88..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/httpserver/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for creating a Light weight HTTP server HTTP container.
- */
-package com.sun.jersey.api.container.httpserver; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/container/package-info.java
deleted file mode 100644
index c7d204730de..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/container/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for creating HTTP-based containers.
- */
-package com.sun.jersey.api.container; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ApplicationAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ApplicationAdapter.java
deleted file mode 100644
index 97a76912fb4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ApplicationAdapter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import javax.ws.rs.core.Application;
-
-/**
- * An extension of {@link DefaultResourceConfig} that adapts an instance
- * of {@link Application}.
- */
-public class ApplicationAdapter extends DefaultResourceConfig {
- /**
- * @param ac the application
- */
- public ApplicationAdapter(Application ac) {
- if (ac.getClasses() != null)
- getClasses().addAll(ac.getClasses());
- if (ac.getSingletons() != null)
- getSingletons().addAll(ac.getSingletons());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClassNamesResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClassNamesResourceConfig.java
deleted file mode 100644
index 4e6f59c63e8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClassNamesResourceConfig.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.core;
-
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A mutable implementation of {@link DefaultResourceConfig} that explicitly
- * declares for root resource and provider classes.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ClassNamesResourceConfig extends DefaultResourceConfig {
-
- /**
- * The property value MUST be an instance String or String[]. Each String
- * instance represents one or more class names that MUST be separated by ';',
- * ',' or ' ' (space).
- */
- public static final String PROPERTY_CLASSNAMES = "com.sun.jersey.config.property.classnames";
-
- /**
- * Declare an array of root resource and provider classes.
- *
- * @param classes the array of classes.
- */
- public ClassNamesResourceConfig(Class... classes) {
- super();
-
- for (Class c : classes)
- getClasses().add(c);
- }
-
- /**
- * Declare root resource and provider class as an array of class names.
- *
- * @param classNames the array of classes.
- */
- public ClassNamesResourceConfig(String... classNames) {
- super(getClasses(classNames));
- }
-
- /**
- * Declare root resource and provider classes declaring the class names as a
- * property of {@link ResourceConfig}.
- *
- * @param props the property bag that contains the property
- * {@link #PROPERTY_CLASSNAMES}.
- */
- public ClassNamesResourceConfig(Map<String, Object> props) {
- super(getClasses(props));
- setPropertiesAndFeatures(props);
- }
-
- private static Set<Class<?>> getClasses(Map<String, Object> props) {
- Object v = props.get(PROPERTY_CLASSNAMES);
- if (v == null) {
- throw new IllegalArgumentException(PROPERTY_CLASSNAMES + " property is missing");
- }
- Set<Class<?>> s = getClasses(v);
- if (s.isEmpty()) {
- throw new IllegalArgumentException(PROPERTY_CLASSNAMES + " contains no classes");
- }
- return s;
- }
-
- private static Set<Class<?>> getClasses(Object param) {
- return convertToSet(_getClasses(param));
- }
-
- private static Set<Class<?>> getClasses(String[] elements) {
- return convertToSet(getElements(elements));
- }
-
- private static Set<Class<?>> convertToSet(String[] classes) {
- Set<Class<?>> s = new LinkedHashSet<Class<?>>();
- for (String c : classes) {
- try {
- s.add(getClassLoader().loadClass(c));
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
- }
- return s;
- }
-
- private static String[] _getClasses(Object param) {
- if (param instanceof String) {
- return getElements(new String[] { (String)param }, ResourceConfig.COMMON_DELIMITERS);
- } else if (param instanceof String[]) {
- return getElements((String[])param, ResourceConfig.COMMON_DELIMITERS);
- } else {
- throw new IllegalArgumentException(PROPERTY_CLASSNAMES + " must " +
- "have a property value of type String or String[]");
- }
- }
-
- private static ClassLoader getClassLoader() {
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- return (classLoader == null) ? ClassNamesResourceConfig.class.getClassLoader() : classLoader;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClasspathResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClasspathResourceConfig.java
deleted file mode 100644
index 636348ce972..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ClasspathResourceConfig.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.core.spi.scanning.FilesScanner;
-
-import java.io.File;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A mutable implementation of {@link DefaultResourceConfig} that dynamically
- * searches for root resource and provider classes in the files and directories
- * declared by the property {@link ClasspathResourceConfig#PROPERTY_CLASSPATH}.
- * That property MUST be included in the map of initial properties passed to
- * the constructor.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author Frank D. Martinez. fmartinez@asimovt.com
- */
-public class ClasspathResourceConfig extends ScanningResourceConfig {
- /**
- * The property value MUST be an instance String or String[]. Each String
- * instance represents one or more paths that MUST be separated by ';',
- * ',' or ' ' (space).
- * Each path MUST be an absolute or relative directory, or a Jar file.
- * The contents of a directory, including Java class files, jars files
- * and sub-directories (recursively) are scanned. The Java class files of
- * a jar file are scanned.
- * <p>
- * Root resource classes MUST be present in the Java class path.
- */
- public static final String PROPERTY_CLASSPATH
- = "com.sun.jersey.config.property.classpath";
-
- private static final Logger LOGGER =
- Logger.getLogger(ClasspathResourceConfig.class.getName());
-
- public ClasspathResourceConfig() {
- this(getPaths());
- }
-
- /**
- * @param props the property bag that contains the property
- * {@link ClasspathResourceConfig#PROPERTY_CLASSPATH}.
- */
- public ClasspathResourceConfig(Map<String, Object> props) {
- this(getPaths(props));
-
- setPropertiesAndFeatures(props);
- }
-
- /**
- * @param paths the array paths consisting of either jar files or
- * directories containing jar files for class files.
- */
- public ClasspathResourceConfig(String[] paths) {
- if (paths == null || paths.length == 0)
- throw new IllegalArgumentException(
- "Array of paths must not be null or empty");
-
- init(paths.clone());
- }
-
- private void init(String[] paths) {
- final File[] files = new File[paths.length];
- for (int i = 0; i < paths.length; i++) {
- files[i] = new File(paths[i]);
- }
-
- if (LOGGER.isLoggable(Level.INFO)) {
- StringBuilder b = new StringBuilder();
- b.append("Scanning for root resource and provider classes in the paths:");
- for (String p : paths)
- b.append('\n').append(" ").append(p);
-
- LOGGER.log(Level.INFO, b.toString());
- }
-
- init(new FilesScanner(files));
- }
-
- private static String[] getPaths() {
- String classPath = System.getProperty("java.class.path");
- return classPath.split(File.pathSeparator);
- }
-
- private static String[] getPaths(Map<String, Object> props) {
- Object v = props.get(PROPERTY_CLASSPATH);
- if (v == null)
- throw new IllegalArgumentException(PROPERTY_CLASSPATH +
- " property is missing");
-
- String[] paths = getPaths(v);
- if (paths.length == 0)
- throw new IllegalArgumentException(PROPERTY_CLASSPATH +
- " contains no paths");
-
- return paths;
- }
-
- private static String[] getPaths(Object param) {
- if (param instanceof String) {
- return getElements(new String[] { (String)param }, ResourceConfig.COMMON_DELIMITERS);
- } else if (param instanceof String[]) {
- return getElements((String[])param, ResourceConfig.COMMON_DELIMITERS);
- } else {
- throw new IllegalArgumentException(PROPERTY_CLASSPATH + " must " +
- "have a property value of type String or String[]");
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/DefaultResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/DefaultResourceConfig.java
deleted file mode 100644
index c7f5ce23d4a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/DefaultResourceConfig.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import javax.ws.rs.core.MediaType;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A mutable implementation of {@link ResourceConfig} that declares
- * default values for features.
- * <p>
- * The set of features and properties may be modified by modifying the instances
- * returned from the methods {@link ResourceConfig#getFeatures} and
- * {@link ResourceConfig#getProperties} respectively.
- */
-public class DefaultResourceConfig extends ResourceConfig {
-
- private final Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
-
- private final Set<Object> singletons = new LinkedHashSet<Object>(1);
-
- private final Map<String, MediaType> mediaExtentions = new HashMap<String, MediaType>(1);
-
- private final Map<String, String> languageExtentions = new HashMap<String, String>(1);
-
- private final Map<String, Object> explicitRootResources = new HashMap<String, Object>(1);
-
- private final Map<String, Boolean> features = new HashMap<String, Boolean>();
-
- private final Map<String, Object> properties = new HashMap<String, Object>();
-
- /**
- */
- public DefaultResourceConfig() {
- this((Set<Class<?>>)null);
- }
-
- /**
- * @param classes the initial set of root resource classes
- * and provider classes
- */
- public DefaultResourceConfig(Class<?>... classes) {
- this(new LinkedHashSet<Class<?>>(Arrays.asList(classes)));
- }
-
- /**
- * @param classes the initial set of root resource classes
- * and provider classes
- */
- public DefaultResourceConfig(Set<Class<?>> classes) {
- if (null != classes) {
- this.classes.addAll(classes);
- }
- }
-
- @Override
- public Set<Class<?>> getClasses() {
- return classes;
- }
-
- @Override
- public Set<Object> getSingletons() {
- return singletons;
- }
-
- @Override
- public Map<String, MediaType> getMediaTypeMappings() {
- return mediaExtentions;
- }
-
- @Override
- public Map<String, String> getLanguageMappings() {
- return languageExtentions;
- }
-
- @Override
- public Map<String, Object> getExplicitRootResources() {
- return explicitRootResources;
- }
-
- @Override
- public Map<String, Boolean> getFeatures() {
- return features;
- }
-
- @Override
- public boolean getFeature(String featureName) {
- final Boolean v = features.get(featureName);
- return (v != null) ? v : false;
- }
-
- @Override
- public Map<String, Object> getProperties() {
- return properties;
- }
-
- @Override
- public Object getProperty(String propertyName) {
- return properties.get(propertyName);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ExtendedUriInfo.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ExtendedUriInfo.java
deleted file mode 100644
index 0d59accf676..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ExtendedUriInfo.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.spi.container.ContainerResponse;
-import java.util.List;
-import java.util.regex.MatchResult;
-import javax.ws.rs.core.PathSegment;
-import javax.ws.rs.core.UriInfo;
-
-/**
- * Extensions to {@link UriInfo}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ExtendedUriInfo extends UriInfo {
- /**
- * Get get matched resource method that was invoked.
- *
- * @return the matched resource method, otherwise null if no resource
- * method was invoked.
- */
- AbstractResourceMethod getMatchedMethod();
-
- /**
- * Get the throwable that was mapped to a response.
- * <p>
- * A response filter or a message body writer may utilize this method to
- * determine if a resource method was invoked but did not return a
- * response because an exception was thrown from the resource method, or
- * the resource method returned but a response filter threw an exception.
- *
- * @return the throwable that was mapped to a response, otherwise null
- * if no throwable was mapped to a response.
- * @see ContainerResponse#getMappedThrowable
- */
- Throwable getMappedThrowable();
-
- /**
- * Get a read-only list of {@link MatchResult} for matched resources.
- * Entries are ordered in reverse request URI matching order, with the
- * root resource match result last.
- *
- * @return a read-only list of match results for matched resources.
- */
- List<MatchResult> getMatchedResults();
-
- /**
- * Get a read-only list of {@link UriTemplate} for matched resources.
- * Each entry is a URI template that is the value of the
- * {@link javax.ws.rs.Path} that is a partial path that matched a resource
- * class, a sub-resource method or a sub-resource locator.
- * Entries are ordered in reverse request URI matching order, with the
- * root resource URI template last.
- *
- * @return a read-only list of URI templates for matched resources.
- */
- List<UriTemplate> getMatchedTemplates();
-
- /**
- * Get the path segments that contains a template variable.
- * All sequences of escaped octets are decoded,
- * equivalent to <code>getPathSegments(true)</code>.
- *
- * @param name the template variable name
- * @return the path segments, the list will be empty the matching path does
- * not contain the template
- */
- List<PathSegment> getPathSegments(String name);
-
- /**
- * Get the path segments that contains a template variable.
- *
- * @param name the template variable name
- * @param decode controls whether sequences of escaped octets are decoded
- * (true) or not (false).
- * @return the path segments, the list will be empty the matching path does
- * not contain the template
- */
- List<PathSegment> getPathSegments(String name, boolean decode);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpContext.java
deleted file mode 100644
index f6334bf51ae..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpContext.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import java.util.Map;
-
-/**
- * A HttpContext makes it possible for a web resource implementation class to
- * access and manipulate HTTP request and response information directly. Typically
- * a HttpContext is injected on to a resource class using the
- * annotation {@link javax.ws.rs.core.Context}.
- */
-public interface HttpContext extends Traceable {
- /**
- * Get the extended URI information.
- * @return the extended URI information.
- */
- ExtendedUriInfo getUriInfo();
-
- /**
- * Get the HTTP request information.
- * @return the HTTP request information
- */
- HttpRequestContext getRequest();
-
- /**
- * Get the HTTP response information.
- * @return the HTTP response information
- */
- HttpResponseContext getResponse();
-
- /**
- * Get the mutable properties.
- * <p>
- * Care should be taken not to clear the properties or remove properties
- * that are unknown otherwise unspecified behaviour may result.
- *
- * @return the properties.
- */
- Map<String, Object> getProperties();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpRequestContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpRequestContext.java
deleted file mode 100644
index 856def72f74..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpRequestContext.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.List;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.PathSegment;
-import javax.ws.rs.core.Request;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriBuilder;
-
-/**
- * An abstraction of a HTTP request.
- */
-public interface HttpRequestContext extends HttpHeaders, Request, SecurityContext, Traceable {
- /**
- * Get the base URI of the application. URIs of root resource classes
- * are all relative to this base URI.
- * @return the base URI of the application
- */
- URI getBaseUri();
-
- /**
- * Get the base URI of the application in the form of a UriBuilder.
- * @return a UriBuilder initialized with the base URI of the application.
- */
- UriBuilder getBaseUriBuilder();
-
- /**
- * Get the absolute request URI. This includes query parameters and
- * any supplied fragment.
- * @return the absolute request URI
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- URI getRequestUri();
-
- /**
- * Get the absolute request URI in the form of a UriBuilder.
- * @return a UriBuilder initialized with the absolute request URI
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- UriBuilder getRequestUriBuilder();
-
- /**
- * Get the absolute path of the request. This includes everything preceding
- * the path (host, port etc) but excludes query parameters and fragment.
- * This is a shortcut for
- * <code>uriInfo.getBase().resolve(uriInfo.getPath()).</code>
- * @return the absolute path of the request
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- URI getAbsolutePath();
-
- /**
- * Get the absolute path of the request in the form of a UriBuilder.
- * This includes everything preceding the path (host, port etc) but excludes
- * query parameters and fragment.
- * @return a UriBuilder initialized with the absolute path of the request
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- UriBuilder getAbsolutePathBuilder();
-
- /**
- * Get the path of the current request relative to the base URI as
- * a string. All sequences of escaped octets are decoded, equivalent to
- * <code>getPath(true)</code>.
- *
- * @return the relative URI path
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- String getPath();
-
- /**
- * Get the path of the current request relative to the base URI as
- * a string.
- *
- * @param decode controls whether sequences of escaped octets are decoded
- * (true) or not (false).
- * @return the relative URI path
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- String getPath(boolean decode);
-
- /**
- * Get the path of the current request relative to the base URI as a
- * list of {@link PathSegment}. This method is useful when the
- * path needs to be parsed, particularly when matrix parameters may be
- * present in the path. All sequences of escaped octets in path segments
- * and matrix parameter names and values are decoded,
- * equivalent to <code>getPathSegments(true)</code>.
- * @return an unmodifiable list of {@link PathSegment}. The matrix parameter
- * map of each path segment is also unmodifiable.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- * @see PathSegment
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- List<PathSegment> getPathSegments();
-
- /**
- * Get the path of the current request relative to the base URI as a
- * list of {@link PathSegment}. This method is useful when the
- * path needs to be parsed, particularly when matrix parameters may be
- * present in the path.
- * @param decode controls whether sequences of escaped octets in path segments
- * and matrix parameter names and values are decoded (true) or not (false).
- * @return an unmodifiable list of {@link PathSegment}. The matrix parameter
- * map of each path segment is also unmodifiable.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- * @see PathSegment
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- List<PathSegment> getPathSegments(boolean decode);
-
- /**
- * Get the URI query parameters of the current request.
- * All sequences of escaped octets in parameter names and values are decoded,
- * equivalent to <code>getQueryParameters(true)</code>.
- * @return an unmodifiable map of query parameter names and values
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- MultivaluedMap<String, String> getQueryParameters();
-
- /**
- * Get the URI query parameters of the current request.
- * @param decode controls whether sequences of escaped octets in parameter
- * names and values are decoded (true) or not (false).
- * @return an unmodifiable map of query parameter names and values
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- MultivaluedMap<String, String> getQueryParameters(boolean decode);
-
- /**
- * Get a HTTP header value.
- *
- * @param name the HTTP header
- * @return the HTTP header value. If the HTTP header is not present then
- * null is returned. If the HTTP header is present but has no value then
- * the empty string is returned. If the HTTP header is present more than
- * once then the values of joined together and separated by a ',' character.
- */
- String getHeaderValue(String name);
-
- /**
- * Select the first media type, from a list of media types, that is most
- * acceptable according to the requested acceptable media types.
- *
- * @deprecated
- * @param mediaTypes the list of media types
- * @return the most acceptable media type, or null if no media type
- * was found to be acceptable.
- */
- @Deprecated
- MediaType getAcceptableMediaType(List<MediaType> mediaTypes);
-
- /**
- * Get a list of media types that are acceptable for the response.
- *
- * @deprecated
- * @param priorityMediaTypes the list of media types that take priority,
- * ordered according to the quality source parameter, "qs" as the
- * primary key.
- * @return a list of requested response media types sorted according
- * to highest relative quality value, which is product of the
- * quality parameter, q, of an acceptable media type, and the
- * quality source parameter, qs, of matching media type.
- */
- @Deprecated
- List<MediaType> getAcceptableMediaTypes(List<QualitySourceMediaType> priorityMediaTypes);
-
- /**
- * Get the cookie name value map.
- *
- * @return the cookie name value map.
- */
- MultivaluedMap<String, String> getCookieNameValueMap();
-
- /**
- * Get the request entity, returns null if the request does not
- * contain an entity body.
- *
- * @param type the type of entity
- * @return the request entity or null
- * @throws WebApplicationException if the content of the request
- * cannot be mapped to an entity of the requested type
- */
- <T> T getEntity(Class<T> type) throws WebApplicationException;
-
- /**
- * Get the request entity, returns null if the request does not
- * contain an entity body.
- *
- * @param type the type of entity
- * @param genericType type the generic type of entity, it is the responsibility
- * of the callee to ensure that the type and generic type are
- * consistent otherwise the behaviour of this method is undefined.
- * @param as the annotations associated with the type
- * @return the request entity or null
- * @throws WebApplicationException if the content of the request
- * cannot be mapped to an entity of the requested type
- */
- <T> T getEntity(Class<T> type, Type genericType, Annotation[] as)
- throws WebApplicationException;
-
- /**
- * Get the form parameters of the request entity.
- * <p>
- * This method will ensure that the request entity is buffered
- * such that it may be consumed by the application.
- *
- * @return the form parameters, if there is a request entity and the
- * content type is "application/x-www-form-urlencoded", otherwise an
- * instance containing no parameters will be returned.
- */
- Form getFormParameters();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpResponseContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpResponseContext.java
deleted file mode 100644
index dd7078cdc38..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/HttpResponseContext.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.core;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.GenericEntity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.StatusType;
-
-/**
- * An abstraction of a HTTP response.
- * <p>
- * The default state is a HTTP response with a status code of 204
- * (No Content) with no headers and entity.
- */
-public interface HttpResponseContext {
-
- /**
- * Get the response that was set.
- *
- * @return the response.
- */
- Response getResponse();
-
- /**
- * Set the response state from a Response instance. This replaces a
- * pre-existing response state.
- *
- * @param response the response.
- */
- void setResponse(Response response);
-
- /**
- * Check if the response has been set using the setReponse methods.
- *
- * @return true if the response has been set.
- */
- boolean isResponseSet();
-
- /**
- * Get the throwable (if any) that was mapped to a response.
- *
- * @return the throwable that was mapped to a response, otherwise null
- * if no throwable was mapped to a response.
- */
- Throwable getMappedThrowable();
-
- /**
- * @return the status type of the response
- */
- StatusType getStatusType();
-
- /**
- * Set the status type of the response.
- * @param statusType the status type.
- */
- void setStatusType(StatusType statusType);
-
- /**
- * @return the status of the response
- */
- int getStatus();
-
- /**
- * Set the status of the response.
- * @param status the status.
- */
- void setStatus(int status);
-
- /**
- * @return the entity of the response.
- */
- Object getEntity();
-
- /**
- *
- * @return the type of the entity.
- */
- Type getEntityType();
-
- /**
- * Get the original entity instance that was set by
- * {@link #setEntity(java.lang.Object)}.
- */
- Object getOriginalEntity();
-
- /**
- * Set the entity of the response.
- * <p>
- * If the entity is an instance of {@link GenericEntity} then the entity
- * and entity type are set from the entity and type of that
- * {@link GenericEntity}. Otherwise, the entity is set from the entity
- * parameter and the type is the class of that parameter.
- * <p>
- * If it is necessary to wrap an entity that may have been set with an
- * instance of {@link GenericEntity} then utilize the
- * {@link #getOriginalEntity() }, for example:
- * <blockquote><pre>
- * HttpResponseContext r = ...
- * r.setEntity(wrap(getOriginalEntity()));
- * </blockquote></pre>
- *
- * @param entity the entity.
- */
- void setEntity(Object entity);
-
- /**
- * Get the annotations associated with the response entity (if any).
- *
- * @return the annotations.
- */
- Annotation[] getAnnotations();
-
- /**
- * Set the annotations associated with the response entity (if any).
- *
- * @param annotations the annotations.
- */
- void setAnnotations(Annotation[] annotations);
-
- /**
- * Get the HTTP response headers. The returned map is case-insensitive
- * with respect to the keys (header values). The method {@link #setResponse}
- * will replace any headers previously set.
- *
- * @return a mutable map of headerd.
- */
- MultivaluedMap<String, Object> getHttpHeaders();
-
- /**
- * Get the media type of the response entity.
- *
- * @return the media type or null if there is no response entity.
- */
- MediaType getMediaType();
-
- /**
- * Get an {@link OutputStream} to which an entity may be written.
- * <p>
- * The first byte written will result in the writing of thethe status code
- * and headers.
- *
- * @return the output stream
- * @throws java.io.IOException if an IO error occurs
- */
- OutputStream getOutputStream() throws IOException;
-
- /**
- * Ascertain if a response has been committed to the container.
- * <p>
- * A response is committed if the status code, headers have been
- * written to the container.
- *
- * @return true if the response has been committed.
- */
- boolean isCommitted();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/InjectParam.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/InjectParam.java
deleted file mode 100644
index 53edb75217c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/InjectParam.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.core;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Used to annotate fields, methods or parameters that shall be injected with
- * instances obtained from Jersey or registered IoC component provider
- * factories that provide support for Guice, Spring or CDI.
- * <p>
- * When Jersey is used without IoC component provider support this annotation
- * provides basic injection support of beans. References to beans may be
- * obtained be they existing references to instances of resources or just beans
- * that have JAX-RS/Jersey artifacts injected on them.
- * <p>
- * When Jersey is used with an IoC component provider, such as Guice or CDI,
- * this annotation may be used in conjunction with the Guice or JSR 330-based
- * <code>@Inject</code> when references to beans are obtained as parameters of
- * resource methods, sub-resource methods or sub-resource locator methods.
- *
- * @author Paul.Sandoz@Oracle.Com
- */
-@Target({PARAMETER, METHOD, FIELD})
-@Retention(RUNTIME)
-@Documented
-public @interface InjectParam {
- /**
- * @return the name of the object to inject, by default the name
- * is the class name of the type that is injected.
- */
- String value() default "";
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/PackagesResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/PackagesResourceConfig.java
deleted file mode 100644
index 75c85b7b2cb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/PackagesResourceConfig.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.core.spi.scanning.PackageNamesScanner;
-
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A mutable implementation of {@link DefaultResourceConfig} that dynamically
- * searches for root resource and provider classes in a given a set of
- * declared package and in all (if any) sub-packages of those declared packages.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class PackagesResourceConfig extends ScanningResourceConfig {
- /**
- * The property value MUST be an instance String or String[]. Each String
- * instance represents one or more package names that MUST be separated by
- * ';', ',' or ' ' (space).
- */
- public static final String PROPERTY_PACKAGES
- = "com.sun.jersey.config.property.packages";
-
- private static final Logger LOGGER =
- Logger.getLogger(PackagesResourceConfig.class.getName());
-
- /**
- * Search for root resource classes declaring the packages as an
- * array of package names.
- *
- * @param packages the array package names.
- */
- public PackagesResourceConfig(String... packages) {
- if (packages == null || packages.length == 0)
- throw new IllegalArgumentException("Array of packages must not be null or empty");
-
- init(packages.clone());
- }
-
- /**
- * Search for root resource classes declaring the packages as a
- * property of {@link ResourceConfig}.
- *
- * @param props the property bag that contains the property
- * {@link PackagesResourceConfig#PROPERTY_PACKAGES}.
- */
- public PackagesResourceConfig(Map<String, Object> props) {
- this(getPackages(props));
-
- setPropertiesAndFeatures(props);
- }
-
- private void init(String[] packages) {
- if (LOGGER.isLoggable(Level.INFO)) {
- StringBuilder b = new StringBuilder();
- b.append("Scanning for root resource and provider classes in the packages:");
- for (String p : packages)
- b.append('\n').append(" ").append(p);
-
- LOGGER.log(Level.INFO, b.toString());
- }
-
- init(new PackageNamesScanner(packages));
- }
-
- private static String[] getPackages(Map<String, Object> props) {
- Object v = props.get(PROPERTY_PACKAGES);
- if (v == null)
- throw new IllegalArgumentException(PROPERTY_PACKAGES +
- " property is missing");
-
- String[] packages = getPackages(v);
- if (packages.length == 0)
- throw new IllegalArgumentException(PROPERTY_PACKAGES +
- " contains no packages");
-
- return packages;
- }
-
- private static String[] getPackages(Object param) {
- if (param instanceof String) {
- return getElements(new String[] { (String)param }, ResourceConfig.COMMON_DELIMITERS);
- } else if (param instanceof String[]) {
- return getElements((String[])param, ResourceConfig.COMMON_DELIMITERS);
- } else {
- throw new IllegalArgumentException(PROPERTY_PACKAGES + " must " +
- "have a property value of type String or String[]");
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ParentRef.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ParentRef.java
deleted file mode 100644
index 4a352366bab..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ParentRef.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.core;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Used to annotate fields or parameters that shall be injected with
- * parent resource class instances or instances obtained from registered
- * IoC component provider factories (if any).
- * <p>
- *
- * @author Paul.Sandoz@Oracle.Com
- */
-@Target({PARAMETER, METHOD, FIELD})
-@Retention(RUNTIME)
-@Documented
-public @interface ParentRef {
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfig.java
deleted file mode 100644
index e539245d9e5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfig.java
+++ /dev/null
@@ -1,926 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.api.container.filter.LoggingFilter;
-import com.sun.jersey.api.uri.UriComponent;
-import com.sun.jersey.core.header.LanguageTag;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.jersey.spi.container.ContainerListener;
-import com.sun.jersey.spi.container.ContainerNotifier;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.container.ResourceFilterFactory;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Provider;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.regex.Pattern;
-
-
-/**
- * The resource configuration for configuring a web application.
- */
-public abstract class ResourceConfig extends Application implements FeaturesAndProperties {
- private static final Logger LOGGER =
- Logger.getLogger(ResourceConfig.class.getName());
-
- /**
- * If true and {@link #FEATURE_CANONICALIZE_URI_PATH} is true then the
- * request URI will be normalized as specified by
- * {@link java.net.URI#normalize}. If not true the request URI is not
- * modified.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_NORMALIZE_URI
- = "com.sun.jersey.config.feature.NormalizeURI";
-
- /**
- * If true the request URI path component will be canonicalized by removing
- * contiguous slashes (i.e. all /+ will be replaced by /). If not true the
- * request URI path component is mot modified.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_CANONICALIZE_URI_PATH
- = "com.sun.jersey.config.feature.CanonicalizeURIPath";
-
- /**
- * If true, and {@link #FEATURE_CANONICALIZE_URI_PATH} is true,
- * and the canonicalization/normalization operations on the
- * request URI result in a new URI that is not equal to the request URI,
- * then the client is (temporarily) redirected to the new URI.
- * <p>
- * If true, and the path value of a {@link javax.ws.rs.Path} annotation ends
- * in a slash, the request URI path does not end in a '/' and would otherwise
- * match the path value if it did, then the client is (temporarily)
- * redirected to a new URI that is the request URI with a '/' appended to the
- * the end of the path.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_REDIRECT
- = "com.sun.jersey.config.feature.Redirect";
-
- /**
- * If true then matrix parameters (if present) in the request URI path component
- * will not be ignored when matching the path to URI templates declared by
- * resource classes.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_MATCH_MATRIX_PARAMS
- = "com.sun.jersey.config.feature.IgnoreMatrixParams";
-
- /**
- * If true then the matching algorithm will attempt to match and accept
- * any static content or templates associated with a resource that were
- * not explicitly declared by that resource.
- * <p>
- * If a template is matched then the model for the viewable will be the
- * resource instance associated with the template.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_IMPLICIT_VIEWABLES
- = "com.sun.jersey.config.feature.ImplicitViewables";
-
- /**
- * If true then disable WADL generation.
- * <p>
- * By default WADL generation is automatically enabled, if JAXB is
- * present in the classpath.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_DISABLE_WADL
- = "com.sun.jersey.config.feature.DisableWADL";
-
- /**
- * If true then enable tracing.
- * <p>
- * Tracing provides useful information that describes how a request
- * is processed and dispatched to JAX-RS/Jersey components. This can aid
- * debugging when the application is not behaving as expected either
- * because of a bug in the application code or in the Jersey code.
- * <p>
- * Trace messages will be primarily output as response headers
- * with a header name of the form "X-Jersey-Trace-XXX", where XXX is a
- * decimal value corresponding to the trace message number, and a header
- * value that is the trace message.
- * <p>
- * In certain cases trace messages will be logged on the server-side if such
- * messages are not suitable as response headers, for example
- * if such messages are too verbose.
- * <p>
- * Trace messages will be output in the same order as traces occur.
- * <p>
- * To log response header trace messages on the server-side enable response
- * logging, see {@link LoggingFilter}.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_TRACE
- = "com.sun.jersey.config.feature.Trace";
-
- /**
- * If true then enable tracing on a per-request basis.
- * <p>
- * Tracing provides useful information that describes how a request
- * is processed and dispatched to JAX-RS/Jersey components. This can aid
- * debugging when the application is not behaving as expected either
- * because of a bug in the application code or in the Jersey code.
- * <p>
- * Trace messages will be output if a request header is present with a
- * header name of "X-Jersey-Trace-Accept" (the header value is ignored).
- * <p>
- * Trace messages will be primarily output as response headers
- * with a header name of the form "X-Jersey-Trace-XXX", where XXX is a
- * decimal value corresponding to the trace message number, and a header
- * value that is the trace message.
- * <p>
- * In certain cases trace messages will be logged on the server-side if such
- * messages are not suitable as response headers, for example
- * if such messages are too verbose.
- * <p>
- * Trace messages will be output in the same order as traces occur.
- * <p>
- * To log response header trace messages on the server-side enable response
- * logging, see {@link LoggingFilter}.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_TRACE_PER_REQUEST
- = "com.sun.jersey.config.feature.TracePerRequest";
-
- /**
- * If set the map of file extension to media type mappings that will be
- * added to the map that is returned from {@link #getMediaTypeMappings() }.
- * <p>
- * This type of this property must be a String or String[] that contains
- * one or more comma separated key value pairs of the form
- * "&lt;key&gt; : &lt;value&gt;, &lt;key&gt; : &lt;value&gt;" where the key
- * is the file extension and the value is the media type. For example,
- * the following declares two mappings for XML and JSON:
- * "xml : application/xml, json : application/json"
- * <p>
- * The value of this property will be validated, and keys/values added to
- * map returned from {@link #getMediaTypeMappings()}, when the
- * {@link #validate()} method is invoked.
- * <p>
- * Validation will verify that media types are valid.
- */
- public static final String PROPERTY_MEDIA_TYPE_MAPPINGS
- = "com.sun.jersey.config.property.MediaTypeMappings";
-
- /**
- * If set the map of file extension to langauge mappings that will be
- * added to the map that is returned from {@link #getLanguageMappings() }.
- * <p>
- * This type of this property must be a String or String[] that contains
- * one or more comma separated key value pairs of the form
- * "&lt;key&gt; : &lt;value&gt;, &lt;key&gt; : &lt;value&gt;" where the key
- * is the file extension and the value is the language tag. For example,
- * the following declares two mappings for the languages "en" and "en-US:
- * "english : en, american : en-US".
- * <p>
- * The value of this property will be validated, and keys/values added to
- * map returned from {@link #getMediaTypeMappings()}, when the
- * {@link #validate()} method is invoked.
- * <p>
- * Validation will verify that language tags are valid according to HTTP/1.1
- * and are of the form:
- * <pre>
- * language-tag = primary-tag *( "-" subtag )
- * primary-tag = 1*8ALPHA
- * subtag = 1*8ALPHA
- * </pre>
- */
- public static final String PROPERTY_LANGUAGE_MAPPINGS
- = "com.sun.jersey.config.property.LanguageMappings";
-
- /**
- * If set the default resource component provider factory for the
- * life-cycle of resource classes.
- * <p>
- * The type of this property must be a Class or a String that is a Class name,
- * and the Class must a sub-class of
- * {@link com.sun.jersey.server.spi.component.ResourceComponentProviderFactory}.
- * <p>
- * If not set the default resource component provider factory will be the
- * per-request resource component provider factory.
- */
- public static final String PROPERTY_DEFAULT_RESOURCE_COMPONENT_PROVIDER_FACTORY_CLASS
- = "com.sun.jersey.config.property.DefaultResourceComponentProviderFactoryClass";
-
- /**
- * If set the instance of {@link ContainerNotifier} to register
- * {@link ContainerListener} instances.
- * <p>
- * If the instance does not implement the {@link ContainerNotifier}
- * then the property is ignored.
- */
- public static final String PROPERTY_CONTAINER_NOTIFIER =
- "com.sun.jersey.spi.container.ContainerNotifier";
-
- /**
- * If set the list of {@link ContainerRequestFilter} that are applied
- * to filter the request. When applying the list of request filters to
- * a request each request filter is applied, in order, from the first to
- * the last entry in the list.
- * <p>
- * The instance may be a String[] or String that contains one or more fully
- * qualified class name of a request filter class separated by ';', ','
- * or ' ' (space).
- * Otherwise the instance may be List containing instances of String,
- * String[], Class&lt;? extends ContainerRequestFilter;&gt; or instances
- * of ContainerRequestFilter.
- * <p>
- * If a String[] or String of fully qualified class names or a Class then
- * each class is instantiated as a singleton. Thus, if there is more than one
- * class registered for this property or the same class is also registered for
- * the {@link #PROPERTY_CONTAINER_RESPONSE_FILTERS} property then only
- * one instance will be instatiated.
- *
- * @see com.sun.jersey.api.container.filter
- */
- public static final String PROPERTY_CONTAINER_REQUEST_FILTERS =
- "com.sun.jersey.spi.container.ContainerRequestFilters";
-
- /**
- * If set the list of {@link ContainerResponseFilter} that are applied
- * to filter the response. When applying the list of response filters to
- * a response each response filter is applied, in order, from the first to
- * the last entry in the list.
- * <p>
- * The instance may be a String[] or String that contains one or more fully
- * qualified class name of a request filter class separated by ';', ','
- * or ' ' (space).
- * Otherwise the instance may be List containing instances of String,
- * String[], Class&lt;? extends ContainerResponseFilter;&gt; or instances
- * of ContainerResponseFilter.
- * <p>
- * If a String[] or String of fully qualified class names or a Class then
- * each class is instantiated as a singleton. Thus, if there is more than one
- * class registered for this property or the same class is also registered for
- * the {@link #PROPERTY_CONTAINER_REQUEST_FILTERS} property then only
- * one instance will be instatiated.
- *
- * @see com.sun.jersey.api.container.filter
- */
- public static final String PROPERTY_CONTAINER_RESPONSE_FILTERS =
- "com.sun.jersey.spi.container.ContainerResponseFilters";
-
- /**
- * If set the list of {@link ResourceFilterFactory} that are applied
- * to resources. When applying the list of resource filters factories to a
- * request each resource filter factory is applied, in order, from the first
- * to last entry in the list.
- * <p>
- * The instance may be a String[] or String that contains one or more fully
- * qualified class name of a response filter class separated by ';', ','
- * or ' ' (space).
- * Otherwise the instance may be List containing instances of String,
- * String[], Class&lt;? extends ResourceFilterFactory;&gt; or instances
- * of ResourceFilterFactory.
- * <p>
- * If a String[] or String of fully qualified class names or a Class then
- * each class is instantiated as a singleton. Thus, if there is more than one
- * class registered for this property one instance will be instatiated.
- *
- * @see com.sun.jersey.api.container.filter
- */
- public static final String PROPERTY_RESOURCE_FILTER_FACTORIES =
- "com.sun.jersey.spi.container.ResourceFilters";
-
- /**
- * If set the wadl generator configuration that provides a {@link WadlGenerator}.
- * <p>
- * The type of this property must be a subclass or an instance of a subclass of
- * {@link com.sun.jersey.api.wadl.config.WadlGeneratorConfig}.
- * </p>
- * <p>
- * If this property is not set the default wadl generator will be used for generating wadl.
- * </p>
- */
- public static final String PROPERTY_WADL_GENERATOR_CONFIG =
- "com.sun.jersey.config.property.WadlGeneratorConfig";
-
- /**
- * Common delimiters used by various properties.
- */
- public static final String COMMON_DELIMITERS = " ,;";
-
- /**
- * Get the map of features associated with the Web application.
- *
- * @return the features.
- * The returned value shall never be null.
- */
- public abstract Map<String, Boolean> getFeatures();
-
- /**
- * Get the value of a feature.
- *
- * @param featureName the feature name.
- * @return true if the feature is present and set to true, otherwise false
- * if the feature is present and set to false or the feature is not
- * present.
- */
- public abstract boolean getFeature(String featureName);
-
- /**
- * Get the map of properties associated with the Web application.
- *
- * @return the properties.
- * The returned value shall never be null.
- */
- public abstract Map<String, Object> getProperties();
-
- /**
- * Get the value of a property.
- *
- * @param propertyName the property name.
- * @return the property, or null if there is no property present for the
- * given property name.
- */
- public abstract Object getProperty(String propertyName);
-
- /**
- * Get a map of file extension to media type. This is used to drive
- * URI-based content negotiation such that, e.g.:
- * <pre>GET /resource.atom</pre>
- * <p>is equivalent to:</p>
- * <pre>GET /resource
- *Accept: application/atom+xml</pre>
- * <p>
- * The default implementation returns an empty map.
- *
- * @return a map of file extension to media type
- */
- public Map<String, MediaType> getMediaTypeMappings() {
- return Collections.emptyMap();
- }
-
- /**
- * Get a map of file extension to language. This is used to drive
- * URI-based content negotiation such that, e.g.:
- * <pre>GET /resource.english</pre>
- * <p>is equivalent to:</p>
- * <pre>GET /resource
- *Accept-Language: en</pre>
- * <p>
- * The default implementation returns an empty map.
- *
- * @return a map of file extension to language
- */
- public Map<String, String> getLanguageMappings() {
- return Collections.emptyMap();
- }
-
- /**
- * Get a map of explicit root resource classes and root resource singleton
- * instances. The default lifecycle for root resource class instances is
- * per-request.
- * <p>
- * The root resource path template is declared using the key in the map. This
- * is a substitute for the declaration of a {@link Path} annotation on a root
- * resource class or singleton instance. The key has the same semantics as the
- * {@link Path#value() }. If such a {@link Path} annotation is present
- * it will be ignored.
- * <p>
- * For example, the following will register two root resources, first
- * a root resource class at the path "class" and a root resource singleton
- * at the path "singleton":
- * <blockquote><pre>
- * getExplicitRootResources().put("class", RootResourceClass.class);
- * getExplicitRootResources().put("singleton", new RootResourceSingleton());
- * </pre></blockquote>
- *
- * @return a map of explicit root resource classes and root resource
- * singleton instances.
- */
- public Map<String, Object> getExplicitRootResources() {
- return Collections.emptyMap();
- }
-
- /**
- * Validate the set of classes and singletons.
- * <p>
- * A registered class is removed from the set of registered classes
- * if an instance of that class is a member of the set of registered
- * singletons.
- * <p>
- * A registered class that is an interface or an abstract class
- * is removed from the registered classes.
- * <p>
- * File extension to media type and language mappings in the properties
- * {@link #PROPERTY_MEDIA_TYPE_MAPPINGS} and {@link #PROPERTY_LANGUAGE_MAPPINGS},
- * respectively, are processed and key/values pairs added to the maps
- * returned from {@link #getMediaTypeMappings() } and
- * {@link #getLanguageMappings() }, respectively. The characters of file
- * extension values will be contextually encoded according to the set of
- * valid characters defined for a path segment.
- *
- * @throws IllegalArgumentException if the set of registered singletons
- * contains more than one instance of the same root resource class,
- * or validation of media type and language mappings failed.
- */
- public void validate() {
- // Remove any registered classes if instances exist in registered
- // singletons
- Iterator<Class<?>> i = getClasses().iterator();
- while (i.hasNext()) {
- Class<?> c = i.next();
- for (Object o : getSingletons()) {
- if (c.isInstance(o)) {
- i.remove();
- LOGGER.log(Level.WARNING,
- "Class " + c.getName() +
- " is ignored as an instance is registered in the set of singletons");
- }
- }
- }
-
- // Find conflicts
- Set<Class<?>> objectClassSet = new HashSet<Class<?>>();
- Set<Class<?>> conflictSet = new HashSet<Class<?>>();
- for (Object o : getSingletons()) {
- if (o.getClass().isAnnotationPresent(Path.class)) {
- if (objectClassSet.contains(o.getClass())) {
- conflictSet.add(o.getClass());
- } else {
- objectClassSet.add(o.getClass());
- }
- }
- }
-
- if (!conflictSet.isEmpty()) {
- for (Class<?> c : conflictSet) {
- LOGGER.log(Level.SEVERE,
- "Root resource class " + c.getName() +
- " is instantiated more than once in the set of registered singletons");
- }
- throw new IllegalArgumentException(
- "The set of registered singletons contains " +
- "more than one instance of the same root resource class");
- }
-
- // parse and validate mediaTypeMappings set thru PROPERTY_MEDIA_TYPE_MAPPINGS property
- parseAndValidateMappings(ResourceConfig.PROPERTY_MEDIA_TYPE_MAPPINGS,
- getMediaTypeMappings(), new TypeParser<MediaType>() {
- public MediaType valueOf(String value) {
- return MediaType.valueOf(value);
- }
- });
-
- // parse and validate language mappings set thru PROPERTY_LANGUAGE_MAPPINGS property
- parseAndValidateMappings(ResourceConfig.PROPERTY_LANGUAGE_MAPPINGS,
- getLanguageMappings(), new TypeParser<String>() {
- public String valueOf(String value) {
- return LanguageTag.valueOf(value).toString();
- }
- });
-
- // encode key values of mediaTypeMappings and languageMappings maps
- encodeKeys(getMediaTypeMappings());
- encodeKeys(getLanguageMappings());
- }
-
- private interface TypeParser<T> {
- public T valueOf(String s);
- }
-
- private <T> void parseAndValidateMappings(String property,
- Map<String, T> mappingsMap, TypeParser<T> parser) {
- Object mappings = getProperty(property);
- if (mappings == null)
- return;
-
- if (mappings instanceof String) {
- parseMappings(property, (String) mappings, mappingsMap, parser);
- } else if (mappings instanceof String[]) {
- final String[] mappingsArray = (String[])mappings;
- for (int i = 0; i < mappingsArray.length; i++)
- parseMappings(property, mappingsArray[i], mappingsMap, parser);
- } else {
- throw new IllegalArgumentException("Provided " + property +
- " mappings is invalid. Acceptable types are String" +
- " and String[].");
- }
- }
-
- private <T> void parseMappings(String property, String mappings,
- Map<String, T> mappingsMap, TypeParser<T> parser) {
- if (mappings == null)
- return;
-
- String[] records = mappings.split(",");
-
- for(int i = 0; i < records.length; i++) {
- String[] record = records[i].split(":");
- if (record.length != 2)
- throw new IllegalArgumentException("Provided " + property +
- " mapping \"" + mappings + "\" is invalid. It " +
- "should contain two parts, key and value, separated by ':'.");
-
- String trimmedSegment = record[0].trim();
- String trimmedValue = record[1].trim();
-
- if (trimmedSegment.length() == 0)
- throw new IllegalArgumentException("The key in " + property +
- " mappings record \"" + records[i] + "\" is empty.");
- if (trimmedValue.length() == 0)
- throw new IllegalArgumentException("The value in " + property +
- " mappings record \"" + records[i] + "\" is empty.");
-
- mappingsMap.put(trimmedSegment, parser.valueOf(trimmedValue));
- }
- }
-
- private <T> void encodeKeys(Map<String, T> map) {
- Map<String, T> tempMap = new HashMap<String, T>();
- for(Map.Entry<String, T> entry : map.entrySet())
- tempMap.put(UriComponent.contextualEncode(entry.getKey(), UriComponent.Type.PATH_SEGMENT), entry.getValue());
- map.clear();
- map.putAll(tempMap);
- }
-
- /**
- * Get the set of root resource classes.
- * <p>
- * A root resource class is a registered class that is annotated with
- * Path.
- *
- * @return the set of root resource classes.
- */
- public Set<Class<?>> getRootResourceClasses() {
- Set<Class<?>> s = new LinkedHashSet<Class<?>>();
-
- for (Class<?> c : getClasses()) {
- if (isRootResourceClass(c))
- s.add(c);
- }
-
- return s;
- }
-
- /**
- * Get the set of provider classes.
- * <p>
- * A provider class is a registered class that is not annotated with
- * Path.
- *
- * @return the set of provider classes.
- */
- public Set<Class<?>> getProviderClasses() {
- Set<Class<?>> s = new LinkedHashSet<Class<?>>();
-
- for (Class<?> c : getClasses()) {
- if (!isRootResourceClass(c))
- s.add(c);
- }
-
- return s;
- }
-
- /**
- * Get the set of root resource singleton instances.
- * <p>
- * A root resource singleton instance is a registered instance whose class
- * is annotated with Path.
- *
- * @return the set of root resource singleton instances.
- */
- public Set<Object> getRootResourceSingletons() {
- Set<Object> s = new LinkedHashSet<Object>();
-
- for (Object o : getSingletons()) {
- if (isRootResourceClass(o.getClass()))
- s.add(o);
- }
-
- return s;
- }
-
- /**
- * Get the set of provider singleton instances.
- * <p>
- * A provider singleton instances is a registered instance whose class
- * is not annotated with Path.
- *
- * @return the set of provider singleton instances.
- */
- public Set<Object> getProviderSingletons() {
- Set<Object> s = new LinkedHashSet<Object>();
-
- for (Object o : getSingletons()) {
- if (!isRootResourceClass(o.getClass()))
- s.add(o);
- }
-
- return s;
- }
-
- /**
- * Determine if a class is a root resource class.
- *
- * @param c the class.
- * @return true if the class is a root resource class, otherwise false
- * (including if the class is null).
- */
- public static boolean isRootResourceClass(Class<?> c) {
- if (c == null)
- return false;
-
- if (c.isAnnotationPresent(Path.class)) return true;
-
- for (Class i : c.getInterfaces())
- if (i.isAnnotationPresent(Path.class)) return true;
-
- return false;
- }
-
- /**
- * Determine if a class is a provider class.
- *
- * @param c the class.
- * @return true if the class is a provider class, otherwise false
- * (including if the class is null)
- */
- public static boolean isProviderClass(Class<?> c) {
- return c != null && c.isAnnotationPresent(Provider.class);
- }
-
- /**
- * Get the list of container request filters.
- * <p>
- * This list may be modified to add or remove filter elements.
- * See {@link #PROPERTY_CONTAINER_REQUEST_FILTERS} for the valid elements
- * of the list.
- *
- * @return the list of container request filters.
- * An empty list will be returned if no filters are present.
- */
- public List getContainerRequestFilters() {
- return getFilterList(PROPERTY_CONTAINER_REQUEST_FILTERS);
- }
-
- /**
- * Get the list of container response filters.
- * <p>
- * This list may be modified to add or remove filter elements.
- * See {@link #PROPERTY_CONTAINER_RESPONSE_FILTERS} for the valid elements
- * of the list.
- *
- * @return the list of container response filters.
- * An empty list will be returned if no filters are present.
- */
- public List getContainerResponseFilters() {
- return getFilterList(PROPERTY_CONTAINER_RESPONSE_FILTERS);
- }
-
- /**
- * Get the list of resource filter factories.
- * <p>
- * This list may be modified to add or remove filter elements.
- * See {@link #PROPERTY_RESOURCE_FILTER_FACTORIES} for the valid elements
- * of the list.
- *
- * @return the list of resource filter factories.
- * An empty list will be returned if no filters are present.
- */
- public List getResourceFilterFactories() {
- return getFilterList(PROPERTY_RESOURCE_FILTER_FACTORIES);
- }
-
- private List getFilterList(String propertyName) {
- final Object o = getProperty(propertyName);
- if (o == null) {
- final List l = new ArrayList();
- getProperties().put(propertyName, l);
- return l;
- } else if (o instanceof List) {
- return (List)o;
- } else {
- final List l = new ArrayList();
- l.add(o);
- getProperties().put(propertyName, l);
- return l;
- }
- }
-
- /**
- * Set the properties and features given a map of entries.
- *
- * @param entries the map of entries. All entries are added as properties.
- * Properties are only added if an existing property does not currently exist.
- *
- * Any entry with a value that is an instance of Boolean is added as a
- * feature with the feature name set to the entry name and the feature value
- * set to the entry value. Any entry with a value that is an instance String
- * and is equal (ignoring case and white space) to "true" or "false" is added
- * as a feature with the feature name set to the entry name and the feature
- * value set to the Boolean value of the entry value. Features are only added
- * if an existing feature does not currently exist.
- */
- public void setPropertiesAndFeatures(Map<String, Object> entries) {
- for (Map.Entry<String, Object> e : entries.entrySet()) {
- if (!getProperties().containsKey(e.getKey())) {
- getProperties().put(e.getKey(), e.getValue());
- }
-
- if (!getFeatures().containsKey(e.getKey())) {
- Object v = e.getValue();
- if (v instanceof String) {
- String sv = ((String)v).trim();
- if (sv.equalsIgnoreCase("true")) {
- getFeatures().put(e.getKey(), true);
- } else if (sv.equalsIgnoreCase("false")) {
- getFeatures().put(e.getKey(), false);
- }
- } else if (v instanceof Boolean) {
- getFeatures().put(e.getKey(), (Boolean)v);
- }
- }
- }
- }
-
- /**
- * Add the state of an {@link Application} to this instance.
- *
- * @param app the application.
- */
- public void add(Application app) {
- if (app.getClasses() != null)
- addAllFirst(getClasses(), app.getClasses());
- if (app.getSingletons() != null)
- addAllFirst(getSingletons(), app.getSingletons());
-
- if (app instanceof ResourceConfig) {
- ResourceConfig rc = (ResourceConfig)app;
-
- getExplicitRootResources().putAll(rc.getExplicitRootResources());
-
- getLanguageMappings().putAll(rc.getLanguageMappings());
- getMediaTypeMappings().putAll(rc.getMediaTypeMappings());
-
- getFeatures().putAll(rc.getFeatures());
- getProperties().putAll(rc.getProperties());
- }
- }
-
- private <T> void addAllFirst(Set<T> a, Set<T> b) {
- Set<T> x = new LinkedHashSet<T>();
- x.addAll(b);
- x.addAll(a);
-
- a.clear();
- a.addAll(x);
- }
-
- /**
- * Clone this resource configuration.
- * <p>
- * The set of classes, set of singletons, map of explicit root resources,
- * map of language mappings, map of media type mappings, map of features and
- * map of properties will be cloned.
- *
- * @return a cloned instance of this resource configuration.
- */
- @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneDoesntDeclareCloneNotSupportedException"})
- @Override
- public ResourceConfig clone() {
- ResourceConfig that = new DefaultResourceConfig();
-
- that.getClasses().addAll(this.getClasses());
- that.getSingletons().addAll(this.getSingletons());
-
- that.getExplicitRootResources().putAll(this.getExplicitRootResources());
-
- that.getLanguageMappings().putAll(this.getLanguageMappings());
- that.getMediaTypeMappings().putAll(this.getMediaTypeMappings());
-
- that.getFeatures().putAll(this.getFeatures());
- that.getProperties().putAll(this.getProperties());
-
- return that;
- }
-
- /**
- * Get a canonical array of String elements from a String array
- * where each entry may contain zero or more elements separated by ';'.
- *
- * @param elements an array where each String entry may contain zero or more
- * ';' separated elements.
- * @return the array of elements, each element is trimmed, the array will
- * not contain any empty or null entries.
- */
- public static String[] getElements(String[] elements) {
- // keeping backwards compatibility
- return getElements(elements, ";");
- }
-
- /**
- * Get a canonical array of String elements from a String array
- * where each entry may contain zero or more elements separated by characters
- * in delimiters string.
- *
- * @param elements an array where each String entry may contain zero or more
- * delimiters separated elements.
- * @param delimiters string with delimiters, every character represents one
- * delimiter.
- * @return the array of elements, each element is trimmed, the array will
- * not contain any empty or null entries.
- */
- public static String[] getElements(String[] elements, String delimiters) {
- List<String> es = new LinkedList<String>();
- for (String element : elements) {
- if (element == null) continue;
- element = element.trim();
- if (element.length() == 0) continue;
- for (String subElement : getElements(element, delimiters)) {
- if (subElement == null || subElement.length() == 0) continue;
- es.add(subElement);
- }
- }
- return es.toArray(new String[es.size()]);
- }
-
- /**
- * Get a canonical array of String elements from a String
- * that may contain zero or more elements separated by characters in
- * delimiters string.
- *
- * @param elements a String that may contain zero or more
- * delimiters separated elements.
- * @param delimiters string with delimiters, every character represents one
- * delimiter.
- * @return the array of elements, each element is trimmed.
- */
- private static String[] getElements(String elements, String delimiters) {
- String regex = "[";
- for(char c : delimiters.toCharArray())
- regex += Pattern.quote(String.valueOf(c));
- regex += "]";
-
- String[] es = elements.split(regex);
- for (int i = 0; i < es.length; i++) {
- es[i] = es[i].trim();
- }
- return es;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfigurator.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfigurator.java
deleted file mode 100644
index 1a89361087b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceConfigurator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-/**
- * A provider to be utilized when configuration of {@link ResourceConfig} is
- * required.
- *
- * @author Viktor Klang
- */
-public interface ResourceConfigurator {
-
- /**
- * Configure the resource configuration.
- *
- * @param config the resource configuration to be configured.
- */
- public void configure(ResourceConfig config);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceContext.java
deleted file mode 100644
index f1cbfc73397..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ResourceContext.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.api.container.ContainerException;
-import java.net.URI;
-import javax.ws.rs.core.Context;
-
-/**
- * The resource context provides access to instances of resource classes.
- * <p>
- * This interface can be injected using the {@link Context} annotation.
- * <p>
- * The resource context can be utilized when instances of managed resource
- * classes are to be returned by sub-resource locator methods. Such instances
- * will be injected and managed within the declared scope just like instances
- * of root resource classes.
- * <p>
- * The resource context can be utilized when matching of URIs are
- * required, for example when validating URIs sent in a request entity.
- * Note that application functionality may be affected as the matching
- * process will result in the construction or sharing of previously constructed
- * resource classes that are in scope of the HTTP request, and the invocation of
- * matching sub-resource locator methods. No resource methods wll be invoked.
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ResourceContext {
-
- /**
- * Match a URI to URI information.
- * <p>
- * If the URI is relative then the base URI of the application will be
- * used to resolve the relative URI to an absolute URI.
- * If the URI is absolute then it must be relative to the base URI of the
- * application.
- *
- * @param u the URI.
- * @return the URI information, otherwise null if the URI cannot be matched.
- * @throws ContainerException if there is an error when matching.
- */
- ExtendedUriInfo matchUriInfo(URI u) throws ContainerException;
-
- /**
- * Match a URI to a resource instance.
- * <p>
- * If the URI is relative then the base URI of the application will be
- * used to resolve the relative URI to an absolute URI.
- * If the URI is absolute then it must be relative to the base URI of the
- * application.
- *
- * @param u the URI.
- * @return the resource instance, otherwise null if the URI cannot be
- * matched.
- * @throws ContainerException if there is an error when matching.
- */
- Object matchResource(URI u) throws ContainerException;
-
- /**
- * Match a URI to a resource instance.
- * <p>
- * If the URI is relative then the base URI of the application will be
- * used to resolve the relative URI to an absolute URI.
- * If the URI is absolute then it must be relative to the base URI of the
- * application.
- *
- * @param <T> the type of the resource.
- * @param u the URI.
- * @param c the resource class.
- * @return the resource instance, otherwise null if the URI cannot be
- * matched.
- * @throws ContainerException if there is an error when matching.
- * @throws ClassCastException if the resource instance cannot be cast to
- * <code>c</code>.
- */
- <T> T matchResource(URI u, Class<T> c) throws ContainerException, ClassCastException;
-
- /**
- * Provides an instance of the given resource class.
- *
- * @param <T> the type of the resource class
- * @param c the resource class
- * @return an instance if it could be resolved, otherwise null.
- * @throws com.sun.jersey.api.container.ContainerException if the resource
- * class cannot be found.
- */
- <T> T getResource(Class<T> c) throws ContainerException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ScanningResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ScanningResourceConfig.java
deleted file mode 100644
index 6d3a8cc45cc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/ScanningResourceConfig.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.core.spi.scanning.Scanner;
-import com.sun.jersey.spi.container.ReloadListener;
-import com.sun.jersey.spi.scanning.AnnotationScannerListener;
-import com.sun.jersey.spi.scanning.PathProviderScannerListener;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.ext.Provider;
-import java.lang.annotation.Annotation;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A resource configuration that performs scanning to find root resource
- * and provider classes.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ScanningResourceConfig extends DefaultResourceConfig implements ReloadListener {
- private static final Logger LOGGER =
- Logger.getLogger(ScanningResourceConfig.class.getName());
-
- private Scanner scanner;
-
- private final Set<Class<?>> cachedClasses = new HashSet<Class<?>>();
-
- /**
- * Initialize and scan for root resource and provider classes
- * using a scanner.
- *
- * @param scanner the scanner.
- */
- public void init(final Scanner scanner) {
- this.scanner = scanner;
-
- final AnnotationScannerListener asl = new PathProviderScannerListener();
- scanner.scan(asl);
-
- getClasses().addAll(asl.getAnnotatedClasses());
-
- if (LOGGER.isLoggable(Level.INFO) && !getClasses().isEmpty()) {
- final Set<Class> rootResourceClasses = get(Path.class);
- if (rootResourceClasses.isEmpty()) {
- LOGGER.log(Level.INFO, "No root resource classes found.");
- } else {
- logClasses("Root resource classes found:", rootResourceClasses);
- }
-
- final Set<Class> providerClasses = get(Provider.class);
- if (providerClasses.isEmpty()) {
- LOGGER.log(Level.INFO, "No provider classes found.");
- } else {
- logClasses("Provider classes found:", providerClasses);
- }
-
- }
-
- cachedClasses.clear();
- cachedClasses.addAll(getClasses());
- }
-
- /**
- * Perform a new search for resource classes and provider classes.
- * <p/>
- * Deprecated, use onReload instead.
- */
- @Deprecated
- public void reload() {
- onReload();
- }
-
- /**
- * Perform a new search for resource classes and provider classes.
- */
- @Override
- public void onReload() {
- Set<Class<?>> classesToRemove = new HashSet<Class<?>>();
- Set<Class<?>> classesToAdd = new HashSet<Class<?>>();
-
- for(Class c : getClasses())
- if(!cachedClasses.contains(c))
- classesToAdd.add(c);
-
- for(Class c : cachedClasses)
- if(!getClasses().contains(c))
- classesToRemove.add(c);
-
- getClasses().clear();
-
- init(scanner);
-
- getClasses().addAll(classesToAdd);
- getClasses().removeAll(classesToRemove);
- }
-
- private Set<Class> get(Class<? extends Annotation> ac) {
- Set<Class> s = new HashSet<Class>();
- for (Class c : getClasses())
- if (c.isAnnotationPresent(ac))
- s.add(c);
- return s;
- }
-
- private void logClasses(String s, Set<Class> classes) {
- final StringBuilder b = new StringBuilder();
- b.append(s);
- for (Class c : classes)
- b.append('\n').append(" ").append(c);
-
- LOGGER.log(Level.INFO, b.toString());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/TraceInformation.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/TraceInformation.java
deleted file mode 100644
index 780e611eb03..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/TraceInformation.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.server.impl.application.WebApplicationContext;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class TraceInformation {
- private final List<String> traces = new ArrayList<String>();
-
- private final WebApplicationContext c;
-
- public TraceInformation(WebApplicationContext c) {
- this.c = c;
- }
-
- public void trace(String message) {
- traces.add(message);
- }
-
- public void addTraceHeaders() {
- addTraceHeaders(new TraceHeaderListener() {
- public void onHeader(String name, String value) {
- c.getContainerResponse().getHttpHeaders().add(name, value);
- }
- });
- }
-
- public static interface TraceHeaderListener {
- void onHeader(String name, String value);
- }
-
- public void addTraceHeaders(TraceHeaderListener x) {
- for (int i = 0; i < traces.size(); i++) {
- x.onHeader(String.format("X-Jersey-Trace-%03d", i),
- traces.get(i));
- }
- traces.clear();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/Traceable.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/Traceable.java
deleted file mode 100644
index 1e0355cdccd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/Traceable.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-/**
- * Traceable support for checking if tracing is enabled and to add trace
- * messages.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface Traceable {
-
- /**
- * Check if tracing is enabled.
- *
- * @return true if tracing is enabled, otherwise false.
- */
- boolean isTracingEnabled();
-
- /**
- * Add a trace message.
- * <p>
- * A trace message will be added if {@link #isTracingEnabled()} returns
- * true and tracing contraints are satisfied.
- *
- * @param message the trace message to add.
- */
- void trace(String message);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/WebAppResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/WebAppResourceConfig.java
deleted file mode 100644
index 9962da2abde..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/WebAppResourceConfig.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.core;
-
-import com.sun.jersey.spi.scanning.WebAppResourcesScanner;
-
-import javax.servlet.ServletContext;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A mutable implementation of {@link DefaultResourceConfig} that dynamically
- * searches for root resource and provider classes in the Web application
- * resource paths declared by the property
- * {@link ClasspathResourceConfig#PROPERTY_CLASSPATH}.
- * If that property is not included in the map of initial properties passed to
- * the constructor then the Web application paths "WEB-INF/lib" and
- * "WEB-INF/classes" are utlized.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WebAppResourceConfig extends ScanningResourceConfig {
-
- private static final Logger LOGGER =
- Logger.getLogger(WebAppResourceConfig.class.getName());
-
- /**
- * @param props the property bag that contains the property
- * {@link ClasspathResourceConfig#PROPERTY_CLASSPATH}.
- * @param sc the servlet context.
- */
- public WebAppResourceConfig(Map<String, Object> props, ServletContext sc) {
- this(getPaths(props), sc);
-
- setPropertiesAndFeatures(props);
- }
-
- /**
- * @param paths the array paths consisting of either jar files or
- * directories containing jar files for class files.
- * @param sc the servlet context.
- */
- public WebAppResourceConfig(String[] paths, ServletContext sc) {
- if (paths == null || paths.length == 0)
- throw new IllegalArgumentException(
- "Array of paths must not be null or empty");
-
- init(paths, sc);
- }
-
- private void init(String[] paths, ServletContext sc) {
- if (LOGGER.isLoggable(Level.INFO)) {
- StringBuilder b = new StringBuilder();
- b.append("Scanning for root resource and provider classes in the Web app resource paths:");
- for (String p : paths)
- b.append('\n').append(" ").append(p);
-
- LOGGER.log(Level.INFO, b.toString());
- }
-
- init(new WebAppResourcesScanner(paths, sc));
- }
-
- private static String[] getPaths(Map<String, Object> props) {
- Object v = props.get(ClasspathResourceConfig.PROPERTY_CLASSPATH);
- if (v == null) {
- return new String[]{ "/WEB-INF/lib", "/WEB-INF/classes" };
- }
-
- String[] paths = getPaths(v);
- if (paths.length == 0)
- throw new IllegalArgumentException(
- ClasspathResourceConfig.PROPERTY_CLASSPATH +
- " contains no paths");
-
- return paths;
- }
-
- private static String[] getPaths(Object param) {
- if (param instanceof String) {
- return getElements(new String[] { (String)param });
- } else if (param instanceof String[]) {
- return getElements((String[])param);
- } else {
- throw new IllegalArgumentException(
- ClasspathResourceConfig.PROPERTY_CLASSPATH + " must " +
- "have a property value of type String or String[]");
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/core/package-info.java
deleted file mode 100644
index ff16b54e80b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/core/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for configuration.
- */
-package com.sun.jersey.api.core; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfigurated.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfigurated.java
deleted file mode 100644
index b4564e9f3e5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfigurated.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.json;
-
-/**
- * An interface declaring a JSON configuration is available.
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public interface JSONConfigurated {
-
- /**
- * Provides information on current JSON configuration options for this object.
- *
- * @return a non-null {@link JSONConfiguration} instance.
- */
- public JSONConfiguration getJSONConfiguration();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfiguration.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfiguration.java
deleted file mode 100644
index bf84ddb8e39..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONConfiguration.java
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.json;
-
-import com.sun.jersey.json.impl.ImplMessages;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An immutable configuration of JSON notation and options. JSONConfiguration could be used
- * for configuring the JSON notation on {@link JSONJAXBContext}
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class JSONConfiguration {
-
- /**
- * A ResourceConfig feature, which allows you to enable JSON/POJO mapping functionality
- * in Jersey. If set to true, your application will be capable of transforming JSON
- * data to and out of POJOs. This also includes any JAXB beans existing in your
- * application. I.e. all those beans would not be processed via XML, but rather
- * directly marshaled and un-marshaled to and from JSON using the POJO mapping functionality.
- */
- public final static String FEATURE_POJO_MAPPING
- = "com.sun.jersey.api.json.POJOMappingFeature";
-
- /**
- * Enumeration of supported JSON notations.
- */
- public enum Notation {
-
- /**
- * The mapped (default) JSON notation.
- * <p>Example JSON expression:<pre>
- * {"columns":[{"id":"userid","label":"UserID"},{"id":"name","label":"User Name"}],"rows":{"userid":"1621","name":"Grotefend"}}
- * </pre>
- */
- MAPPED,
- /**
- * The mapped Jettison JSON notation.
- * <p>Example JSON expression:<pre>
- * {"userTable":{"columns":[{"id":"userid","label":"UserID"},{"id":"name","label":"User Name"}],"rows":{"userid":1621,"name":"Grotefend"}}}
- * </pre>
- */
- MAPPED_JETTISON,
- /**
- * The mapped Badgerfish JSON notation.
- * <p>Example JSON expression:<pre>
- * {"userTable":{"columns":[{"id":{"$":"userid"},"label":{"$":"UserID"}},{"id":{"$":"name"},"label":{"$":"User Name"}}],"rows":{"userid":{"$":"1621"},"name":{"$":"Grotefend"}}}}
- * </pre>
- */
- BADGERFISH,
- /**
- * The natural JSON notation, leveraging closely-coupled JAXB RI integration.
- * <p>Example JSON expression:<pre>
- * {"columns":[{"id":"userid","label":"UserID"},{"id":"name","label":"User Name"}],"rows":[{"userid":1621,"name":"Grotefend"}]}
- * </pre>
- */
- NATURAL
- };
-
- private final Notation notation;
- private final Collection<String> arrays;
- private final Collection<String> attrsAsElems;
- private final Collection<String> nonStrings;
- private final boolean rootUnwrapping;
- private final boolean humanReadableFormatting;
- private final Map<String, String> jsonXml2JsonNs;
- private final boolean usePrefixAtNaturalAttributes;
- private final Character namespaceSeparator;
-
- /**
- * Builder class for constructing {@link JSONConfiguration} options
- */
- public static class Builder {
-
- private final Notation notation;
- protected Collection<String> arrays = new HashSet<String>(0);
- protected Collection<String> attrsAsElems = new HashSet<String>(0);
- protected Collection<String> nonStrings = new HashSet<String>(0);
- protected boolean rootUnwrapping = true;
- protected boolean humanReadableFormatting = false;
- protected Map<String, String> jsonXml2JsonNs = new HashMap<String, String>(0);
- protected boolean usePrefixAtNaturalAttributes = false;
- protected Character namespaceSeparator = '.';
-
- private Builder(Notation notation) {
- this.notation = notation;
- }
-
- /**
- * Constructs a new immutable {@link JSONConfiguration} object based on options set on this Builder
- *
- * @return a non-null {@link JSONConfiguration} instance
- */
- public JSONConfiguration build() {
- return new JSONConfiguration(this);
- }
-
- private void copyAttributes(JSONConfiguration jc) {
- arrays.addAll(jc.getArrays());
- attrsAsElems.addAll(jc.getAttributeAsElements());
- nonStrings.addAll(jc.getNonStrings());
- rootUnwrapping = jc.isRootUnwrapping();
- humanReadableFormatting = jc.isHumanReadableFormatting();
- jsonXml2JsonNs.putAll(jc.getXml2JsonNs());
- usePrefixAtNaturalAttributes = jc.isUsingPrefixesAtNaturalAttributes();
- namespaceSeparator = jc.getNsSeparator();
- }
- }
-
- /**
- * Builder class for constructing {@link JSONConfiguration} options
- * for the {@link Notation#NATURAL} convention.
- */
- public static class NaturalBuilder extends Builder {
-
- private NaturalBuilder(Notation notation) {
- super(notation);
- }
-
- /**
- * Setter for XML root element unwrapping.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED}
- * and {@link JSONConfiguration.Notation#NATURAL} notations only.
- * <p>
- * If set to true, JSON code corresponding to the XML root element will be stripped out
- * <p>
- * The default value is false.
- * @param rootUnwrapping if set to true, JSON code corresponding to the
- * XML root element will be stripped out.
- * @return the natural builder.
- */
- public NaturalBuilder rootUnwrapping(boolean rootUnwrapping) {
- this.rootUnwrapping = rootUnwrapping;
- return this;
- }
-
- /**
- * If set to true, generated JSON will contain new-line characters and indentation, so that
- * the output is easy to read for people.
- * This property is valid for the {@link JSONConfiguration.Notation#NATURAL} notation only.
- * <p>
- * The default value is false.
- * @param humanReadableFormatting
- * @return the natural builder.
- */
- public NaturalBuilder humanReadableFormatting(boolean humanReadableFormatting) {
- this.humanReadableFormatting = humanReadableFormatting;
- return this;
- }
- /**
- * JSON names corresponding to XML attributes will be written using a '@' prefix
- * This property is valid for the {@link JSONConfiguration.Notation#NATURAL} notation only.
- * @return the natural builder.
- */
- public NaturalBuilder usePrefixesAtNaturalAttributes() {
- this.usePrefixAtNaturalAttributes = true;
- return this;
- }
- }
-
- /**
- * Builder class for constructing {@link JSONConfiguration} options
- * for the {@link Notation#MAPPED_JETTISON} convention.
- */
- public static class MappedJettisonBuilder extends Builder {
-
- private MappedJettisonBuilder(Notation notation) {
- super(notation);
- rootUnwrapping = false;
- }
-
- /**
- * Setter for XML to JSON namespace mapping.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED_JETTISON}
- * and {@link JSONConfiguration.Notation#MAPPED} notations only.
- * <p>
- * The value is a map with zero or more
- * key/value pairs, where the key is an XML namespace and the value
- * is the prefix to use as the replacement for the XML namespace.
- * <p>
- * The default value is a map with zero key/value pairs.
- */
- public MappedJettisonBuilder xml2JsonNs(Map<String, String> jsonXml2JsonNs) {
- this.jsonXml2JsonNs = jsonXml2JsonNs;
- return this;
- }
- }
-
- /**
- * Builder class for constructing {@link JSONConfiguration} options
- * for the {@link Notation#MAPPED} convention.
- */
- public static class MappedBuilder extends Builder {
-
- private MappedBuilder(Notation notation) {
- super(notation);
- }
-
- /**
- * Adds name(s) to JSON arrays configuration property.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * <p>
- * The property value is a collection of strings representing JSON object names.
- * Those objects will be declared as arrays in JSON document.
- * <p>
- * For example, consider that the property value is not set and the
- * JSON document is <code>{ ..., "arr1":"single element", ... }</code>.
- * If the property value is set to contain <code>"arr1"</code> then
- * the JSON document would become <code>{ ..., "arr1":["single element"], ... }</code>.
- * <p>
- * The default value is an empty collection.
- * @param arrays an array of strings representing JSON object names.
- * @return the mapped builder.
- */
- public MappedBuilder arrays(String... arrays) {
- this.arrays.addAll(Arrays.asList(arrays));
- return this;
- }
-
- /**
- * Adds name(s) toJSON attributes as elements property.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * <p>
- * The value is a collection of string values that are
- * object names that correspond to XML attribute information items.
- * The value of an object name in the JSON document that exists in the collection
- * of object names will be declared as an element as not as an attribute if
- * the object corresponds to an XML attribute information item.
- * <p>
- * For example, consider that the property value is not set and the
- * JSON document is <code>{ ..., "@number":"12", ... }</code>.
- * If the property value is set to contain <code>"number"</code>
- * then the JSON document would be <code>{ ..., "number":"12", ... }</code>.
- * <p>
- * The default value is an empty collection.
- * @param attributeAsElements an array of string values that are
- * object names that correspond to XML attribute information items.
- * @return the mapped builder.
- */
- public MappedBuilder attributeAsElement(String... attributeAsElements) {
- this.attrsAsElems.addAll(Arrays.asList(attributeAsElements));
- return this;
- }
-
- /**
- * Adds name(s) JSON non-string values property.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * <p>
- * The value is collection of string values that are
- * object names.
- * The value of an object name in the JSON document that exists in the collection
- * of object names will be declared as non-string value, which is not surrounded
- * by double quotes.
- * <p>
- * For example, consider that the property value is not set and the
- * JSON document is <code>{ ..., "anumber":"12", ... }</code>.
- * If the property value is set to contain <code>"anumber"</code>
- * then the JSON document would be <code>{ ..., "anumber":12, ... }</code>.
- * <p>
- * The default value is an empty collection.
- * @param nonStrings an array of string values that are
- * object names
- * @return the mapped builder.
- */
- public MappedBuilder nonStrings(String... nonStrings) {
- this.nonStrings.addAll(Arrays.asList(nonStrings));
- return this;
- }
-
- /**
- * Setter for XML to JSON namespace mapping.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED_JETTISON}
- * and {@link JSONConfiguration.Notation#MAPPED} notations only.
- * <p>
- * The value is a map with zero or more
- * key/value pairs, where the key is an XML namespace and the value
- * is the prefix to use as the replacement for the XML namespace.
- * <p>
- * The default value is a map with zero key/value pairs.
- */
- public MappedBuilder xml2JsonNs(Map<String, String> jsonXml2JsonNs) {
- this.jsonXml2JsonNs = jsonXml2JsonNs;
- return this;
- }
-
-
- /**
- * Setter for XML namespace separator.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * <p>
- * The value is a character used to separate a namespace identifier from the name
- * of a XML attribute/element in JSON.
- * <p>
- * The default value is dot character ('.').
- */
- public MappedBuilder nsSeparator(Character separator) {
- if (separator == null) {
- throw new NullPointerException("Namespace separator can not be null!");
- }
- this.namespaceSeparator = separator;
- return this;
- }
-
- /**
- * Setter for XML root element unwrapping.
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED}
- * and {@link JSONConfiguration.Notation#NATURAL} notations only.
- * <p>
- * If set to true, JSON code corresponding to the XML root element will be stripped out
- * <p>
- * The default value is false.
- * @param rootUnwrapping if set to true, JSON code corresponding to the
- * XML root element will be stripped out.
- * @return the mapped builder.
- */
- public MappedBuilder rootUnwrapping(boolean rootUnwrapping) {
- this.rootUnwrapping = rootUnwrapping;
- return this;
- }
- }
-
- private JSONConfiguration(Builder b) {
- notation = b.notation;
- arrays = b.arrays;
- attrsAsElems = b.attrsAsElems;
- nonStrings = b.nonStrings;
- rootUnwrapping = b.rootUnwrapping;
- humanReadableFormatting = b.humanReadableFormatting;
- jsonXml2JsonNs = b.jsonXml2JsonNs;
- usePrefixAtNaturalAttributes = b.usePrefixAtNaturalAttributes;
- namespaceSeparator = b.namespaceSeparator;
- }
-
- /**
- * A static method for obtaining {@link JSONConfiguration} instance with humanReadableFormatting
- * set according to formatted parameter.
- *
- * @param c original instance of {@link JSONConfiguration}, can't be null
- * @param formatted
- * @return copy of provided {@link JSONConfiguration} with humanReadableFormatting set to formatted.
- * @throws IllegalArgumentException when provided JSONConfiguration is null.
- */
- public static JSONConfiguration createJSONConfigurationWithFormatted(JSONConfiguration c, boolean formatted) throws IllegalArgumentException {
-
- if(c == null) {
- throw new IllegalArgumentException("JSONConfiguration can't be null");
- }
-
- if (c.isHumanReadableFormatting() == formatted) {
- return c;
- }
-
- Builder b = copyBuilder(c);
- b.humanReadableFormatting = formatted;
-
- return b.build();
- }
-
- /**
- * A static method for obtaining {@link JSONConfiguration} instance with rootUnwrapping
- * set according to formatted parameter.
- *
- * @param c original instance of {@link JSONConfiguration}, can't be null
- * @param rootUnwrapping
- * @return copy of provided {@link JSONConfiguration} with humanReadableFormatting set to formatted.
- * @throws IllegalArgumentException when provided JSONConfiguration is null.
- */
- public static JSONConfiguration createJSONConfigurationWithRootUnwrapping(JSONConfiguration c, boolean rootUnwrapping) throws IllegalArgumentException {
-
- if(c == null){
- throw new IllegalArgumentException("JSONConfiguration can't be null");
- }
-
- if (c.isRootUnwrapping() == rootUnwrapping) {
- return c;
- }
-
- Builder b = copyBuilder(c);
- b.rootUnwrapping = rootUnwrapping;
-
- return b.build();
- }
-
- /**
- * The default JSONConfiguration uses {@link JSONConfiguration.Notation#MAPPED} notation with root unwrapping option set to true.
- */
- public static final JSONConfiguration DEFAULT = mapped().rootUnwrapping(true).build();
-
- /**
- * A static method for obtaining a builder of {@link JSONConfiguration} instance, which will use {@link Notation#NATURAL} JSON notation.
- * After getting the builder, you can set configuration options on it, and finally get an immutable JSONConfiguration
- * instance using the {@link Builder#build() } method.
- *
- * @return a builder for JSONConfiguration instance
- */
- public static NaturalBuilder natural() {
- // this is to make sure people trying to use NATURAL notation will get clear message what is missing, when an old JAXB RI version is used
- try {
- Class.forName("com.sun.xml.bind.annotation.OverrideAnnotationOf");
- } catch (ClassNotFoundException ex) {
- Logger.getLogger(JSONConfiguration.class.getName()).log(Level.SEVERE, ImplMessages.ERROR_JAXB_RI_2_1_10_MISSING());
- throw new RuntimeException(ImplMessages.ERROR_JAXB_RI_2_1_10_MISSING());
- }
- return new NaturalBuilder(Notation.NATURAL);
- }
-
- /**
- * A static method for obtaining a builder of {@link JSONConfiguration} instance, which will use {@link Notation#MAPPED} JSON notation.
- * After getting the builder, you can set configuration options on it and finally get an immutable JSONConfiguration
- * instance the using {@link Builder#build() } method.
- *
- * @return a builder for JSONConfiguration instance
- */
- public static MappedBuilder mapped() {
- return new MappedBuilder(Notation.MAPPED);
- }
-
- /**
- * A static method for obtaining a builder of {@link JSONConfiguration} instance, which will use {@link Notation#MAPPED_JETTISON} JSON notation.
- * After getting the builder, you can set configuration options on it and finally get an immutable JSONConfiguration
- * instance using the {@link Builder#build() } method.
- *
- * @return a builder for JSONConfiguration instance
- */
- public static MappedJettisonBuilder mappedJettison() {
- return new MappedJettisonBuilder(Notation.MAPPED_JETTISON);
- }
-
- /**
- * A static method for obtaining a builder of {@link JSONConfiguration} instance, which will use {@link Notation#BADGERFISH} JSON notation.
- * After getting the builder, you can set configuration options on it and finally get an immutable JSONConfiguration
- * instance using the {@link Builder#build() } method.
- *
- * @return a builder for JSONConfiguration instance
- */
- public static Builder badgerFish() {
- Builder badgerFishBuilder = new Builder(Notation.BADGERFISH);
- badgerFishBuilder.rootUnwrapping = false;
- return badgerFishBuilder;
- }
-
- public static Builder copyBuilder(final JSONConfiguration jc) {
-
- Builder result = new Builder(jc.getNotation());
-
- switch (jc.notation) {
- case BADGERFISH:
- result = new Builder(jc.getNotation());
- break;
- case MAPPED_JETTISON:
- result = new MappedJettisonBuilder(jc.getNotation());
- break;
- case MAPPED:
- result = new MappedBuilder(jc.getNotation());
- break;
- case NATURAL:
- result = new NaturalBuilder(jc.getNotation());
- break;
- }
-
- result.copyAttributes(jc);
-
- return result;
- }
-
-
- /**
- * Returns JSON notation selected for this configuration
- * @return JSON notation
- */
- public Notation getNotation() {
- return notation;
- }
-
- /**
- * Returns JSON array names property
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * @return collection of array names
- * @see MappedBuilder#arrays(java.lang.String...)
- */
- public Collection<String> getArrays() {
- return (arrays != null) ? Collections.unmodifiableCollection(arrays) : null;
- }
-
- /**
- * Returns names of attributes, which will be handled as elements
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * @return attribute as element names collection
- * @see MappedBuilder#attributeAsElement(java.lang.String...)
- */
- public Collection<String> getAttributeAsElements() {
- return (attrsAsElems != null) ? Collections.unmodifiableCollection(attrsAsElems) : null;
- }
-
- /**
- * Returns a map for XML to JSON namespace mapping
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * @return a map for XML to JSON namespace mapping
- * @see MappedBuilder#xml2JsonNs(java.util.Map)
- */
- public Map<String, String> getXml2JsonNs() {
- return (jsonXml2JsonNs != null) ? Collections.unmodifiableMap(jsonXml2JsonNs) : null;
- }
-
- /**
- * Returns XML namespace separator, which is used when constructing JSON identifiers
- * for XML elements/attributes in other than default namespace
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * @return XML namespace separator character
- * @see MappedBuilder#nsSeparator(java.lang.Character)
- */
- public Character getNsSeparator() {
- return namespaceSeparator;
- }
-
- /**
- * Returns names of JSON objects, which will be serialized out as non-strings, i.e. without delimiting their values with double quotes
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED} notation only.
- * @return name of non-string JSON objects
- * @see MappedBuilder#nonStrings(java.lang.String...)
- */
- public Collection<String> getNonStrings() {
- return (nonStrings != null) ? Collections.unmodifiableCollection(nonStrings) : null;
- }
-
- /**
- * Says if the root element will be stripped off
- * This property is valid for the {@link JSONConfiguration.Notation#MAPPED}
- * and {@link Notation#NATURAL} notations.
- * @return true, if root element has to be stripped off
- * @see MappedBuilder#rootUnwrapping(boolean)
- */
- public boolean isRootUnwrapping() {
- return rootUnwrapping;
- }
-
- /**
- * Says if the JSON names corresponding to XML attributes should use a '@' prefix.
- * This property is valid for the {@link JSONConfiguration.Notation#NATURAL} notation only.
- * @return true, if prefixes are added
- * @see NaturalBuilder#usePrefixesAtNaturalAttributes()
- */
- public boolean isUsingPrefixesAtNaturalAttributes() {
- return usePrefixAtNaturalAttributes;
- }
-
- /**
- * Says if the output JSON will be formatted with new-line characters
- * and indentation so that it is easy to read for people.
- * This property is valid for the {@link JSONConfiguration.Notation#NATURAL} notation only.
- * @return true, if formatting is applied on the output JSON
- * @see NaturalBuilder#humanReadableFormatting(boolean)
- */
- public boolean isHumanReadableFormatting() {
- return humanReadableFormatting;
- }
-
- @Override
- public String toString() {
- return String.format("{notation:%s,rootStripping:%b}", notation, rootUnwrapping);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONJAXBContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONJAXBContext.java
deleted file mode 100644
index b371073ebe4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONJAXBContext.java
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.json;
-
-import com.sun.jersey.json.impl.BaseJSONMarshaller;
-import com.sun.jersey.json.impl.BaseJSONUnmarshaller;
-import com.sun.jersey.json.impl.JSONMarshallerImpl;
-import com.sun.jersey.json.impl.JSONUnmarshallerImpl;
-import com.sun.xml.bind.v2.runtime.JAXBContextImpl;
-
-import javax.xml.bind.*;
-import java.util.*;
-
-/**
- * An adaption of {@link JAXBContext} that supports marshalling
- * and unmarshalling of JAXB beans using the JSON format.
- * <p>
- * The JSON format may be configured by using a {@link JSONConfiguration} object
- * as a constructor parameter of this class.
- */
-public final class JSONJAXBContext extends JAXBContext implements JSONConfigurated {
-
- /**
- * A namespace for JSONJAXBContext related properties names.
- */
- @Deprecated
- public static final String NAMESPACE = "com.sun.jersey.impl.json.";
-
- /**
- * Enumeration of supported JSON notations.
- */
- @Deprecated
- public enum JSONNotation {
-
- /**
- * The mapped (default) JSON notation.
- */
- @Deprecated
- MAPPED,
- /**
- * The mapped Jettison JSON notation.
- */
- @Deprecated
- MAPPED_JETTISON,
- /**
- * The mapped Badgerfish JSON notation.
- */
- @Deprecated
- BADGERFISH,
- /**
- * The natural JSON notation, leveraging tight JAXB RI integration.
- */
- @Deprecated
- NATURAL
- };
- /**
- * JSON notation property is now deprecated. See {@link JSONConfiguration}.
- * <p>
- * The type of this property is enum type {@link JSONNotation}.
- * <p>
- * The value may be one of the following that are the currently supported JSON
- * notations: <code>JSONNotation.MAPPED</code>,
- * <code>JSONNotation.MAPPED_JETTISON</code> and <code>JSONNotation.BADGERFISH</code>
- * <p>
- * The default value is <code>JSONNotation.MAPPED</code>.
- */
- @Deprecated
- public static final String JSON_NOTATION = NAMESPACE + "notation";
- /**
- * JSON enabled property is now deprecated. See {@link JSONConfiguration}.
- * <p>
- * The type of this property is {@link Boolean}
- * <p>
- * If set to true, JSON will be serialized/deserialized instead of XML
- * <p>
- * The default value is false.
- */
- @Deprecated
- public static final String JSON_ENABLED = NAMESPACE + "enabled";
- /**
- * XML root element unwrapping property is now deprecated. See {@link JSONConfiguration}.
- * <p>
- * The type of this property is {@link Boolean}
- * <p>
- * If set to true, JSON code corresponding to the XML root element will be stripped out
- * for <code>JSONNotation.MAPPED</code> (default) notation.
- * <p>
- * The default value is false.
- */
- @Deprecated
- public static final String JSON_ROOT_UNWRAPPING = NAMESPACE + "root.unwrapping";
- /**
- * JSON arrays property is now deprecated. See {@link JSONConfiguration}.
- * This property is valid for the <code>JSONNotation.MAPPED</code> notation only.
- * <p>
- * The type of this property is <code>java.util.Collection&lt;String&gt;</code>.
- * <p>
- * The value is a collection of string values that are
- * object names.
- * The value of an object name in the JSON document that exists in the collection
- * of object names will be declared as an array, even if only one
- * element is present.
- * <p>
- * For example, consider that the property value is not set and the
- * JSON document is <code>{ ..., "arr1":"single element", ... }</code>.
- * If the property value is set to contain <code>"arr1"</code> then
- * the JSON document would be <code>{ ..., "arr1":["single element"], ... }</code>.
- * <p>
- * The default value is an empty collection.
- */
- @Deprecated
- public static final String JSON_ARRAYS = NAMESPACE + "arrays";
- /**
- * JSON non-string values property is now deprecated. See {@link JSONConfiguration}.
- * This property is valid for the <code>JSONNotation.MAPPED</code> notation only.
- * <p>
- * The type of this property is <code>Collection&lt;String&gt;</code>.
- * <p>
- * The value is collection of string values that are
- * object names.
- * The value of an object name in the JSON document that exists in the collection
- * of object names will be declared as non-string value, which is not surrounded
- * by double quotes.
- * <p>
- * For example, consider that the property value is not set and the
- * JSON document is <code>{ ..., "anumber":"12", ... }</code>.
- * If the property value is set to contain <code>"anumber"</code>
- * then the JSON document would be <code>{ ..., "anumber":12, ... }</code>.
- * <p>
- * The default value is an empty collection.
- */
- @Deprecated
- public static final String JSON_NON_STRINGS = NAMESPACE + "non.strings";
- /**
- * JSON attributes as elements property is now deprecated. See {@link JSONConfiguration}.
- * This property is valid for the <code>JSONNotation.MAPPED</code> notation only.
- * <p>
- * The type of this property is <code>Collection&lt;String&gt;</code>.
- * <p>
- * The value is a collection of string values that are
- * object names that correspond to XML attribute information items.
- * The value of an object name in the JSON document that exists in the collection
- * of object names will be declared as an element as not as an attribute if
- * the object corresponds to an XML attribute information item.
- * <p>
- * For example, consider that the property value is not set and the
- * JSON document is <code>{ ..., "@number":"12", ... }</code>.
- * If the property value is set contain <code>"number"</code>
- * then the JSON document would be <code>{ ..., "number":"12", ... }</code>.
- * <p>
- * The default value is an empty collection.
- */
- @Deprecated
- public static final String JSON_ATTRS_AS_ELEMS = NAMESPACE + "attrs.as.elems";
- /**
- * XML to JSON namespace mapping property is now deprecated. See {@link JSONConfiguration}.
- * This property is valid for the MAPPED_JETTISON notation only.
- * <p>
- * <p>
- * The type of this property is <code>Map&lt;String,String&gt;</code>.
- * <p>
- * The value is a map with zero or more
- * key/value pairs, where the key is an XML namespace and the value
- * is the prefix to use as the replacement for the XML namespace.
- * <p>
- * The default value is a map with zero key/value pairs.
- */
- @Deprecated
- public static final String JSON_XML2JSON_NS = NAMESPACE + "xml.to.json.ns";
- private static final Map<String, Object> defaultJsonProperties = new HashMap<String, Object>();
-
- static {
- defaultJsonProperties.put(JSON_NOTATION, JSONNotation.MAPPED);
- defaultJsonProperties.put(JSON_ROOT_UNWRAPPING, Boolean.TRUE);
- }
- private JSONConfiguration jsonConfiguration;
- private final JAXBContext jaxbContext;
-
- /**
- * Constructs a new instance with default {@link JSONConfiguration}.
- *
- * @param classesToBeBound list of java classes to be recognized by the
- * new JSONJAXBContext. Can be empty, in which case a JSONJAXBContext
- * that only knows about spec-defined classes will be returned.
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(Class... classesToBeBound) throws JAXBException {
- this(JSONConfiguration.DEFAULT, classesToBeBound);
- }
-
- /**
- * Constructs a new instance with given {@link JSONConfiguration}.
- *
- * @param config {@link JSONConfiguration}, can not be null
- * @param classesToBeBound list of java classes to be recognized by the
- * new JSONJAXBContext. Can be empty, in which case a JSONJAXBContext
- * that only knows about spec-defined classes will be returned.
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(final JSONConfiguration config, final Class... classesToBeBound) throws JAXBException {
- if (config == null) {
- throw new IllegalArgumentException("JSONConfiguration MUST not be null");
- }
-
- jsonConfiguration = config;
- if (config.getNotation() == JSONConfiguration.Notation.NATURAL) {
- jaxbContext = JAXBContext.newInstance(classesToBeBound,
- Collections.singletonMap(JAXBContextImpl.RETAIN_REFERENCE_TO_INFO, true));
- } else {
- jaxbContext = JAXBContext.newInstance(classesToBeBound);
- }
- }
-
- /**
- * Constructs a new instance with a custom set of properties.
- * The default {@link JSONConfiguration} is used if no (now deprecated)
- * JSON related properties are specified
- *
- * @param classesToBeBound list of java classes to be recognized by the
- * new JSONJAXBContext. Can be empty, in which case a JSONJAXBContext
- * that only knows about spec-defined classes will be returned.
- * @param properties the custom set of properties. If it contains(now deprecated) JSON related properties,
- * then a non-default {@link JSONConfiguration} is used reflecting the JSON properties
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(Class[] classesToBeBound, Map<String, Object> properties)
- throws JAXBException {
- jaxbContext = JAXBContext.newInstance(classesToBeBound,
- createProperties(properties));
- if (jsonConfiguration == null) {
- jsonConfiguration = JSONConfiguration.DEFAULT;
- }
- }
-
- /**
- * Constructs a new instance with a custom set of properties.
- * If no (now deprecated) JSON related properties are specified,
- * the {@link JSONConfiguration#DEFAULT} is used as {@link JSONConfiguration}
- *
- * @param config {@link JSONConfiguration}, can not be null
- * @param classesToBeBound list of java classes to be recognized by the
- * new JSONJAXBContext. Can be empty, in which case a JSONJAXBContext
- * that only knows about spec-defined classes will be returned.
- * @param properties the custom set of properties.
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(final JSONConfiguration config, final Class[] classesToBeBound, final Map<String, Object> properties)
- throws JAXBException {
- if (config == null) {
- throw new IllegalArgumentException("JSONConfiguration MUST not be null");
- }
-
- jsonConfiguration = config;
- if (config.getNotation() == JSONConfiguration.Notation.NATURAL) {
- Map<String, Object> myProps = new HashMap<String, Object>(properties.size() + 1);
- myProps.putAll(properties);
- myProps.put(JAXBContextImpl.RETAIN_REFERENCE_TO_INFO, Boolean.TRUE);
- jaxbContext = JAXBContext.newInstance(classesToBeBound, myProps);
- } else {
- jaxbContext = JAXBContext.newInstance(classesToBeBound, properties);
- }
- }
-
- /**
- * Construct a new instance of using context class loader of the thread
- * with default {@link JSONConfiguration}.
- *
- * @param contextPath list of java package names that contain schema
- * derived class and/or java to schema (JAXB-annotated) mapped
- * classes
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(String contextPath)
- throws JAXBException {
- this(JSONConfiguration.DEFAULT, contextPath);
- }
-
- /**
- * Construct a new instance of using context class loader of the thread
- * with given {@link JSONConfiguration}.
- *
- * @param config {@link JSONConfiguration}, can not be null
- * @param contextPath list of java package names that contain schema
- * derived class and/or java to schema (JAXB-annotated) mapped
- * classes
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(JSONConfiguration config, String contextPath)
- throws JAXBException {
- if (config == null) {
- throw new IllegalArgumentException("JSONConfiguration MUST not be null");
- }
-
- if (config.getNotation() == JSONConfiguration.Notation.NATURAL) {
- jaxbContext = JAXBContext.newInstance(contextPath,
- Thread.currentThread().getContextClassLoader(),
- Collections.singletonMap(JAXBContextImpl.RETAIN_REFERENCE_TO_INFO, true));
- } else {
- jaxbContext = JAXBContext.newInstance(contextPath, Thread.currentThread().getContextClassLoader());
- }
- jsonConfiguration = config;
- }
-
- /**
- * Construct a new instance using a specified class loader with
- * default {@link JSONConfiguration}.
- *
- * @param contextPath list of java package names that contain schema
- * derived class and/or java to schema (JAXB-annotated) mapped
- * classes
- * @param classLoader
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(String contextPath, ClassLoader classLoader)
- throws JAXBException {
- jaxbContext = JAXBContext.newInstance(contextPath, classLoader);
- jsonConfiguration = JSONConfiguration.DEFAULT;
- }
-
- /**
- * Construct a new instance using a specified class loader and
- * a custom set of properties. {@link JSONConfiguration} is set to default,
- * if user does not specify any (now deprecated) JSON related properties
- *
- * @param contextPath list of java package names that contain schema
- * derived class and/or java to schema (JAXB-annotated) mapped
- * classes
- * @param classLoader
- * @param properties the custom set of properties.
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(String contextPath, ClassLoader classLoader, Map<String, Object> properties)
- throws JAXBException {
- jaxbContext = JAXBContext.newInstance(contextPath, classLoader, createProperties(properties));
- if (jsonConfiguration == null) {
- jsonConfiguration = JSONConfiguration.DEFAULT;
- }
- }
-
- /**
- * Construct a new instance using a specified class loader,
- * set of properties and {@link JSONConfiguration} .
- *
- * @param config {@link JSONConfiguration}, can not be null
- * @param contextPath list of java package names that contain schema
- * derived class and/or java to schema (JAXB-annotated) mapped
- * classes
- * @param classLoader
- * @param properties the custom set of properties.
- * @throws JAXBException if an error was encountered while creating the
- * underlying JAXBContext.
- */
- public JSONJAXBContext(JSONConfiguration config, String contextPath, ClassLoader classLoader, Map<String, Object> properties)
- throws JAXBException {
- if (config == null) {
- throw new IllegalArgumentException("JSONConfiguration MUST not be null");
- }
-
- if (config.getNotation() == JSONConfiguration.Notation.NATURAL) {
- Map<String, Object> myProps = new HashMap<String, Object>(properties.size() + 1);
- myProps.putAll(properties);
- myProps.put(JAXBContextImpl.RETAIN_REFERENCE_TO_INFO, Boolean.TRUE);
- jaxbContext = JAXBContext.newInstance(contextPath, classLoader, myProps);
- } else {
- jaxbContext = JAXBContext.newInstance(contextPath, classLoader, properties);
- }
- jsonConfiguration = config;
- }
-
- /**
- * Get a {@link JSONMarshaller} from a {@link Marshaller}.
- *
- * @param marshaller the JAXB marshaller.
- * @return the JSON marshaller.
- */
- public static JSONMarshaller getJSONMarshaller(Marshaller marshaller) {
- if (marshaller instanceof JSONMarshaller) {
- return (JSONMarshaller) marshaller;
- } else {
- return new BaseJSONMarshaller(marshaller, JSONConfiguration.DEFAULT);
- }
-
- }
-
- /**
- * Get a {@link JSONUnmarshaller} from a {@link Unmarshaller}.
- *
- * @param unmarshaller the JAXB unmarshaller.
- * @return the JSON unmarshaller.
- */
- public static JSONUnmarshaller getJSONUnmarshaller(Unmarshaller unmarshaller) {
- if (unmarshaller instanceof JSONUnmarshaller) {
- return (JSONUnmarshaller) unmarshaller;
- } else {
- return new BaseJSONUnmarshaller(unmarshaller, JSONConfiguration.DEFAULT);
- }
-
- }
-
- /**
- * Get the JSON configuration.
- *
- * @return the JSON configuration.
- */
- public JSONConfiguration getJSONConfiguration() {
- return jsonConfiguration;
- }
-
- /**
- * Create a JSON unmarshaller.
- *
- * @return the JSON unmarshaller
- *
- * @throws JAXBException if there is an error creating the unmarshaller.
- */
- public JSONUnmarshaller createJSONUnmarshaller() throws JAXBException {
- return new JSONUnmarshallerImpl(this, getJSONConfiguration());
- }
-
- /**
- * Create a JSON marshaller.
- *
- * @return the JSON marshaller.
- *
- * @throws JAXBException if there is an error creating the marshaller.
- */
- public JSONMarshaller createJSONMarshaller() throws JAXBException {
- return new JSONMarshallerImpl(this, getJSONConfiguration());
- }
-
- /**
- * Overrides underlaying createUnmarshaller method and returns
- * an unmarshaller which is capable of JSON deserialization.
- *
- * @return unmarshaller instance with JSON capabilities
- * @throws javax.xml.bind.JAXBException
- */
- @Override
- public Unmarshaller createUnmarshaller() throws JAXBException {
- return new JSONUnmarshallerImpl(jaxbContext, getJSONConfiguration());
- }
-
- /**
- * Overrides underlaying createMarshaller method and returns
- * a marshaller which is capable of JSON serialization.
- *
- * @return marshaller instance with JSON capabilities
- * @throws javax.xml.bind.JAXBException
- */
- @Override
- public Marshaller createMarshaller() throws JAXBException {
- return new JSONMarshallerImpl(jaxbContext, getJSONConfiguration());
- }
-
- /**
- * Simply delegates to underlying JAXBContext implementation.
- *
- * @return what underlying JAXBContext returns
- * @throws javax.xml.bind.JAXBException
- */
- @Override
- public Validator createValidator() throws JAXBException {
- return jaxbContext.createValidator();
- }
-
- static final Map<String, JSONConfiguration.Notation> _notationMap = new HashMap<String, JSONConfiguration.Notation>() {
-
- {
- put(JSONJAXBContext.JSONNotation.BADGERFISH.toString(), JSONConfiguration.Notation.BADGERFISH);
- put(JSONJAXBContext.JSONNotation.MAPPED.toString(), JSONConfiguration.Notation.MAPPED);
- put(JSONJAXBContext.JSONNotation.MAPPED_JETTISON.toString(), JSONConfiguration.Notation.MAPPED_JETTISON);
- put(JSONJAXBContext.JSONNotation.NATURAL.toString(), JSONConfiguration.Notation.NATURAL);
- }
- };
-
- private Map<String, Object> createProperties(Map<String, Object> properties) {
- Map<String, Object> workProperties = new HashMap<String, Object>();
- workProperties.putAll(defaultJsonProperties);
- workProperties.putAll(properties);
- if (JSONJAXBContext.JSONNotation.NATURAL == workProperties.get(JSONJAXBContext.JSON_NOTATION)) {
- workProperties.put(JAXBContextImpl.RETAIN_REFERENCE_TO_INFO, Boolean.TRUE);
- }
- processProperties(workProperties);
- return workProperties;
- }
-
- private final void processProperties(Map<String, Object> properties) {
- final Collection<String> jsonKeys = new HashSet<String>();
- for (String k : Collections.unmodifiableSet(properties.keySet())) {
- if (k.startsWith(NAMESPACE)) {
- jsonKeys.add(k);
- }
- }
- if (!jsonKeys.isEmpty()) {
- if (jsonConfiguration == null) {
- JSONConfiguration.Notation pNotation = JSONConfiguration.Notation.MAPPED;
- if (properties.containsKey(JSONJAXBContext.JSON_NOTATION)) {
- Object nO = properties.get(JSONJAXBContext.JSON_NOTATION);
- if ((nO instanceof JSONJAXBContext.JSONNotation) || (nO instanceof String)) {
- pNotation = _notationMap.get(nO.toString());
- }
- }
- jsonConfiguration = getConfiguration(pNotation, properties);
- }
- }
- for (String k : jsonKeys) {
- properties.remove(k);
- }
- }
-
- private JSONConfiguration getConfiguration(JSONConfiguration.Notation pNotation,
- Map<String, Object> properties) {
-
- String[] a = new String[0];
-
- switch (pNotation) {
- case BADGERFISH:
- return JSONConfiguration.badgerFish().build();
- case MAPPED_JETTISON:
- JSONConfiguration.MappedJettisonBuilder mappedJettisonBuilder = JSONConfiguration.mappedJettison();
- if (properties.containsKey(JSONJAXBContext.JSON_XML2JSON_NS)) {
- mappedJettisonBuilder.xml2JsonNs((Map<String, String>) properties.get(JSONJAXBContext.JSON_XML2JSON_NS));
- }
- return mappedJettisonBuilder.build();
- case NATURAL:
- return JSONConfiguration.natural().build();
- case MAPPED:
- default: {
- JSONConfiguration.MappedBuilder mappedBuilder = JSONConfiguration.mapped();
- if (properties.containsKey(JSONJAXBContext.JSON_ARRAYS)) {
- mappedBuilder.arrays(((Collection<String>) properties.get(JSONJAXBContext.JSON_ARRAYS)).toArray(a));
- }
- if (properties.containsKey(JSONJAXBContext.JSON_ATTRS_AS_ELEMS)) {
- mappedBuilder.attributeAsElement(((Collection<String>) properties.get(JSONJAXBContext.JSON_ATTRS_AS_ELEMS)).toArray(a));
- }
- if (properties.containsKey(JSONJAXBContext.JSON_NON_STRINGS)) {
- mappedBuilder.nonStrings(((Collection<String>) properties.get(JSONJAXBContext.JSON_NON_STRINGS)).toArray(a));
- }
- if (properties.containsKey(JSONJAXBContext.JSON_ROOT_UNWRAPPING)) {
- mappedBuilder.rootUnwrapping((Boolean) properties.get(JSONJAXBContext.JSON_ROOT_UNWRAPPING));
- }
- return mappedBuilder.build();
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONMarshaller.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONMarshaller.java
deleted file mode 100644
index 5e2e6bd68c3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONMarshaller.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.json;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.MarshalException;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.annotation.XmlRootElement;
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- * A JSON marshaller responsible for serializing Java content trees, defined
- * by JAXB, to JSON data.
- *
- * @author Jakub.Podlesak@Sun.COM, Paul.Sandoz@Sun.COM
- */
-public interface JSONMarshaller {
-
- public static final String FORMATTED = "com.sun.jersey.api.json.JSONMarshaller.formatted";
-
- /**
- * Marshall the content tree rooted at <code>jaxbElement</code> into an
- * output stream. The content tree may be an instance of a class that is
- * mapped to a XML root element (for example, annotated with
- * {@link XmlRootElement}) or an instance of {@link JAXBElement}.
- * <p>
- * The UTF-8 character encoding scheme will be used to encode the characters
- * of the JSON data.
- *
- * @param jaxbElement the root of the content tree to be marshalled.
- * @param os the JSON will be added to this stream.
- * @throws JAXBException if any unexpected problem occurs during the
- * marshalling.
- * @throws MarshalException if the <code>JSONMarshaller</code> is unable to
- * marshal <code>jaxbElement</code> (or any object reachable from obj)
- * @throws IllegalArgumentException if any of the method parameters are null.
- *
- */
- void marshallToJSON(Object jaxbElement, OutputStream os) throws JAXBException;
-
- /**
- * Marshall the content tree rooted at <code>jaxbElement</code> into an
- * output stream. The content tree may be an instance of a class that is
- * mapped to a XML root element (for example, annotated with
- * {@link XmlRootElement}) or an instance of {@link JAXBElement}.
- * <p>
- * The character encoding scheme of the <code>writer</code> will be used to
- * encode the characters of the JSON data.
- *
- * @param jaxbElement the root of the content tree to be marshalled.
- * @param writer the JSON will be added to this writer.
- * @throws JAXBException if any unexpected problem occurs during the
- * marshalling.
- * @throws MarshalException if the <code>JSONMarshaller</code> is unable to
- * marshal <code>jaxbElement</code> (or any object reachable from obj)
- * @throws IllegalArgumentException If any of the method parameters are null.
- */
- void marshallToJSON(Object jaxbElement, Writer writer) throws JAXBException;
-
-
- /**
- * Set the particular property in the underlying implementation of
- * {@link JSONMarshaller}. Attempting to set an undefined property
- * will result in a PropertyException being thrown.
- *
- * @param name the name of the property to be set. This value can either
- * be specified using one of the constant fields or a user
- * supplied string.
- * @param value the value of the property to be set
- *
- * @throws PropertyException when there is an error processing the given
- * property or value
- * @throws IllegalArgumentException
- * If the name parameter is null
- */
- void setProperty(String name, Object value) throws PropertyException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONUnmarshaller.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONUnmarshaller.java
deleted file mode 100644
index 7d32718e72c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONUnmarshaller.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.json;
-
-import java.io.InputStream;
-import java.io.Reader;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * A JSON unmarshaller responsible for deserializing JSON data to a Java
- * content tree, defined by JAXB.
- *
- * @author Jakub.Podlesak@Sun.COM, Paul.Sandoz@Sun.COM
- */
-public interface JSONUnmarshaller {
-
- /**
- * Unmarshal JSON data from the specified <code>InputStream</code> and
- * return the resulting Java content tree.
- * <p>
- * The UTF-8 character encoding scheme will be used to decode the encoded
- * characters of the JSON data.
- *
- * @param <T> the type of the Java content tree.
- * @param is the InputStream to unmarshal JSON data from.
- * @param expectedType the expected type of the Java content tree.
- * @return the newly created root object of the Java content tree. The
- * content tree may be an instance of a class that is
- * mapped to a XML root element (for example, annotated with
- * {@link XmlRootElement}) or mapped to an XML type (for example,
- * annotated with {@link XmlType}).
- * @throws JAXBException if any unexpected errors occur while unmarshalling.
- * @throws UnmarshalException if the <code>JSONUnmarshaller</code> is unable
- * to perform the JSON to Java binding.
- */
- <T> T unmarshalFromJSON(InputStream is,
- Class<T> expectedType) throws JAXBException;
-
- /**
- * Unmarshal JSON data from the specified <code>Reader</code> and
- * return the resulting Java content tree.
- * <p>
- * The character encoding scheme of the <code>reader</code> will be used to
- * encode the characters of the JSON data.
- *
- * @param <T> the type of the Java content tree.
- * @param reader the Reader to unmarshal JSON data from.
- * @param expectedType the expected type of the Java content tree.
- * @return the newly created root object of the Java content tree. The
- * content tree may be an instance of a class that is
- * mapped to a XML root element (for example, annotated with
- * {@link XmlRootElement}) or mapped to an XML type (for example,
- * annotated with {@link XmlType}).
- * @throws JAXBException if any unexpected errors occur while unmarshalling.
- * @throws UnmarshalException if the <code>JSONUnmarshaller</code> is unable
- * to perform the JSON to Java binding.
- */
- <T> T unmarshalFromJSON(Reader reader,
- Class<T> expectedType) throws JAXBException;
-
- /**
- * Unmarshal JSON data from the <code>InputStream</code> by
- * <code>declaredType</code> and return the resulting content tree.
- * <p>
- * The UTF-8 character encoding scheme will be used to decode the encoded
- * characters of the JSON data.
- *
- * @param <T> the type of the Java content tree.
- * @param is the InputStream to unmarshal JSON data from.
- * @param declaredType a class that is mapped to a XML root element
- * (for example, annotated with {@link XmlRootElement}) or mapped to
- * an XML type (for example, annotated with {@link XmlType}).
- * @return the newly created root object of the Java content tree, root
- * by a {@link JAXBElement} instance.
- * @throws JAXBException if any unexpected errors occur while unmarshalling.
- * @throws UnmarshalException if the <code>JSONUnmarshaller</code> is unable
- * to perform the JSON to Java binding.
- */
- <T> JAXBElement<T> unmarshalJAXBElementFromJSON(InputStream is,
- Class<T> declaredType) throws JAXBException;
-
- /**
- * Unmarshal JSON data from the <code>Reader</code> by
- * <code>declaredType</code> and return the resulting content tree.
- * <p>
- * The character encoding scheme of the <code>reader</code> will be used to
- * encode the characters of the JSON data.
- *
- * @param <T> the type of the Java content tree.
- * @param reader the Reader to unmarshal JSON data from.
- * @param declaredType a class that is mapped to a XML root element
- * (for example, annotated with {@link XmlRootElement}) or mapped to
- * an XML type (for example, annotated with {@link XmlType}).
- * @return the newly created root object of the Java content tree, root
- * by a {@link JAXBElement} instance.
- * @throws JAXBException if any unexpected errors occur while unmarshalling.
- * @throws UnmarshalException if the <code>JSONUnmarshaller</code> is unable
- * to perform the JSON to Java binding.
- */
- <T> JAXBElement<T> unmarshalJAXBElementFromJSON(Reader reader,
- Class<T> declaredType) throws JAXBException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONWithPadding.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONWithPadding.java
deleted file mode 100644
index 83d4dbea4ee..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/JSONWithPadding.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.json;
-
-import java.io.IOException;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.map.JsonSerializableWithType;
-import org.codehaus.jackson.map.SerializerProvider;
-import org.codehaus.jackson.map.TypeSerializer;
-
-/**
- * An entity supporting JSON with Padding (JSONP).
- * <p>
- * If an instance is returned by a resource method and the most acceptable
- * media type is one of application/javascript, application/x-javascript,
- * text/ecmascript, application/ecmascript or text/jscript then the object
- * that is contained by the instance is serialized as JSON (if supported, using
- * the application/json media type) and the result is wrapped around a
- * JavaScript callback function, whose name by default is "callback". Otherwise,
- * the object is serialized directly according to the most acceptable media type.
- * This means that an instance can be used to produce the media types
- * application/json, application/xml in addition to application/x-javascript.
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class JSONWithPadding implements JsonSerializableWithType {
-
- public static final String DEFAULT_CALLBACK_NAME = "callback";
-
- private final String callbackName;
-
- private final Object jsonSource;
-
- /**
- * Pad JSON using the default function name "callback".
- *
- * @param jsonSource the JSON to pad.
- */
- public JSONWithPadding(Object jsonSource) {
- this(jsonSource, DEFAULT_CALLBACK_NAME);
- }
-
- /**
- * Pad JSON using a declared callback function name.
- *
- * @param jsonSource the JSON to pad.
- * @param callbackName the callback function name.
- */
- public JSONWithPadding(Object jsonSource, String callbackName) {
- if (jsonSource == null)
- throw new IllegalArgumentException("JSON source MUST not be null");
-
- this.jsonSource = jsonSource;
- this.callbackName = (callbackName == null) ? DEFAULT_CALLBACK_NAME : callbackName;
- }
-
- /**
- * Get the callback function name.
- *
- * @return the callback function name.
- */
- public String getCallbackName() {
- return callbackName;
- }
-
- /**
- * Get the JSON source.
- *
- * @return the JSON source.
- */
- public Object getJsonSource() {
- return jsonSource;
- }
-
-
- @Override
- public void serialize(JsonGenerator jgen, SerializerProvider provider)
- throws IOException, JsonProcessingException {
- if (jsonSource == null) {
- provider.getNullValueSerializer().serialize(null, jgen, provider);
- } else {
- Class<?> cls = jsonSource.getClass();
- provider.findTypedValueSerializer(cls, true).serialize(jsonSource, jgen, provider);
- }
- }
-
- @Override
- public void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonProcessingException {
- serialize(jgen, provider);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/json/package-info.java
deleted file mode 100644
index 5e7706e9617..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/json/package-info.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for enabling and configuring JSON.
- * <p>
- * Besides enabling JSON, the API also allows customization of the JSON format
- * produced and consumed with JAXB beans.
- * Such customization requires that an implementation of
- * {@link javax.ws.rs.ext.ContextResolver} returns a configured
- * {@link com.sun.jersey.api.json.JSONJAXBContext} instance.
- *
- * <p>For example, if the following two JAXB beans are defined:
- * <blockquote><pre>
- * <span style="font-weight:bold">&#064;XmlRootElement</span>
- * public class <span style="font-weight:bold">BeanOne</span> {
- * public String name;
- * public int number;
- * }
- *
- * <span style="font-weight:bold">&#064;XmlRootElement</span>
- * public class <span style="font-weight:bold">BeanTwo</span> {
- * public List&lt;String&gt; titles;
- * }
- * </pre></blockquote>
- *
- * And the following resource class uses the above JAXB beans:
- *
- * <blockquote><pre>
- * &#064;Path("beans")
- * public class MyResource {
- *
- * &#064;GET &#064;Path("one") &#064;Produces(MediaType.APPLICATION_JSON)
- * public <span style="font-weight:bold">BeanOne</span> getOne() {
- * BeanOne one = new BeanOne();
- * one.name = "Howard";
- * one.number = 3;
- * return one;
- * }
- *
- * &#064;GET &#064;Path("two") &#064;Produces(MediaType.APPLICATION_JSON)
- * public <span style="font-weight:bold">BeanTwo</span> getTwo() {
- * BeanTwo two = new BeanTwo();
- * two.titles = new ArrayList<String>(1){{add("Title1");}};
- * return two;
- * }
- * </pre></blockquote>
- *
- * <p>
- * Then, for the URI path <code>beans/one</code>, the following JSON will be
- * produced:
- * <blockquote><pre>
- * {"name":"Howard","number":<span style="color:red">"</span>3<span style="color:red">"</span>}
- * </pre></blockquote>
- * However, it might be required that the JSON object named <code>number</code> have
- * a non-String value <code>3</code>.
- * <p>
- * And, for the URI path <code>beans/two</code>, the following JSON will be
- * produced:
- * <blockquote><pre>
- * {"titles":"Title1"}
- * </pre></blockquote>
- * However, it might be required that the JSON object named <code>titles</code>
- * have a JSON array value <code><span style="color:red">[</span>"Title1"<span style="color:red">]</span></code>,
- * since the <code>titles</code> field on the JAXB bean <code>BeanTwo</code>
- * represents an array, thus enabling consuming of such JSON values the same way on
- * the client side no matter how many elements the array contains.
- *
- * <p>The {@link com.sun.jersey.api.json.JSONJAXBContext} may be configured to enable
- * such required production of JSON as described above in the following manner:
- * <blockquote><pre>
- * <span style="font-weight:bold">&#064;Provider</span>
- * public final class JAXBContextResolver <span style="font-weight:bold">implements ContextResolver&lt;JAXBContext&gt;</span> {
- *
- * <span style="font-weight:bold">private final JAXBContext context;</span>
- *
- * private final Set&lt;Class&gt; types;
- *
- * private final Class[] cTypes = {BeanOne.class, BeanTwo.class};
- *
- * public JAXBContextResolver() throws JAXBException {
- * this.context = new <span style="font-weight:bold">JSONJAXBContext</span>(<span style="font-weight:bold">JSONConfiguration.natural().build()</span>, cTypes);
- * this.types = new HashSet(Arrays.asList(cTypes));
- * }
- *
- * <span style="font-weight:bold">public JAXBContext getContext(Class&lt;?&gt; objectType)</span> {
- * return (types.contains(objectType)) ? <span style="font-weight:bold">context</span> : null;
- * }
- * }
- * </pre></blockquote>
- *
- * Then, the produced JSON would become: <code>{"name":"Howard","number":3}</code>
- * and <code>{"titles":["Title1"]}</code> respectively for the URI paths
- * <code>beans/one</code> and <code>beans/two</code>. Please note, that you do not need
- * to configure this in much detail. Using {@link com.sun.jersey.api.json.JSONConfiguration.Notation#NATURAL} notation
- * means that Jersey JSON processor will autamatically take care about numbers, booleans and arrays. This notation
- * will probably become the default one for Jersey in one of the future releases.
- *
- * <p>For a complete set of supported properties, see
- * {@link com.sun.jersey.api.json.JSONConfiguration.Builder}.
- */
-package com.sun.jersey.api.json; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractField.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractField.java
deleted file mode 100644
index 22daef26fd9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractField.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AbstractField implements Parameterized, AbstractModelComponent {
- private List<Parameter> parameters;
-
- private Field field;
-
- public AbstractField(Field field) {
- assert null != field;
-
- this.field = field;
- this.parameters = new ArrayList<Parameter>();
- }
-
- public Field getField() {
- return field;
- }
-
- @Override
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- @Override
- public void accept(AbstractModelVisitor visitor) {
- visitor.visitAbstractField(this);
- }
-
- @Override
- public List<AbstractModelComponent> getComponents() {
- return null;
- }
-
- @Override
- public String toString() {
- return "AbstractField("
- + getField().getDeclaringClass().getSimpleName() + "#" + getField().getName() + ")";
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractImplicitViewMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractImplicitViewMethod.java
deleted file mode 100644
index 5f23127410a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractImplicitViewMethod.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-/**
- * Abstraction for an implicit view method.
- * <p>
- * The annotations on this abstract method will be copied from the class. The
- * Java method will be null.
- *
- */
-public class AbstractImplicitViewMethod extends AbstractMethod {
-
- public AbstractImplicitViewMethod(AbstractResource resource) {
- super(resource, null, resource.getAnnotations());
- }
-
- @Override
- public String toString() {
- return "AbstractImplicitViewMethod("
- + getResource().getResourceClass().getSimpleName() + ")";
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractMethod.java
deleted file mode 100644
index f18e0ea5c65..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractMethod.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Method;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractMethod implements AnnotatedElement {
- private Method method;
-
- private Annotation[] annotations;
-
- private AbstractResource resource;
-
- public AbstractMethod(AbstractResource resource, Method method, Annotation[] annotations) {
- this.method = method;
- this.annotations = annotations;
- this.resource = resource;
- }
-
- public AbstractResource getResource() {
- return resource;
- }
-
- public Method getMethod() {
- return method;
- }
-
- @Override
- public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
- for (Annotation a : annotations) {
- if (annotationType == a.annotationType())
- return annotationType.cast(a);
- }
- return null;
- }
-
- @Override
- public Annotation[] getAnnotations() {
- return annotations.clone();
- }
-
- @Override
- public Annotation[] getDeclaredAnnotations() {
- return annotations.clone();
- }
-
- @Override
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
- return getAnnotation(annotationType) != null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelComponent.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelComponent.java
deleted file mode 100644
index 8682ba8eefa..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelComponent.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.util.List;
-
-/**
- *
- * @author japod
- */
-public interface AbstractModelComponent {
- public void accept(AbstractModelVisitor visitor);
- public List<AbstractModelComponent> getComponents();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelVisitor.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelVisitor.java
deleted file mode 100644
index ed6987b57b0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractModelVisitor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-/**
- * The interface was originatelly created to allow implementing
- * validators of the abstract resource model. A second use case
- * would be WADL generation.
- *
- * @author japod
- */
-public interface AbstractModelVisitor {
-
- void visitAbstractResource(AbstractResource resource);
-
- void visitAbstractField(AbstractField field);
-
- void visitAbstractSetterMethod(AbstractSetterMethod setterMethod);
-
- void visitAbstractResourceMethod(AbstractResourceMethod method);
-
- void visitAbstractSubResourceMethod(AbstractSubResourceMethod method);
-
- void visitAbstractSubResourceLocator(AbstractSubResourceLocator locator);
-
- void visitAbstractResourceConstructor(AbstractResourceConstructor constructor);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResource.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResource.java
deleted file mode 100644
index ff52412dc76..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResource.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Abstraction for resource class
- */
-public class AbstractResource implements PathAnnotated, AbstractModelComponent, AnnotatedElement {
-
- private final Class<?> resourceClass;
- private final PathValue uriPath;
- private final List<AbstractResourceConstructor> constructors;
- private final List<AbstractField> fields;
- private final List<AbstractSetterMethod> setterMethods;
- private final List<AbstractResourceMethod> resourceMethods;
- private final List<AbstractSubResourceMethod> subResourceMethods;
- private final List<AbstractSubResourceLocator> subResourceLocators;
- private final List<Method> postConstructMethods;
- private final List<Method> preDestroyMethods;
-
- /**
- * Creates a new instance of AbstractResource
- */
- public AbstractResource(Class<?> resourceClass) {
- this(resourceClass, null);
- }
-
- /**
- * Creates a new instance of AbstractResource
- */
- public AbstractResource(Class<?> resourceClass, PathValue uriPath) {
- this.resourceClass = resourceClass;
- this.uriPath = uriPath;
- this.constructors = new ArrayList<AbstractResourceConstructor>(4);
- this.fields = new ArrayList<AbstractField>(4);
- this.setterMethods = new ArrayList<AbstractSetterMethod>(2);
- this.resourceMethods = new ArrayList<AbstractResourceMethod>(4);
- this.subResourceLocators = new ArrayList<AbstractSubResourceLocator>(4);
- this.subResourceMethods = new ArrayList<AbstractSubResourceMethod>(4);
- this.postConstructMethods = new ArrayList<Method>(1);
- this.preDestroyMethods = new ArrayList<Method>(1);
- }
-
- /**
- * Create a new instance from an existing AbstractResource but
- * defining a new path.
- *
- * @param path the path.
- * @param ar the existing abstract resource.
- */
- public AbstractResource(String path, AbstractResource ar) {
- this.uriPath = new PathValue(path);
-
- this.resourceClass = ar.resourceClass;
- this.constructors = ar.constructors;
- this.fields = ar.fields;
- this.setterMethods = ar.setterMethods;
- this.resourceMethods = ar.resourceMethods;
- this.subResourceMethods = ar.subResourceMethods;
- this.subResourceLocators = ar.subResourceLocators;
- this.postConstructMethods = ar.postConstructMethods;
- this.preDestroyMethods = ar.preDestroyMethods;
- }
-
- public Class<?> getResourceClass() {
- return resourceClass;
- }
-
- public boolean isSubResource() {
- return uriPath == null;
- }
-
- public boolean isRootResource() {
- return uriPath != null;
- }
-
- @Override
- public PathValue getPath() {
- return uriPath;
- }
-
- public List<AbstractResourceConstructor> getConstructors() {
- return constructors;
- }
-
- public List<AbstractField> getFields() {
- return fields;
- }
-
- public List<AbstractSetterMethod> getSetterMethods() {
- return setterMethods;
- }
-
- /**
- * Provides a non-null list of resource methods available on the resource
- *
- * @return non-null abstract resource method list
- */
- public List<AbstractResourceMethod> getResourceMethods() {
- return resourceMethods;
- }
-
- /**
- * Provides a non-null list of subresource methods available on the resource
- *
- * @return non-null abstract subresource method list
- */
- public List<AbstractSubResourceMethod> getSubResourceMethods() {
- return subResourceMethods;
- }
-
- /**
- * Provides a non-null list of subresource locators available on the resource
- *
- * @return non-null abstract subresource locator list
- */
- public List<AbstractSubResourceLocator> getSubResourceLocators() {
- return subResourceLocators;
- }
-
- /**
- * @return the postCreate
- */
- public List<Method> getPostConstructMethods() {
- return postConstructMethods;
- }
-
- /**
- * @return the preDestroy
- */
- public List<Method> getPreDestroyMethods() {
- return preDestroyMethods;
- }
-
- @Override
- public void accept(AbstractModelVisitor visitor) {
- visitor.visitAbstractResource(this);
- }
-
- // Annotated element
- @Override
- public boolean isAnnotationPresent(Class<? extends Annotation> a) {
- return resourceClass.isAnnotationPresent(a);
- }
-
- @Override
- public <T extends Annotation> T getAnnotation(Class<T> a) {
- return resourceClass.getAnnotation(a);
- }
-
- @Override
- public Annotation[] getAnnotations() {
- return resourceClass.getAnnotations();
- }
-
- @Override
- public Annotation[] getDeclaredAnnotations() {
- return resourceClass.getDeclaredAnnotations();
- }
-
- @Override
- public String toString() {
- return "AbstractResource("
- + ((null == getPath()) ? "" : ("\"" + getPath().getValue() + "\", - "))
- + getResourceClass().getSimpleName() + ": "
- + getConstructors().size() + " constructors, "
- + getFields().size() + " fields, "
- + getSetterMethods().size() + " setter methods, "
- + getResourceMethods().size() + " res methods, "
- + getSubResourceMethods().size() + " subres methods, "
- + getSubResourceLocators().size() + " subres locators " + ")";
- }
-
- @Override
- public List<AbstractModelComponent> getComponents() {
- List<AbstractModelComponent> components = new LinkedList<AbstractModelComponent>();
- components.addAll(getConstructors());
- components.addAll(getFields());
- components.addAll(getSetterMethods());
- components.addAll(getResourceMethods());
- components.addAll(getSubResourceMethods());
- components.addAll(getSubResourceLocators());
- return components;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceConstructor.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceConstructor.java
deleted file mode 100644
index 46a362bab56..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceConstructor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Abstraction for a resource class constructor
- */
-public class AbstractResourceConstructor implements Parameterized, AbstractModelComponent {
-
- private Constructor ctor;
- private List<Parameter> parameters;
-
- /**
- * Creates a new instance of AbstractResourceConstructor
- */
- public AbstractResourceConstructor(Constructor constructor) {
- this.ctor = constructor;
- parameters = new ArrayList<Parameter>();
- }
-
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- public Constructor getCtor() {
- return ctor;
- }
-
- public void accept(AbstractModelVisitor visitor) {
- visitor.visitAbstractResourceConstructor(this);
- }
-
- public List<AbstractModelComponent> getComponents() {
- return null;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceMethod.java
deleted file mode 100644
index ba84c5f1876..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceMethod.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import javax.ws.rs.core.MediaType;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Abstraction for a resource method
- */
-public class AbstractResourceMethod extends AbstractMethod
- implements Parameterized, AbstractModelComponent {
- private String httpMethod;
- private List<MediaType> consumeMimeList;
- private List<MediaType> produceMimeList;
- private List<Parameter> parameters;
- private Class returnType;
- private Type genericReturnType;
- private boolean isConsumesDeclared;
- private boolean isProducesDeclared;
-
- public AbstractResourceMethod(
- AbstractResource resource,
- Method method,
- Class returnType,
- Type genericReturnType,
- String httpMethod,
- Annotation[] annotations) {
- super(resource, method, annotations);
-
- this.httpMethod = httpMethod.toUpperCase();
- this.consumeMimeList = new ArrayList<MediaType>();
- this.produceMimeList = new ArrayList<MediaType>();
- this.returnType = returnType;
- this.genericReturnType = genericReturnType;
- this.parameters = new ArrayList<Parameter>();
-
-
- }
-
- public AbstractResource getDeclaringResource() {
- return getResource();
- }
-
- public Class getReturnType() {
- return returnType;
- }
-
- public Type getGenericReturnType() {
- return genericReturnType;
- }
-
- public List<MediaType> getSupportedInputTypes() {
- return consumeMimeList;
- }
-
- public void setAreInputTypesDeclared(boolean declared) {
- isConsumesDeclared = declared;
- }
-
- public boolean areInputTypesDeclared() {
- return isConsumesDeclared;
- }
-
- public List<MediaType> getSupportedOutputTypes() {
- return produceMimeList;
- }
-
- public void setAreOutputTypesDeclared(boolean declared) {
- isProducesDeclared = declared;
- }
-
- public boolean areOutputTypesDeclared() {
- return isProducesDeclared;
- }
-
- public String getHttpMethod() {
- return httpMethod;
- }
-
- public boolean hasEntity() {
- for (Parameter p : getParameters()) {
- if (Parameter.Source.ENTITY == p.getSource()) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- @Override
- public void accept(AbstractModelVisitor visitor) {
- visitor.visitAbstractResourceMethod(this);
- }
-
- @Override
- public List<AbstractModelComponent> getComponents() {
- return null;
- }
-
- @Override
- public String toString() {
- return "AbstractResourceMethod("
- + getMethod().getDeclaringClass().getSimpleName() + "#" + getMethod().getName() + ")";
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelContext.java
deleted file mode 100644
index 0dca2e2056a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelContext.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.model;
-
-import java.util.Set;
-
-/**
- * Abstraction for abstract resources contained within a specific context
- * (such as an application).
- *
- * @author Jakub Podlesak
- */
-public interface AbstractResourceModelContext {
-
- /*
- * Returns a set of all root resource abstract models known
- * within given context.
- */
- public Set<AbstractResource> getAbstractRootResources();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelListener.java
deleted file mode 100644
index 9c4cd7912f9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractResourceModelListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.model;
-
-/**
- * To get notifications on abstract resource model events,
- * implement this interface and register your implementation class
- * with the corresponding application.
- *
- *
- * @author Jakub Podlesak
- */
-public interface AbstractResourceModelListener {
-
- /*
- * This method will be called whenever a new set of JAX-RS resources is loaded.
- * I.e. also re-loading of an application will trigger this.
- */
- public void onLoaded(AbstractResourceModelContext modelContext);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSetterMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSetterMethod.java
deleted file mode 100644
index 5f00ea26a0a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSetterMethod.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AbstractSetterMethod extends AbstractMethod implements Parameterized, AbstractModelComponent {
- private List<Parameter> parameters;
-
- public AbstractSetterMethod(AbstractResource resource, Method method, Annotation[] annotations) {
- super(resource, method, annotations);
- this.parameters = new ArrayList<Parameter>();
- }
-
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- public void accept(AbstractModelVisitor visitor) {
- visitor.visitAbstractSetterMethod(this);
- }
-
- public List<AbstractModelComponent> getComponents() {
- return null;
- }
-
- @Override
- public String toString() {
- return "AbstractSetterMethod("
- + getMethod().getDeclaringClass().getSimpleName() + "#" + getMethod().getName() + ")";
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceLocator.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceLocator.java
deleted file mode 100644
index 0ea4114e625..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceLocator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Abstraction for a sub resource locator
- */
-public class AbstractSubResourceLocator extends AbstractMethod
- implements PathAnnotated, Parameterized, AbstractModelComponent {
-
- private PathValue uriPath;
-
- private List<Parameter> parameters;
-
- /**
- * Creates a new instance of AbstractSubResourceLocator
- */
- public AbstractSubResourceLocator(AbstractResource resource, Method method, PathValue uriPath, Annotation[] annotations) {
- super(resource, method, annotations);
-
- this.uriPath = uriPath;
- this.parameters = new ArrayList<Parameter>();
- }
-
- public PathValue getPath() {
- return uriPath;
- }
-
- public List<Parameter> getParameters() {
- return parameters;
- }
-
- public void accept(AbstractModelVisitor visitor) {
- visitor.visitAbstractSubResourceLocator(this);
- }
-
- public List<AbstractModelComponent> getComponents() {
- return null;
- }
-
- @Override
- public String toString() {
- return "AbstractSubResourceLocator("
- + getMethod().getDeclaringClass().getSimpleName() + "#" + getMethod().getName() + ")";
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceMethod.java
deleted file mode 100644
index 98b1a719532..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/AbstractSubResourceMethod.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-
-/**
- *
- * @author mh124079
- */
-public class AbstractSubResourceMethod extends AbstractResourceMethod implements PathAnnotated {
-
- private PathValue uriPath;
-
- public AbstractSubResourceMethod(
- AbstractResource resource,
- Method method,
- Class returnType,
- Type genericReturnType,
- PathValue uriPath,
- String httpMethod,
- Annotation[] annotations) {
- super(resource, method, returnType, genericReturnType, httpMethod, annotations);
- this.uriPath = uriPath;
- }
-
- public PathValue getPath() {
- return uriPath;
- }
-
- @Override
- public void accept(AbstractModelVisitor visitor) {
- visitor.visitAbstractSubResourceMethod(this);
- }
-
- @Override
- public String toString() {
- return "AbstractSubResourceMethod("
- + getMethod().getDeclaringClass().getSimpleName() + "#" + getMethod().getName() + ")";
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameter.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameter.java
deleted file mode 100644
index 7dc61480b3b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameter.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.model;
-
-import com.sun.jersey.spi.container.ParamQualifier;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Type;
-
-/**
- * Abstraction for a method/constructor parameter
- */
-public class Parameter implements AnnotatedElement {
-
- public enum Source {ENTITY, QUERY, MATRIX, PATH, COOKIE, HEADER, CONTEXT, FORM, UNKNOWN};
-
- private final Annotation[] annotations;
- private final Annotation annotation;
- private final Parameter.Source source;
- private final String sourceName;
- private final boolean encoded;
- private final String defaultValue;
- private final Type type;
- private final Class<?> clazz;
-
- public Parameter(Annotation[] as, Annotation a, Source source, String sourceName, Type type, Class<?> clazz) {
- this(as, a, source, sourceName, type, clazz, false, null);
- }
-
- public Parameter(Annotation[] as, Annotation a, Source source, String sourceName, Type type, Class<?> clazz, boolean encoded) {
- this(as, a, source, sourceName, type, clazz, encoded, null);
- }
-
- public Parameter(Annotation[] as, Annotation a, Source source, String sourceName, Type type, Class<?> clazz, String defaultValue) {
- this(as, a, source, sourceName, type, clazz, false, defaultValue);
- }
-
- public Parameter(Annotation[] as, Annotation a, Source source, String sourceName, Type type, Class<?> clazz, boolean encoded, String defaultValue) {
- this.annotations = as;
- this.annotation = a;
- this.source = source;
- this.sourceName = sourceName;
- this.type = type;
- this.clazz = clazz;
- this.encoded = encoded;
- this.defaultValue = defaultValue;
- }
-
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public Parameter.Source getSource() {
- return source;
- }
-
- public String getSourceName() {
- return sourceName;
- }
-
- public boolean isEncoded() {
- return encoded;
- }
-
- public boolean hasDefaultValue() {
- return defaultValue != null;
- }
-
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public Class<?> getParameterClass() {
- return clazz;
- }
-
- public Type getParameterType() {
- return type;
- }
-
- public boolean isQualified() {
- for (Annotation a : getAnnotations()) {
- if (a.annotationType().isAnnotationPresent(ParamQualifier.class)) {
- return true;
- }
- }
- return false;
- }
-
- public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
- for (Annotation a : annotations) {
- if (annotationType == a.annotationType())
- return annotationType.cast(a);
- }
- return null;
- }
-
- public Annotation[] getAnnotations() {
- return annotations.clone();
- }
-
- public Annotation[] getDeclaredAnnotations() {
- return annotations.clone();
- }
-
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
- return getAnnotation(annotationType) != null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameterized.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameterized.java
deleted file mode 100644
index b30ce9cfde5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/Parameterized.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-import java.util.List;
-
-/**
- * Abbstraction for something that has a list of parameters
- */
-public interface Parameterized {
- public List<Parameter> getParameters();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathAnnotated.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathAnnotated.java
deleted file mode 100644
index 60bed187a9f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathAnnotated.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-/**
- *
- * @author mh124079
- */
-public interface PathAnnotated {
- public PathValue getPath();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathValue.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathValue.java
deleted file mode 100644
index 8bbf4b327e5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/PathValue.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-/**
- * Abstraction for a Path value
- */
-public class PathValue {
-
- private String value;
-
- public PathValue(String path) {
- this.value = path;
- }
-
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName()
- + "("
- + ((null == getValue())? "null" : ("\"" + getValue() + "\""))
- + ")";
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/ResourceModelIssue.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/ResourceModelIssue.java
deleted file mode 100644
index 41e06ecb6d8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/ResourceModelIssue.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.model;
-
-/**
- * Abstraction for various issues of a resource model validity like:
- * no resources, duplicated uri templates, etc.
- *
- * @author japod
- */
-public class ResourceModelIssue {
-
- Object source;
- String message;
- boolean fatal;
-
- public ResourceModelIssue(Object source, String message) {
- this(source, message, false);
- }
-
- public ResourceModelIssue(Object source, String message, boolean fatal) {
- this.source = source;
- this.message = message;
- this.fatal = fatal;
- }
-
- /** Human readible description of the issue */
- public String getMessage() {
- return this.message;
- }
-
- /** If this returns true, appropriate abstract resource has a fatal issue */
- public boolean isFatal() {
- return this.fatal;
- }
-
- /** Corresponding object (having the issue) */
- public Object getSource() {
- return this.source;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/model/package-info.java
deleted file mode 100644
index e535410f688..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/model/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides an abstract model of a resource class.
- */
-package com.sun.jersey.api.model;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/package-info.java
deleted file mode 100644
index 35a4f1c4977..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for responses and exceptions.
- */
-package com.sun.jersey.api; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/provider/jaxb/XmlHeader.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/provider/jaxb/XmlHeader.java
deleted file mode 100644
index af7b42c9784..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/provider/jaxb/XmlHeader.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.provider.jaxb;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/** Allows to specify XML header for XML output produced by a resource method
- * it is attached to.
- * <p>
- * Example usage:
- * <pre>
- * @GET
- * @Produces("application/xml")
- * @XmlHeader("&lt;?xml-stylesheet type='text/xsl' href='foobar.xsl' ?&gt;")
- * public JaxbBean get() {
- * ...
- * }
- * </pre>
- *
- * @author Martin Matula
- */
-@Target(ElementType.METHOD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface XmlHeader {
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/representation/Form.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/representation/Form.java
deleted file mode 100644
index 7bea66f14bb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/representation/Form.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.representation;
-
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-
-/**
- * An implementation of {@link javax.ws.rs.core.MultivaluedMap} that may be
- * used for reading/writing String-based form parameters.
- *
- * @author Doug Kohlert
- */
-public class Form extends MultivaluedMapImpl {
- static final long serialVersionUID = 2572713614319991270L;
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/representation/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/representation/package-info.java
deleted file mode 100644
index 4284d88b1f3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/representation/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for particular representations.
- */
-package com.sun.jersey.api.representation;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriBuilderImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriBuilderImpl.java
deleted file mode 100644
index ce2bc5bee5d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriBuilderImpl.java
+++ /dev/null
@@ -1,662 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.uri;
-
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.UriBuilderException;
-
-/**
- * An implementaton of {@link UriBuilder}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class UriBuilderImpl extends UriBuilder {
-
- // All fields should be in the percent-encoded form
-
- private String scheme;
-
- private String ssp;
-
- private String authority;
-
- private String userInfo;
-
- private String host;
-
- private int port = -1;
-
- private final StringBuilder path;
-
- private MultivaluedMap<String, String> matrixParams;
-
- private final StringBuilder query;
-
- private MultivaluedMap<String, String> queryParams;
-
- private String fragment;
-
- public UriBuilderImpl() {
- path = new StringBuilder();
- query = new StringBuilder();
- }
-
- private UriBuilderImpl(UriBuilderImpl that) {
- this.scheme = that.scheme;
- this.ssp = that.ssp;
- this.userInfo = that.userInfo;
- this.host = that.host;
- this.port = that.port;
- this.path = new StringBuilder(that.path);
- this.query = new StringBuilder(that.query);
- this.fragment = that.fragment;
- }
-
- @Override
- public UriBuilder clone() {
- return new UriBuilderImpl(this);
- }
-
- @Override
- public UriBuilder uri(URI uri) {
- if (uri == null)
- throw new IllegalArgumentException("URI parameter is null");
-
- if (uri.getRawFragment() != null) fragment = uri.getRawFragment();
-
- if (uri.isOpaque()) {
- scheme = uri.getScheme();
- ssp = uri.getRawSchemeSpecificPart();
- return this;
- }
-
- if (uri.getScheme() == null) {
- if (ssp != null) {
- if (uri.getRawSchemeSpecificPart() != null) {
- ssp = uri.getRawSchemeSpecificPart();
- return this;
- }
- }
- } else {
- scheme = uri.getScheme();
- }
-
- ssp = null;
- if (uri.getRawAuthority() != null) {
- if (uri.getRawUserInfo() == null && uri.getHost() == null && uri.getPort() == -1) {
- authority = uri.getRawAuthority();
- userInfo = null;
- host = null;
- port = -1;
- } else {
- authority = null;
- if (uri.getRawUserInfo() != null) userInfo = uri.getRawUserInfo();
- if (uri.getHost() != null) host = uri.getHost();
- if (uri.getPort() != -1) port = uri.getPort();
- }
- }
-
- if (uri.getRawPath() != null && uri.getRawPath().length() > 0) {
- path.setLength(0);
- path.append(uri.getRawPath());
- }
- if (uri.getRawQuery() != null && uri.getRawQuery().length() > 0) {
- query.setLength(0);
- query.append(uri.getRawQuery());
-
- }
-
- return this;
- }
-
- @Override
- public UriBuilder scheme(String scheme) {
- if (scheme != null) {
- this.scheme = scheme;
- UriComponent.validate(scheme, UriComponent.Type.SCHEME, true);
- } else {
- this.scheme = null;
- }
- return this;
- }
-
- @Override
- public UriBuilder schemeSpecificPart(String ssp) {
- if (ssp == null)
- throw new IllegalArgumentException("Scheme specific part parameter is null");
-
- // TODO encode or validate scheme specific part
- // This will not work for template variables present in the spp
- StringBuilder sb = new StringBuilder();
- if (scheme != null) sb.append(scheme).append(':');
- if (ssp != null)
- sb.append(ssp);
- if (fragment != null && fragment.length() > 0) sb.append('#').append(fragment);
- URI uri = createURI(sb.toString());
-
- if (uri.getRawSchemeSpecificPart() != null && uri.getRawPath() == null) {
- this.ssp = uri.getRawSchemeSpecificPart();
- } else {
- this.ssp = null;
-
- if (uri.getRawAuthority() != null) {
- if (uri.getRawUserInfo() == null && uri.getHost() == null && uri.getPort() == -1) {
- authority = uri.getRawAuthority();
- userInfo = null;
- host = null;
- port = -1;
- } else {
- authority = null;
- userInfo = uri.getRawUserInfo();
- host = uri.getHost();
- port = uri.getPort();
- }
- }
-
- path.setLength(0);
- path.append(replaceNull(uri.getRawPath()));
-
- query.setLength(0);
- query.append(replaceNull(uri.getRawQuery()));
- }
- return this;
- }
-
- @Override
- public UriBuilder userInfo(String ui) {
- checkSsp();
- this.userInfo = (ui != null) ?
- encode(ui, UriComponent.Type.USER_INFO) : null;
- return this;
- }
-
- @Override
- public UriBuilder host(String host) {
- checkSsp();
- if(host != null) {
- if(host.length() == 0) // null is used to reset host setting
- throw new IllegalArgumentException("Invalid host name");
- this.host = encode(host, UriComponent.Type.HOST);
- } else {
- this.host = null;
- }
- return this;
- }
-
- @Override
- public UriBuilder port(int port) {
- checkSsp();
- if(port < -1) // -1 is used to reset port setting and since URI allows
- // as port any positive integer, so do we.
- throw new IllegalArgumentException("Invalid port value");
- this.port = port;
- return this;
- }
-
- @Override
- public UriBuilder replacePath(String path) {
- checkSsp();
- this.path.setLength(0);
- if(path != null)
- appendPath(path);
- return this;
- }
-
- @Override
- public UriBuilder path(String path) {
- checkSsp();
- appendPath(path);
- return this;
- }
-
- @Override
- public UriBuilder path(Class resource) {
- checkSsp();
- if (resource == null)
- throw new IllegalArgumentException("Resource parameter is null");
-
- Class<?> c = resource;
- Path p = c.getAnnotation(Path.class);
- if (p == null)
- throw new IllegalArgumentException("The class, " + resource + " is not annotated with @Path");
- appendPath(p);
- return this;
- }
-
- @Override
- public UriBuilder path(Class resource, String methodName) {
- checkSsp();
- if (resource == null)
- throw new IllegalArgumentException("Resource parameter is null");
- if (methodName == null)
- throw new IllegalArgumentException("MethodName parameter is null");
-
- Method[] methods = resource.getMethods();
- Method found = null;
- for (Method m : methods) {
- if (methodName.equals(m.getName())) {
- if (found == null) found = m;
- else
- throw new IllegalArgumentException();
- }
- }
-
- if (found == null)
- throw new IllegalArgumentException("The method named, " + methodName +
- ", is not specified by " + resource);
-
- appendPath(getPath(found));
-
- return this;
- }
-
- @Override
- public UriBuilder path(Method method) {
- checkSsp();
- if (method == null)
- throw new IllegalArgumentException("Method is null");
- appendPath(getPath(method));
- return this;
- }
-
- private Path getPath(AnnotatedElement ae) {
- Path p = ae.getAnnotation(Path.class);
- if (p == null)
- throw new IllegalArgumentException("The annotated element, " +
- ae + " is not annotated with @Path");
- return p;
- }
-
-
- @Override
- public UriBuilder segment(String... segments) throws IllegalArgumentException {
- checkSsp();
- if (segments == null)
- throw new IllegalArgumentException("Segments parameter is null");
-
- for (String segment: segments)
- appendPath(segment, true);
- return this;
- }
-
- @Override
- public UriBuilder replaceMatrix(String matrix) {
- checkSsp();
- int i = path.lastIndexOf("/");
- if (i != -1) i = 0;
- i = path.indexOf(";", i);
- if (i != -1) {
- path.setLength(i + 1);
- } else {
- path.append(';');
- }
-
- if (matrix != null)
- path.append(encode(matrix, UriComponent.Type.PATH));
- return this;
- }
-
- @Override
- public UriBuilder matrixParam(String name, Object... values) {
- checkSsp();
- if (name == null)
- throw new IllegalArgumentException("Name parameter is null");
- if (values == null)
- throw new IllegalArgumentException("Value parameter is null");
- if (values.length == 0)
- return this;
-
- name = encode(name, UriComponent.Type.MATRIX_PARAM);
- if (matrixParams == null) {
- for (Object value : values) {
- path.append(';').append(name);
-
- if (value == null)
- throw new IllegalArgumentException("One or more of matrix value parameters are null");
-
- final String stringValue = value.toString();
- if (stringValue.length() > 0)
- path.append('=').append(encode(stringValue, UriComponent.Type.MATRIX_PARAM));
- }
- } else {
- for (Object value : values) {
- if (value == null)
- throw new IllegalArgumentException("One or more of matrix value parameters are null");
-
- matrixParams.add(name, encode(value.toString(), UriComponent.Type.MATRIX_PARAM));
- }
- }
- return this;
- }
-
- @Override
- public UriBuilder replaceMatrixParam(String name, Object... values) {
- checkSsp();
-
- if (name == null) {
- throw new IllegalArgumentException("Name parameter is null");
- }
-
- if (matrixParams == null) {
- int i = path.lastIndexOf("/");
- if (i != -1) i = 0;
- matrixParams = UriComponent.decodeMatrix((i != -1) ? path.substring(i) : "", false);
- i = path.indexOf(";", i);
- if (i != -1) path.setLength(i);
- }
-
- name = encode(name, UriComponent.Type.MATRIX_PARAM);
- matrixParams.remove(name);
- if (values != null) {
- for (Object value : values) {
- if (value == null)
- throw new IllegalArgumentException("One or more of matrix value parameters are null");
-
- matrixParams.add(name, encode(value.toString(), UriComponent.Type.MATRIX_PARAM));
- }
- }
- return this;
- }
-
- @Override
- public UriBuilder replaceQuery(String query) {
- checkSsp();
- this.query.setLength(0);
- if (query != null)
- this.query.append(encode(query, UriComponent.Type.QUERY));
- return this;
- }
-
- @Override
- public UriBuilder queryParam(String name, Object... values) {
- checkSsp();
- if (name == null)
- throw new IllegalArgumentException("Name parameter is null");
- if (values == null)
- throw new IllegalArgumentException("Value parameter is null");
- if (values.length == 0)
- return this;
-
- name = encode(name, UriComponent.Type.QUERY_PARAM);
- if (queryParams == null) {
- for (Object value : values) {
- if (query.length() > 0) query.append('&');
- query.append(name);
-
- if (value == null)
- throw new IllegalArgumentException("One or more of query value parameters are null");
-
- final String stringValue = value.toString();
- if (stringValue.length() > 0)
- query.append('=').append(encode(stringValue, UriComponent.Type.QUERY_PARAM));
- }
- } else {
- for (Object value : values) {
- if (value == null)
- throw new IllegalArgumentException("One or more of query value parameters are null");
-
- queryParams.add(name, encode(value.toString(), UriComponent.Type.QUERY_PARAM));
- }
- }
- return this;
- }
-
- @Override
- public UriBuilder replaceQueryParam(String name, Object... values) {
- checkSsp();
-
- if (queryParams == null) {
- queryParams = UriComponent.decodeQuery(query.toString(), false);
- query.setLength(0);
- }
-
- name = encode(name, UriComponent.Type.QUERY_PARAM);
- queryParams.remove(name);
-
- if (values == null) return this;
-
- for (Object value : values) {
- if (value == null)
- throw new IllegalArgumentException("One or more of query value parameters are null");
-
- queryParams.add(name, encode(value.toString(), UriComponent.Type.QUERY_PARAM));
- }
- return this;
- }
-
- @Override
- public UriBuilder fragment(String fragment) {
- this.fragment = (fragment != null) ?
- encode(fragment, UriComponent.Type.FRAGMENT) :
- null;
- return this;
- }
-
- private void checkSsp() {
- if (ssp != null)
- throw new IllegalArgumentException("Schema specific part is opaque");
- }
-
- private void appendPath(Path t) {
- if (t == null)
- throw new IllegalArgumentException("Path is null");
-
- appendPath(t.value());
- }
-
- private void appendPath(String path) {
- appendPath(path, false);
- }
-
- private void appendPath(String segments, boolean isSegment) {
- if (segments == null)
- throw new IllegalArgumentException("Path segment is null");
- if (segments.length() == 0)
- return;
-
- // Encode matrix parameters on current path segment
- encodeMatrix();
-
- segments = encode(segments,
- (isSegment) ? UriComponent.Type.PATH_SEGMENT : UriComponent.Type.PATH);
-
- final boolean pathEndsInSlash = path.length() > 0 && path.charAt(path.length() - 1) == '/';
- final boolean segmentStartsWithSlash = segments.charAt(0) == '/';
-
- if (path.length() > 0 && !pathEndsInSlash && !segmentStartsWithSlash) {
- path.append('/');
- } else if (pathEndsInSlash && segmentStartsWithSlash) {
- segments = segments.substring(1);
- if (segments.length() == 0)
- return;
- }
-
- path.append(segments);
- }
-
- private void encodeMatrix() {
- if (matrixParams == null || matrixParams.isEmpty())
- return;
-
- for (Map.Entry<String, List<String>> e : matrixParams.entrySet()) {
- String name = e.getKey();
-
- for (String value : e.getValue()) {
- path.append(';').append(name);
- if (value.length() > 0)
- path.append('=').append(value);
- }
- }
- matrixParams = null;
- }
-
- private void encodeQuery() {
- if (queryParams == null || queryParams.isEmpty())
- return;
-
- for (Map.Entry<String, List<String>> e : queryParams.entrySet()) {
- String name = e.getKey();
-
- for (String value : e.getValue()) {
- if (query.length() > 0) query.append('&');
- query.append(name);
-
- if (value.length() > 0)
- query.append('=').append(value);
- }
- }
- queryParams = null;
- }
-
- private String encode(String s, UriComponent.Type type) {
- return UriComponent.contextualEncode(s, type, true);
- }
-
- public URI buildFromMap(Map<String, ? extends Object> values) {
- return _buildFromMap(true, values);
- }
-
- @Override
- public URI buildFromEncodedMap(Map<String, ? extends Object> values) throws IllegalArgumentException, UriBuilderException {
- return _buildFromMap(false, values);
- }
-
- private URI _buildFromMap(boolean encode, Map<String, ? extends Object> values) {
- if (ssp != null)
- throw new IllegalArgumentException("Schema specific part is opaque");
-
- encodeMatrix();
- encodeQuery();
-
- String uri = UriTemplate.createURI(
- scheme, authority,
- userInfo, host, (port != -1) ? String.valueOf(port) : null,
- path.toString(), query.toString(), fragment, values, encode);
- return createURI(uri);
- }
-
- @Override
- public URI build(Object... values) {
- return _build(true, values);
- }
-
- @Override
- public URI buildFromEncoded(Object... values) {
- return _build(false, values);
- }
-
- private URI _build(boolean encode, Object... values) {
- if (values == null || values.length == 0)
- return createURI(create());
-
- if (ssp != null)
- throw new IllegalArgumentException("Schema specific part is opaque");
-
- encodeMatrix();
- encodeQuery();
-
- String uri = UriTemplate.createURI(
- scheme, authority,
- userInfo, host, (port != -1) ? String.valueOf(port) : null,
- path.toString(), query.toString(), fragment, values, encode);
- return createURI(uri);
- }
-
- private String create() {
- encodeMatrix();
- encodeQuery();
-
- StringBuilder sb = new StringBuilder();
-
- if (scheme != null) sb.append(scheme).append(':');
-
- if (ssp != null) {
- sb.append(ssp);
- } else {
- if (userInfo != null || host != null || port != -1) {
- sb.append("//");
-
- if (userInfo != null && userInfo.length() > 0)
- sb.append(userInfo).append('@');
-
- if (host != null) {
- // TODO check IPv6 address
- sb.append(host);
- }
-
- if (port != -1) sb.append(':').append(port);
- } else if (authority != null) {
- sb.append("//").append(authority);
- }
-
- if (path.length() > 0) {
- if (sb.length() > 0 && path.charAt(0) != '/') sb.append("/");
- sb.append(path);
- }
-
- if (query.length() > 0) sb.append('?').append(query);
- }
-
- if (fragment != null && fragment.length() > 0) sb.append('#').append(fragment);
-
- return UriComponent.encodeTemplateNames(sb.toString());
- }
-
- private URI createURI(String uri) {
- try {
- return new URI(uri);
- } catch (URISyntaxException ex) {
- throw new UriBuilderException(ex);
- }
- }
-
- private String replaceNull(String s) {
- return (s != null) ? s : "";
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriComponent.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriComponent.java
deleted file mode 100644
index b4dc778f045..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriComponent.java
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.uri;
-
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URLDecoder;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.PathSegment;
-
-/**
- * Utility class for validating, encoding and decoding components
- * of a URI.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class UriComponent {
-
- // TODO rewrite to use masks and not lookup tables
- /**
- * The URI component type.
- */
- public enum Type {
-
- /**
- * ALPHA / DIGIT / "-" / "." / "_" / "~" characters
- */
- UNRESERVED,
- /**
- * The URI scheme component type.
- */
- SCHEME,
- /**
- * The URI authority component type.
- */
- AUTHORITY,
- /**
- * The URI user info component type.
- */
- USER_INFO,
- /**
- * The URI host component type.
- */
- HOST,
- /**
- * The URI port component type.
- */
- PORT,
- /**
- * The URI path component type.
- */
- PATH,
- /**
- * The URI path component type that is a path segment.
- */
- PATH_SEGMENT,
- /**
- * The URI path component type that is a matrix parameter.
- */
- MATRIX_PARAM,
- /**
- * The URI query component type.
- */
- QUERY,
- /**
- * The URI query component type that is a query parameter.
- */
- QUERY_PARAM,
- /**
- * The URI fragment component type.
- */
- FRAGMENT,
- }
-
- private UriComponent() {
- }
-
- /**
- * Validates the legal characters of a percent-encoded string that
- * represents a URI component type.
- *
- * @param s the encoded string.
- * @param t the URI compontent type identifying the legal characters.
- * @throws IllegalArgumentException if the encoded string contains illegal
- * characters.
- */
- public static void validate(String s, Type t) {
- validate(s, t, false);
- }
-
- /**
- * Validates the legal characters of a percent-encoded string that
- * represents a URI component type.
- *
- * @param s the encoded string.
- * @param t the URI compontent type identifying the legal characters.
- * @param template true if the encoded string contains URI template variables
- * @throws IllegalArgumentException if the encoded string contains illegal
- * characters.
- */
- public static void validate(String s, Type t, boolean template) {
- int i = _valid(s, t, template);
- if (i > -1) // TODO localize
- {
- throw new IllegalArgumentException("The string '" + s +
- "' for the URI component " + t +
- " contains an invalid character, '" + s.charAt(i) + "', at index " + i);
- }
- }
-
- /**
- * Validates the legal characters of a percent-encoded string that
- * represents a URI component type.
- *
- * @param s the encoded string.
- * @param t the URI compontent type identifying the legal characters.
- * @return true if the encoded string is valid, otherwise false.
- */
- public static boolean valid(String s, Type t) {
- return valid(s, t, false);
- }
-
- /**
- * Validates the legal characters of a percent-encoded string that
- * represents a URI component type.
- *
- * @param s the encoded string.
- * @param t the URI compontent type identifying the legal characters.
- * @param template true if the encoded string contains URI template variables
- * @return true if the encoded string is valid, otherwise false.
- */
- public static boolean valid(String s, Type t, boolean template) {
- return _valid(s, t, template) == -1;
- }
-
- private static int _valid(String s, Type t, boolean template) {
- boolean[] table = ENCODING_TABLES[t.ordinal()];
-
- for (int i = 0; i < s.length(); i++) {
- final char c = s.charAt(i);
- if ((c < 0x80 && c != '%' && !table[c]) || c >= 0x80) {
- if (!template || (c != '{' && c != '}')) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Contextually encodes the characters of string that are either non-ASCII
- * characters or are ASCII characters that must be percent-encoded using the
- * UTF-8 encoding. Percent-encoded characters will be recognized and not
- * double encoded.
- *
- * @param s the string to be encoded.
- * @param t the URI compontent type identifying the ASCII characters that
- * must be percent-encoded.
- * @return the encoded string.
- */
- public static String contextualEncode(String s, Type t) {
- return _encode(s, t, false, true);
- }
-
- /**
- * Contextually encodes the characters of string that are either non-ASCII
- * characters or are ASCII characters that must be percent-encoded using the
- * UTF-8 encoding. Percent-encoded characters will be recognized and not
- * double encoded.
- *
- * @param s the string to be encoded.
- * @param t the URI compontent type identifying the ASCII characters that
- * must be percent-encoded.
- * @param template true if the encoded string contains URI template variables
- * @return the encoded string.
- */
- public static String contextualEncode(String s, Type t, boolean template) {
- return _encode(s, t, template, true);
- }
-
- /**
- * Encodes the characters of string that are either non-ASCII characters
- * or are ASCII characters that must be percent-encoded using the
- * UTF-8 encoding.
- *
- * @param s the string to be encoded.
- * @param t the URI compontent type identifying the ASCII characters that
- * must be percent-encoded.
- * @return the encoded string.
- */
- public static String encode(String s, Type t) {
- return _encode(s, t, false, false);
- }
-
- /**
- * Encodes the characters of string that are either non-ASCII characters
- * or are ASCII characters that must be percent-encoded using the
- * UTF-8 encoding.
- *
- * @param s the string to be encoded.
- * @param t the URI compontent type identifying the ASCII characters that
- * must be percent-encoded.
- * @param template true if the encoded string contains URI template variables
- * @return the encoded string.
- */
- public static String encode(String s, Type t, boolean template) {
- return _encode(s, t, template, false);
- }
-
- /**
- * Encodes a string with template parameters names present, specifically the
- * characters '{' and '}' will be percent-encoded.
- *
- * @param s the string with zero or more template parameters names
- * @return the string with encoded template parameters names.
- */
- public static String encodeTemplateNames(String s) {
- int i = s.indexOf('{');
- if (i != -1)
- s = s.replace("{", "%7B");
- i = s.indexOf('}');
- if (i != -1)
- s = s.replace("}", "%7D");
-
- return s;
- }
-
- private static String _encode(String s, Type t, boolean template, boolean contextualEncode) {
- final boolean[] table = ENCODING_TABLES[t.ordinal()];
-
- StringBuilder sb = null;
- for (int i = 0; i < s.length(); i++) {
- final char c = s.charAt(i);
- if (c < 0x80 && table[c]) {
- if (sb != null) sb.append(c);
- } else {
- if (template && (c == '{' || c == '}')) {
- if (sb != null) sb.append(c);
- continue;
- } else if (contextualEncode) {
- if (c == '%' && i + 2 < s.length()) {
- if (isHexCharacter(s.charAt(i + 1)) &&
- isHexCharacter(s.charAt(i + 2))) {
- if (sb != null)
- sb.append('%').append(s.charAt(i + 1)).append(s.charAt(i + 2));
- i += 2;
- continue;
- }
- }
- }
-
- if (sb == null) {
- sb = new StringBuilder();
- sb.append(s.substring(0, i));
- }
-
- if (c < 0x80) {
- if (c == ' ' && (t == Type.QUERY_PARAM)) {
- sb.append('+');
- } else {
- appendPercentEncodedOctet(sb, c);
- }
- } else {
- appendUTF8EncodedCharacter(sb, c);
- }
- }
- }
-
- return (sb == null) ? s : sb.toString();
- }
- private final static char[] HEX_DIGITS = {
- '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
- };
-
- private static void appendPercentEncodedOctet(StringBuilder sb, int b) {
- sb.append('%');
- sb.append(HEX_DIGITS[b >> 4]);
- sb.append(HEX_DIGITS[b & 0x0F]);
- }
-
- private static void appendUTF8EncodedCharacter(StringBuilder sb, char c) {
- final ByteBuffer bb = UTF_8_CHARSET.encode("" + c);
-
- while (bb.hasRemaining()) {
- appendPercentEncodedOctet(sb, bb.get() & 0xFF);
- }
- }
- private static final String[] SCHEME = {"0-9", "A-Z", "a-z", "+", "-", "."};
- private static final String[] UNRESERVED = {"0-9", "A-Z", "a-z", "-", ".", "_", "~"};
- private static final String[] SUB_DELIMS = {"!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="};
- private static final boolean[][] ENCODING_TABLES = initEncodingTables();
-
- private static boolean[][] initEncodingTables() {
- boolean[][] tables = new boolean[Type.values().length][];
-
- List<String> l = new ArrayList<String>();
- l.addAll(Arrays.asList(SCHEME));
- tables[Type.SCHEME.ordinal()] = initEncodingTable(l);
-
- l.clear();
-
- l.addAll(Arrays.asList(UNRESERVED));
- tables[Type.UNRESERVED.ordinal()] = initEncodingTable(l);
-
- l.addAll(Arrays.asList(SUB_DELIMS));
-
- tables[Type.HOST.ordinal()] = initEncodingTable(l);
-
- tables[Type.PORT.ordinal()] = initEncodingTable(Arrays.asList("0-9"));
-
- l.add(":");
-
- tables[Type.USER_INFO.ordinal()] = initEncodingTable(l);
-
- l.add("@");
-
- tables[Type.AUTHORITY.ordinal()] = initEncodingTable(l);
-
- tables[Type.PATH_SEGMENT.ordinal()] = initEncodingTable(l);
- tables[Type.PATH_SEGMENT.ordinal()][';'] = false;
-
- tables[Type.MATRIX_PARAM.ordinal()] = tables[Type.PATH_SEGMENT.ordinal()].clone();
- tables[Type.MATRIX_PARAM.ordinal()]['='] = false;
-
- l.add("/");
-
- tables[Type.PATH.ordinal()] = initEncodingTable(l);
-
- l.add("?");
-
- tables[Type.QUERY.ordinal()] = initEncodingTable(l);
-
- tables[Type.FRAGMENT.ordinal()] = tables[Type.QUERY.ordinal()];
-
- tables[Type.QUERY_PARAM.ordinal()] = initEncodingTable(l);
- tables[Type.QUERY_PARAM.ordinal()]['='] = false;
- tables[Type.QUERY_PARAM.ordinal()]['+'] = false;
- tables[Type.QUERY_PARAM.ordinal()]['&'] = false;
-
- return tables;
- }
-
- private static boolean[] initEncodingTable(List<String> allowed) {
- boolean[] table = new boolean[0x80];
- for (String range : allowed) {
- if (range.length() == 1) {
- table[range.charAt(0)] = true;
- } else if (range.length() == 3 && range.charAt(1) == '-') {
- for (int i = range.charAt(0); i <= range.charAt(2); i++) {
- table[i] = true;
- }
- }
- }
-
- return table;
- }
- private static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
-
- /**
- * Decodes characters of a string that are percent-encoded octets using
- * UTF-8 decoding (if needed).
- * <p>
- * It is assumed that the string is valid according to an (unspecified) URI
- * component type. If a sequence of contiguous percent-encoded octets is
- * not a valid UTF-8 character then the octets are replaced with '\uFFFD'.
- * <p>
- * If the URI component is of type HOST then any "%" found between "[]" is
- * left alone. It is an IPv6 literal with a scope_id.
- * <p>
- * If the URI component is of type QUERY_PARAM then any "+" is decoded as
- * as ' '.
- * <p>
- * @param s the string to be decoded.
- * @param t the URI component type, may be null.
- * @return the decoded string.
- * @throws IllegalArgumentException if a malformed percent-encoded octet is
- * detected
- */
- public static String decode(String s, Type t) {
- if (s == null) {
- throw new IllegalArgumentException();
- }
-
- final int n = s.length();
- if (n == 0) {
- return s;
- }
-
- // If there are no percent-escaped octets
- if (s.indexOf('%') < 0) {
- // If there are no '+' characters for query param
- if (t == Type.QUERY_PARAM) {
- if (s.indexOf('+') < 0) {
- return s;
- }
- } else {
- return s;
- }
- } else {
- // Malformed percent-escaped octet at the end
- if (n < 2) // TODO localize
- {
- throw new IllegalArgumentException("Malformed percent-encoded octet at index 1");
- }
-
- // Malformed percent-escaped octet at the end
- if (s.charAt(n - 2) == '%') // TODO localize
- {
- throw new IllegalArgumentException("Malformed percent-encoded octet at index " + (n - 2));
- }
- }
-
- if (t == null)
- return decode(s, n);
-
- switch (t) {
- case HOST :
- return decodeHost(s, n);
- case QUERY_PARAM :
- return decodeQueryParam(s, n);
- default :
- return decode(s, n);
- }
- }
-
- /**
- * Decode the query component of a URI.
- *
- * @param u the URI.
- * @param decode true if the query parameters of the query component
- * should be in decoded form.
- * @return the multivalued map of query parameters.
- */
- public static MultivaluedMap<String, String> decodeQuery(URI u, boolean decode) {
- return decodeQuery(u.getRawQuery(), decode);
- }
-
- /**
- * Decode the query component of a URI.
- *
- * @param q the query component in encoded form.
- * @param decode true of the query parameters of the query component
- * should be in decoded form.
- * @return the multivalued map of query parameters.
- */
- public static MultivaluedMap<String, String> decodeQuery(String q, boolean decode) {
- MultivaluedMap<String, String> queryParameters = new MultivaluedMapImpl();
-
- if (q == null || q.length() == 0) {
- return queryParameters;
- }
-
- int s = 0, e = 0;
- do {
- e = q.indexOf('&', s);
-
- if (e == -1) {
- decodeQueryParam(queryParameters, q.substring(s), decode);
- } else if (e > s) {
- decodeQueryParam(queryParameters, q.substring(s, e), decode);
- }
- s = e + 1;
- } while (s > 0 && s < q.length());
-
- return queryParameters;
- }
-
- private static void decodeQueryParam(MultivaluedMap<String, String> params,
- String param, boolean decode) {
- try {
- int equals = param.indexOf('=');
- if (equals > 0) {
- params.add(
- URLDecoder.decode(param.substring(0, equals), "UTF-8"),
- (decode) ? URLDecoder.decode(param.substring(equals + 1), "UTF-8") : param.substring(equals + 1));
- } else if (equals == 0) {
- // no key declared, ignore
- } else if (param.length() > 0) {
- params.add(
- URLDecoder.decode(param, "UTF-8"),
- "");
- }
- } catch (UnsupportedEncodingException ex) {
- // This should never occur
- throw new IllegalArgumentException(ex);
- }
- }
-
- private static final class PathSegmentImpl implements PathSegment {
-
- private static final PathSegment EMPTY_PATH_SEGMENT = new PathSegmentImpl("", false);
- private final String path;
- private final MultivaluedMap<String, String> matrixParameters;
-
- PathSegmentImpl(String path, boolean decode) {
- this(path, decode, new MultivaluedMapImpl());
- }
-
- PathSegmentImpl(String path, boolean decode, MultivaluedMap<String, String> matrixParameters) {
- this.path = (decode) ? UriComponent.decode(path, UriComponent.Type.PATH_SEGMENT) : path;
- this.matrixParameters = matrixParameters;
- }
-
- @Override
- public String getPath() {
- return path;
- }
-
- @Override
- public MultivaluedMap<String, String> getMatrixParameters() {
- return matrixParameters;
- }
- }
-
- /**
- * Decode the path component of a URI as path segments.
- *
- * @param u the URI. If the path component is an absolute path component
- * then the leading '/' is ignored and is not considered a delimiator
- * of a path segment.
- * @param decode true if the path segments of the path component
- * should be in decoded form.
- * @return the list of path segments.
- */
- public static List<PathSegment> decodePath(URI u, boolean decode) {
- String rawPath = u.getRawPath();
- if (rawPath != null && rawPath.length() > 0 && rawPath.charAt(0) == '/') {
- rawPath = rawPath.substring(1);
- }
- return decodePath(rawPath, decode);
- }
-
- /**
- * Decode the path component of a URI as path segments.
- * <p>
- * Any '/' character in the path is considered to be a deliminator
- * between two path segments. Thus if the path is '/' then the path segment
- * list will contain two empty path segments. If the path is "//" then
- * the path segment list will contain three empty path segments. If the path
- * is "/a/" the path segment list will consist of the following path
- * segments in order: "", "a" and "".
- *
- * @param path the path component in encoded form.
- * @param decode true if the path segments of the path component
- * should be in decoded form.
- * @return the list of path segments.
- */
- public static List<PathSegment> decodePath(String path, boolean decode) {
- List<PathSegment> segments = new LinkedList<PathSegment>();
-
- if (path == null) {
- return segments;
- }
-
- int s = 0;
- int e = -1;
- do {
- s = e + 1;
- e = path.indexOf('/', s);
-
- if (e > s) {
- decodePathSegment(segments, path.substring(s, e), decode);
- } else if (e == s) {
- segments.add(PathSegmentImpl.EMPTY_PATH_SEGMENT);
- }
- } while (e != -1);
- if (s < path.length()) {
- decodePathSegment(segments, path.substring(s), decode);
- } else {
- segments.add(PathSegmentImpl.EMPTY_PATH_SEGMENT);
- }
- return segments;
- }
-
- public static void decodePathSegment(List<PathSegment> segments, String segment, boolean decode) {
- int colon = segment.indexOf(';');
- if (colon != -1) {
- segments.add(new PathSegmentImpl(
- (colon == 0) ? "" : segment.substring(0, colon),
- decode,
- decodeMatrix(segment, decode)));
- } else {
- segments.add(new PathSegmentImpl(
- segment,
- decode));
- }
- }
-
- /**
- * Decode the matrix component of a URI path segment.
- *
- * @param pathSegment the path segment component in encoded form.
- * @param decode true if the matrix parameters of the path segment component
- * should be in decoded form.
- * @return the multivalued map of matrix parameters.
- */
- public static MultivaluedMap<String, String> decodeMatrix(String pathSegment, boolean decode) {
- MultivaluedMap<String, String> matrixMap = new MultivaluedMapImpl();
-
- // Skip over path segment
- int s = pathSegment.indexOf(';') + 1;
- if (s == 0 || s == pathSegment.length()) {
- return matrixMap;
- }
-
- int e = 0;
- do {
- e = pathSegment.indexOf(';', s);
-
- if (e == -1) {
- decodeMatrixParam(matrixMap, pathSegment.substring(s), decode);
- } else if (e > s) {
- decodeMatrixParam(matrixMap, pathSegment.substring(s, e), decode);
- }
- s = e + 1;
- } while (s > 0 && s < pathSegment.length());
-
- return matrixMap;
- }
-
- private static void decodeMatrixParam(MultivaluedMap<String, String> params,
- String param, boolean decode) {
- int equals = param.indexOf('=');
- if (equals > 0) {
- params.add(
- UriComponent.decode(param.substring(0, equals), UriComponent.Type.MATRIX_PARAM),
- (decode) ? UriComponent.decode(param.substring(equals + 1), UriComponent.Type.MATRIX_PARAM) : param.substring(equals + 1));
- } else if (equals == 0) {
- // no key declared, ignore
- } else if (param.length() > 0) {
- params.add(
- UriComponent.decode(param, UriComponent.Type.MATRIX_PARAM),
- "");
- }
- }
-
- private static String decode(String s, int n) {
- final StringBuilder sb = new StringBuilder(n);
- ByteBuffer bb = null;
-
- for (int i = 0; i < n;) {
- final char c = s.charAt(i++);
- if (c != '%') {
- sb.append(c);
- } else {
- bb = decodePercentEncodedOctets(s, i, bb);
- i = decodeOctets(i, bb, sb);
- }
- }
-
- return sb.toString();
- }
-
- private static String decodeQueryParam(String s, int n) {
- final StringBuilder sb = new StringBuilder(n);
- ByteBuffer bb = null;
-
- for (int i = 0; i < n;) {
- final char c = s.charAt(i++);
- if (c != '%') {
- if (c != '+')
- sb.append(c);
- else
- sb.append(' ');
- } else {
- bb = decodePercentEncodedOctets(s, i, bb);
- i = decodeOctets(i, bb, sb);
- }
- }
-
- return sb.toString();
- }
-
- private static String decodeHost(String s, int n) {
- final StringBuilder sb = new StringBuilder(n);
- ByteBuffer bb = null;
-
- boolean betweenBrackets = false;
- for (int i = 0; i < n;) {
- final char c = s.charAt(i++);
- if (c == '[') {
- betweenBrackets = true;
- } else if (betweenBrackets && c == ']') {
- betweenBrackets = false;
- }
-
- if (c != '%' || betweenBrackets) {
- sb.append(c);
- } else {
- bb = decodePercentEncodedOctets(s, i, bb);
- i = decodeOctets(i, bb, sb);
- }
- }
-
- return sb.toString();
- }
-
- /**
- * Decode a contigious sequence of percent encoded octets.
- * <p>
- * Assumes the index, i, starts that the first hex digit of the first
- * percent-encoded octet.
- */
- private static ByteBuffer decodePercentEncodedOctets(String s, int i, ByteBuffer bb) {
- if (bb == null)
- bb = ByteBuffer.allocate(1);
- else
- bb.clear();
-
- while (true) {
- // Decode the hex digits
- bb.put((byte) (decodeHex(s, i++) << 4 | decodeHex(s, i++)));
-
- // Finish if at the end of the string
- if (i == s.length()) {
- break;
- }
-
- // Finish if no more percent-encoded octets follow
- if (s.charAt(i++) != '%') {
- break;
- }
-
- // Check if the byte buffer needs to be increased in size
- if (bb.position() == bb.capacity()) {
- bb.flip();
- // Create a new byte buffer with the maximum number of possible
- // octets, hence resize should only occur once
- ByteBuffer bb_new = ByteBuffer.allocate(s.length() / 3);
- bb_new.put(bb);
- bb = bb_new;
- }
- }
-
- bb.flip();
- return bb;
- }
-
- /**
- * Decodes octets to characters using the UTF-8 decoding and appends
- * the characters to a StringBuffer.
- * @return the index to the next unchecked character in the string to decode
- */
- private static int decodeOctets(int i, ByteBuffer bb, StringBuilder sb) {
- // If there is only one octet and is an ASCII character
- if (bb.limit() == 1 && (bb.get(0) & 0xFF) < 0x80) {
- // Octet can be appended directly
- sb.append((char) bb.get(0));
- return i + 2;
- } else {
- //
- CharBuffer cb = UTF_8_CHARSET.decode(bb);
- sb.append(cb.toString());
- return i + bb.limit() * 3 - 1;
- }
- }
-
- private static int decodeHex(String s, int i) {
- final int v = decodeHex(s.charAt(i));
- if (v == -1) // TODO localize
- {
- throw new IllegalArgumentException("Malformed percent-encoded octet at index " + i +
- ", invalid hexadecimal digit '" + s.charAt(i) + "'");
- }
- return v;
- }
- private static final int[] HEX_TABLE = initHexTable();
-
- private static int[] initHexTable() {
- int[] table = new int[0x80];
- Arrays.fill(table, -1);
-
- for (char c = '0'; c <= '9'; c++) {
- table[c] = c - '0';
- }
- for (char c = 'A'; c <= 'F'; c++) {
- table[c] = c - 'A' + 10;
- }
- for (char c = 'a'; c <= 'f'; c++) {
- table[c] = c - 'a' + 10;
- }
- return table;
- }
-
- private static int decodeHex(char c) {
- return (c < 128) ? HEX_TABLE[c] : -1;
- }
-
- private static boolean isHexCharacter(char c) {
- return c < 128 && HEX_TABLE[c] != -1;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriPattern.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriPattern.java
deleted file mode 100644
index 252bd929f88..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriPattern.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.uri;
-
-import java.util.List;
-import java.util.Map;
-import java.util.regex.MatchResult;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-/**
- * A URI pattern for matching a URI against a regular expression
- * and returning capturing group values for any capturing groups present in
- * the expression.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class UriPattern {
- /**
- * The empty URI pattern that matches the null or empty URI path
- */
- public static final UriPattern EMPTY = new UriPattern();
-
- /**
- * The regular expression for matching URIs
- * and obtaining capturing group values.
- */
- private final String regex;
-
- /**
- * The compiled regular expression of {@link #regex}
- */
- private final Pattern regexPattern;
-
- private final int[] groupIndexes;
-
- /**
- * Construct an empty pattern.
- */
- protected UriPattern() {
- this.regex = "";
- this.regexPattern = null;
- this.groupIndexes = null;
- }
-
- /**
- * Construct a new URI pattern.
- *
- * @param regex the regular expression. If the expression is null or an
- * empty string then the pattern will only match a null or empty
- * URI path.
- * @throws java.util.regex.PatternSyntaxException if the
- * regular expression could not be compiled
- */
- public UriPattern(String regex) {
- this(regex, UriTemplateParser.EMPTY_INT_ARRAY);
- }
-
- /**
- * Construct a new URI pattern.
- *
- * @param regex the regular expression. If the expression is null or an
- * empty string then the pattern will only match a null or empty
- * URI path.
- * @param groupIndexes the array of group indexes to capturing groups.
- * @throws java.util.regex.PatternSyntaxException if the
- * regular expression could not be compiled
- */
- public UriPattern(String regex, int[] groupIndexes) {
- this(compile(regex), groupIndexes);
- }
-
- private static Pattern compile(String regex) {
- return (regex == null || regex.length() == 0) ? null : Pattern.compile(regex);
- }
-
- /**
- * Construct a new URI pattern.
- *
- * @param regexPattern the regular expression pattern
- * @throws IllegalArgumentException if the regexPattern is null.
- */
- public UriPattern(Pattern regexPattern) {
- this(regexPattern, UriTemplateParser.EMPTY_INT_ARRAY);
- }
-
- /**
- * Construct a new URI pattern.
- *
- * @param regexPattern the regular expression pattern
- * @param groupIndexes the array of group indexes to capturing groups.
- * @throws IllegalArgumentException if the regexPattern is null.
- */
- public UriPattern(Pattern regexPattern, int[] groupIndexes) {
- if (regexPattern == null)
- throw new IllegalArgumentException();
-
- this.regex = regexPattern.toString();
- this.regexPattern = regexPattern;
- this.groupIndexes = groupIndexes;
- }
-
- /**
- * Get the regular expression.
- *
- * @return the regular expression.
- */
- public final String getRegex() {
- return regex;
- }
-
- /**
- * Get the group indexes.
- *
- * @return the group indexes.
- */
- public final int[] getGroupIndexes() {
- return groupIndexes;
- }
-
- private static final class EmptyStringMatchResult implements MatchResult {
- public int start() {
- return 0;
- }
-
- public int start(int group) {
- if (group != 0)
- throw new IndexOutOfBoundsException();
- return start();
- }
-
- public int end() {
- return 0;
- }
-
- public int end(int group) {
- if (group != 0)
- throw new IndexOutOfBoundsException();
- return end();
- }
-
- public String group() {
- return "";
- }
-
- public String group(int group) {
- if (group != 0)
- throw new IndexOutOfBoundsException();
- return group();
- }
-
- public int groupCount() {
- return 0;
- }
- }
-
- private static final EmptyStringMatchResult EMPTY_STRING_MATCH_RESULT = new EmptyStringMatchResult();
-
- private final class GroupIndexMatchResult implements MatchResult {
- private final MatchResult r;
-
- GroupIndexMatchResult(MatchResult r) {
- this.r = r;
- }
-
- public int start() {
- return r.start();
- }
-
- public int start(int group) {
- if (group > groupCount())
- throw new IndexOutOfBoundsException();
-
- return (group > 0) ? r.start(groupIndexes[group - 1]) : r.start();
- }
-
- public int end() {
- return r.end();
- }
-
- public int end(int group) {
- if (group > groupCount())
- throw new IndexOutOfBoundsException();
-
- return (group > 0) ? r.end(groupIndexes[group - 1]) : r.end();
- }
-
- public String group() {
- return r.group();
- }
-
- public String group(int group) {
- if (group > groupCount())
- throw new IndexOutOfBoundsException();
-
- return (group > 0) ? r.group(groupIndexes[group - 1]) : r.group();
- }
-
- public int groupCount() {
- return groupIndexes.length - 1;
- }
- }
-
- /**
- * Match a URI against the pattern.
- *
- * @param uri the uri to match against the template.
- * @return the match result, otherwise null if no match occurs.
- */
- public final MatchResult match(CharSequence uri) {
- // Check for match against the empty pattern
- if (uri == null || uri.length() == 0)
- return (regexPattern == null) ? EMPTY_STRING_MATCH_RESULT : null;
- else if (regexPattern == null)
- return null;
-
- // Match the URI to the URI template regular expression
- Matcher m = regexPattern.matcher(uri);
- if (!m.matches())
- return null;
-
- return (groupIndexes.length > 0) ? new GroupIndexMatchResult(m) : m;
- }
-
- /**
- * Match a URI against the pattern.
- * <p>
- * If the URI matches against the pattern then the capturing group values
- * (if any) will be added to a list passed in as parameter.
- *
- * @param uri the uri to match against the template.
- * @param groupValues the list to add the values of a pattern's
- * capturing groups if matching is successful. The values are added
- * in the same order as the pattern's capturing groups. The list
- * is cleared before values are added.
- * @return true if the URI matches the pattern, otherwise false.
- * @throws IllegalArgumentException if the uri or
- * capturingGroupValues is null.
- */
- public final boolean match(CharSequence uri, List<String> groupValues) {
- if (groupValues == null)
- throw new IllegalArgumentException();
-
- // Check for match against the empty pattern
- if (uri == null || uri.length() == 0)
- return (regexPattern == null) ? true : false;
- else if (regexPattern == null)
- return false;
-
- // Match the URI to the URI template regular expression
- Matcher m = regexPattern.matcher(uri);
- if (!m.matches())
- return false;
-
- groupValues.clear();
- if (groupIndexes.length > 0) {
- for (int i = 0; i < groupIndexes.length - 1; i++) {
- groupValues.add(m.group(groupIndexes[i]));
- }
- } else {
- for (int i = 1; i <= m.groupCount(); i++) {
- groupValues.add(m.group(i));
- }
- }
-
- // TODO check for consistency of different capturing groups
- // that must have the same value
-
- return true;
- }
-
- /**
- * Match a URI against the pattern.
- * <p>
- * If the URI matches against the pattern then the capturing group values
- * (if any) will be added to a map passed in as parameter.
- *
- * @param uri the uri to match against the template.
- * @param groupNames the list names associated with a pattern's
- * capturing groups. The names MUST be in the same order as the
- * pattern's capturing groups and the size MUST be equal to or
- * less than the number of capturing groups.
- * @param groupValues the map to add the values of a pattern's
- * capturing groups if matching is successful. A values is put
- * into the map using the group name associated with the
- * capturing group. The map is cleared before values are added.
- * @return true if the URI matches the pattern, otherwise false.
- * @throws IllegalArgumentException if the uri or
- * capturingGroupValues is null.
- */
- public final boolean match(CharSequence uri,
- List<String> groupNames, Map<String, String> groupValues) {
- if (groupValues == null)
- throw new IllegalArgumentException();
-
- // Check for match against the empty pattern
- if (uri == null || uri.length() == 0)
- return (regexPattern == null) ? true : false;
- else if (regexPattern == null)
- return false;
-
- // Match the URI to the URI template regular expression
- Matcher m = regexPattern.matcher(uri);
- if (!m.matches())
- return false;
-
- // Assign the matched group values to group names
- groupValues.clear();
- for (int i = 0; i < groupNames.size(); i++) {
- String name = groupNames.get(i);
- String currentValue = m.group((groupIndexes.length > 0) ? groupIndexes[i] : i + 1);
-
- // Group names can have the same name occuring more than once,
- // check that groups values are same.
- String previousValue = groupValues.get(name);
- if (previousValue != null && !previousValue.equals(currentValue))
- return false;
-
- groupValues.put(name, currentValue);
- }
-
- return true;
- }
-
- @Override
- public final int hashCode() {
- return regex.hashCode();
- }
-
- @Override
- public final boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final UriPattern that = (UriPattern) obj;
- if (this.regex != that.regex &&
- (this.regex == null || !this.regex.equals(that.regex))) {
- return false;
- }
- return true;
- }
-
- @Override
- public final String toString() {
- return regex;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplate.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplate.java
deleted file mode 100644
index c9205af3feb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplate.java
+++ /dev/null
@@ -1,895 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.uri;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-
-/**
- * A URI template.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class UriTemplate {
- /**
- * Order the templates according according to JAX-RS.
- * <p>
- * Sort the set of matching resource classes using the number of
- * characters in the regular expression not resulting from template
- * variables as the primary key, the number of matching groups
- * as a secondary key, and the number of explicit regular expression
- * declarations as the tertiary key.
- */
- static public final Comparator<UriTemplate> COMPARATOR = new Comparator<UriTemplate>() {
- public int compare(UriTemplate o1, UriTemplate o2) {
- if (o1 == null && o2 == null)
- return 0;
- if (o1 == null)
- return 1;
- if (o2 == null)
- return -1;
-
- if (o1 == EMPTY && o2 == EMPTY)
- return 0;
- if (o1 == EMPTY)
- return 1;
- if (o2 == EMPTY)
- return -1;
-
- // Compare the number of explicit characters
- // Note that it is important that o2 is compared against o1
- // so that a regular expression with say 10 explicit characters
- // is less than a regular expression with say 5 explicit characters.
- int i = o2.getNumberOfExplicitCharacters() - o1.getNumberOfExplicitCharacters();
- if (i != 0) return i;
-
- // If the number of explicit characters is equal
- // compare the number of template variables
- // Note that it is important that o2 is compared against o1
- // so that a regular expression with say 10 template variables
- // is less than a regular expression with say 5 template variables.
- i = o2.getNumberOfTemplateVariables() - o1.getNumberOfTemplateVariables();
- if (i != 0) return i;
-
- // If the number of template variables is equal
- // compare the number of explicit regexes
- i = o2.getNumberOfExplicitRegexes() - o1.getNumberOfExplicitRegexes();
- if (i != 0) return i;
-
- // If the number of explicit characters and template variables
- // are equal then comapre the regexes
- // The order does not matter as long as templates with different
- // explicit characters are distinguishable
- return o2.pattern.getRegex().compareTo(o1.pattern.getRegex());
- }
- };
-
- /**
- * The regular expression for matching URI templates and names.
- */
- private static final Pattern TEMPLATE_NAMES_PATTERN = Pattern.compile("\\{(\\w[-\\w\\.]*)\\}");
-
- /**
- * The empty URI template that matches the null or empty URI path
- */
- public static final UriTemplate EMPTY = new UriTemplate();
-
- /**
- * The URI template.
- */
- private final String template;
-
- /**
- * The normalized URI template. Any explicit regex are removed to leave
- * the template variables.
- */
- private final String normalizedTemplate;
-
- /**
- * The pattern generated from the template
- */
- private final UriPattern pattern;
-
- /**
- * True if the URI template ends in a '/' character.
- */
- private final boolean endsWithSlash;
-
- /**
- * The template variables in the URI template.
- */
- private final List<String> templateVariables;
-
- /**
- * The number of explicit regular expressions declared for template
- * variables.
- */
- private final int numOfExplicitRegexes;
-
- /**
- * The number of characters in the regular expression not resulting
- * from conversion of template variables.
- */
- private final int numOfCharacters;
-
- /**
- * Constructor for NULL template
- */
- private UriTemplate() {
- this.template = this.normalizedTemplate = "";
- this.pattern = UriPattern.EMPTY;
- this.endsWithSlash = false;
- this.templateVariables = Collections.emptyList();
- this.numOfExplicitRegexes = this.numOfCharacters = 0;
- }
-
- /**
- * Construct a new URI template.
- * <p>
- * The template will be parsed to extract template variables.
- * <p>
- * A specific regular expression will be generated from the template
- * to match URIs according to the template and map template variables to
- * template values.
- * <p>
- * @param template the template.
- * @throws PatternSyntaxException if the specified
- * regular expression could not be generated
- * @throws IllegalArgumentException if the template is null or
- * an empty string.
- */
- public UriTemplate(String template) throws
- PatternSyntaxException, IllegalArgumentException {
- this(new UriTemplateParser(template));
- }
-
- /**
- * Construct a new URI template.
- * <p>
- * The template will be parsed to extract template variables.
- * <p>
- * A specific regular expression will be generated from the template
- * to match URIs according to the template and map template variables to
- * template values.
- * <p>
- * @param templateParser the parser to parse the template.
- * @throws PatternSyntaxException if the specified
- * regular expression could not be generated
- * @throws IllegalArgumentException if the template is null or
- * an empty string.
- */
- protected UriTemplate(UriTemplateParser templateParser) throws
- PatternSyntaxException, IllegalArgumentException {
- this.template = templateParser.getTemplate();
-
- this.normalizedTemplate = templateParser.getNormalizedTemplate();
-
- this.pattern = createUriPattern(templateParser);
-
- this.numOfExplicitRegexes = templateParser.getNumberOfExplicitRegexes();
-
- this.numOfCharacters = templateParser.getNumberOfLiteralCharacters();
-
- this.endsWithSlash = template.charAt(template.length() - 1) == '/';
-
- this.templateVariables = Collections.unmodifiableList(templateParser.getNames());
- }
-
- /**
- * Create the URI pattern from a URI template parser.
- *
- * @param templateParser the URI template parser.
- * @return the URI pattern.
- */
- protected UriPattern createUriPattern(UriTemplateParser templateParser) {
- return new UriPattern(templateParser.getPattern(), templateParser.getGroupIndexes());
- }
-
- /**
- * Get the URI template as a String.
- * @return the URI template.
- */
- public final String getTemplate() {
- return template;
- }
-
- /**
- * Get the URI pattern.
- *
- * @return the URI pattern.
- */
- public final UriPattern getPattern() {
- return pattern;
- }
-
- /**
- * @return true if the template ends in a '/', otherwise false.
- */
- public final boolean endsWithSlash() {
- return endsWithSlash;
- }
-
- /**
- * Get the list of template variables for the template.
- * @return the list of template variables.
- */
- public final List<String> getTemplateVariables() {
- return templateVariables;
- }
-
- /**
- * Ascertain if a template variable is a member of this
- * template.
- * @param name name The template variable.
- * @return true if the template variable is a member of the template, otherwise
- * false.
- */
- public final boolean isTemplateVariablePresent(String name) {
- for (String s : templateVariables) {
- if (s.equals(name))
- return true;
- }
-
- return false;
- }
-
- /**
- * Get the number of explicit regexes declared in template variables.
- *
- * @return the number of explicit regexes.
- */
- public final int getNumberOfExplicitRegexes() {
- return numOfExplicitRegexes;
- }
-
- /**
- * Get the number of characters in the regular expression not resulting
- * from conversion of template variables.
- *
- * @return the number of explicit characters
- */
- public final int getNumberOfExplicitCharacters() {
- return numOfCharacters;
- }
-
- /**
- * Get the number of template variables.
- * @return the number of template variables.
- */
- public final int getNumberOfTemplateVariables() {
- return templateVariables.size();
- }
-
- /**
- * Match a URI against the template.
- * <p>
- * If the URI matches against the pattern then the template variable to value
- * map will be filled with template variables as keys and template values as
- * values.
- * <p>
- *
- * @param uri the uri to match against the template.
- * @param templateVariableToValue the map where to put template variables (as keys)
- * and template values (as values). The map is cleared before any
- * entries are put.
- * @return true if the URI matches the template, otherwise false.
- * @throws IllegalArgumentException if the uri or
- * templateVariableToValue is null.
- */
- public final boolean match(CharSequence uri, Map<String, String> templateVariableToValue) throws
- IllegalArgumentException {
- if (templateVariableToValue == null)
- throw new IllegalArgumentException();
-
- return pattern.match(uri, templateVariables, templateVariableToValue);
- }
-
- /**
- * Match a URI against the template.
- * <p>
- * If the URI matches against the pattern then the template variable to value
- * map will be filled with template variables as keys and template values as
- * values.
- * <p>
- *
- * @param uri the uri to match against the template.
- * @param groupValues the list to store the values of a pattern's
- * capturing groups if matching is successful. The values are stored
- * in the same order as the pattern's capturing groups.
- * @return true if the URI matches the template, otherwise false.
- * @throws IllegalArgumentException if the uri or
- * templateVariableToValue is null.
- */
- public final boolean match(CharSequence uri, List<String> groupValues) throws
- IllegalArgumentException {
- if (groupValues == null)
- throw new IllegalArgumentException();
-
- return pattern.match(uri, groupValues);
- }
-
- /**
- * Create a URI by substituting any template variables
- * for corresponding template values.
- * <p>
- * A URI template variable without a value will be substituted by the
- * empty string.
- *
- * @param values the map of template variables to template values.
- * @return the URI.
- */
- public final String createURI(Map<String, String> values) {
- StringBuilder b = new StringBuilder();
- // Find all template variables
- Matcher m = TEMPLATE_NAMES_PATTERN.matcher(normalizedTemplate);
- int i = 0;
- while(m.find()) {
- b.append(normalizedTemplate, i, m.start());
- String tValue = values.get(m.group(1));
- if (tValue != null) b.append(tValue);
- i = m.end();
- }
- b.append(normalizedTemplate, i, normalizedTemplate.length());
- return b.toString();
- }
-
- /**
- * Create a URI by substituting any template variables
- * for corresponding template values.
- * <p>
- * A URI template varibale without a value will be substituted by the
- * empty string.
- *
- * @param values the array of template values. The values will be
- * substituted in order of occurence of unique template variables.
- * @return the URI.
- */
- public final String createURI(String... values) {
- return createURI(values, 0, values.length);
- }
-
- /**
- * Create a URI by substituting any template variables
- * for corresponding template values.
- * <p>
- * A URI template variable without a value will be substituted by the
- * empty string.
- *
- * @param values the array of template values. The values will be
- * substituted in order of occurence of unique template variables.
- * @param offset the offset into the array
- * @param length the length of the array
- * @return the URI.
- */
- public final String createURI(String[] values, int offset, int length) {
- Map<String, String> mapValues = new HashMap<String, String>();
- StringBuilder b = new StringBuilder();
- // Find all template variables
- Matcher m = TEMPLATE_NAMES_PATTERN.matcher(normalizedTemplate);
- int v = offset;
- length += offset;
- int i = 0;
- while(m.find()) {
- b.append(normalizedTemplate, i, m.start());
- String tVariable = m.group(1);
- // Check if a template variable has already occurred
- // If so use the value to ensure that two or more declarations of
- // a template variable have the same value
- String tValue = mapValues.get(tVariable);
- if (tValue != null) {
- b.append(tValue);
- } else {
- if (v < length) {
- tValue = values[v++];
- if (tValue != null) {
- mapValues.put(tVariable, tValue);
- b.append(tValue);
- }
- }
- }
- i = m.end();
- }
- b.append(normalizedTemplate, i, normalizedTemplate.length());
- return b.toString();
- }
-
- @Override
- public final String toString() {
- return pattern.toString();
- }
-
- /**
- * Hashcode is calculated from String of the regular expression
- * generated from the template.
- * @return the hash code.
- */
- @Override
- public final int hashCode() {
- return pattern.hashCode();
- }
-
- /**
- * Equality is calculated from the String of the regular expression
- * generated from the templates.
- * @param o the reference object with which to compare.
- * @return true if equals, otherwise false.
- */
- @Override
- public final boolean equals(Object o) {
- if (o instanceof UriTemplate) {
- UriTemplate that = (UriTemplate)o;
- return this.pattern.equals(that.pattern);
- } else {
- return false;
- }
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- * <p>
- * A template values is an Object instance MUST support the toString()
- * method to convert the template value to a String instance.
- *
- * @param scheme the URI scheme component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the template variable to value map
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURI(final String scheme,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final Map<String, ? extends Object> values, final boolean encode) {
- return createURI(scheme, null, userInfo, host, port, path, query, fragment,
- values, encode);
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- * <p>
- * A template values is an Object instance MUST support the toString()
- * method to convert the template value to a String instance.
- *
- * @param scheme the URI scheme component
- * @param authority the URI authority component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the template variable to value map
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURI(
- final String scheme, String authority,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final Map<String, ? extends Object> values, final boolean encode) {
- Map<String, String> stringValues = new HashMap<String, String>();
- for (Map.Entry<String, ? extends Object> e : values.entrySet()) {
- if (e.getValue() != null)
- stringValues.put(e.getKey(), e.getValue().toString());
- }
-
- return createURIWithStringValues(scheme, authority,
- userInfo, host, port, path, query, fragment,
- stringValues, encode);
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- * <p>
- * A template value is an Object instance that MUST support the toString()
- * method to convert the template value to a String instance.
- *
- * @param scheme the URI scheme component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the template variable to value map
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURIWithStringValues(final String scheme,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final Map<String, ? extends Object> values, final boolean encode) {
- return createURIWithStringValues(scheme, null,
- userInfo, host, port, path, query, fragment,
- values, encode);
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- * <p>
- * A template value is an Object instance that MUST support the toString()
- * method to convert the template value to a String instance.
- *
- * @param scheme the URI scheme component
- * @param authority the URI authority info component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the template variable to value map
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURIWithStringValues(
- final String scheme, final String authority,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final Map<String, ? extends Object> values, final boolean encode) {
-
- StringBuilder sb = new StringBuilder();
-
- if (scheme != null)
- createURIComponent(UriComponent.Type.SCHEME, scheme, values, false, sb).
- append(':');
-
- if (userInfo != null || host != null || port != null) {
- sb.append("//");
-
- if (userInfo != null && userInfo.length() > 0)
- createURIComponent(UriComponent.Type.USER_INFO, userInfo, values, encode, sb).
- append('@');
-
- if (host != null) {
- // TODO check IPv6 address
- createURIComponent(UriComponent.Type.HOST, host, values, encode, sb);
- }
-
- if (port != null && port.length() > 0) {
- sb.append(':');
- createURIComponent(UriComponent.Type.PORT, port, values, false, sb);
- }
- } else if (authority != null) {
- sb.append("//");
-
- createURIComponent(UriComponent.Type.AUTHORITY, authority, values, encode, sb);
- }
-
- if (path != null)
- createURIComponent(UriComponent.Type.PATH, path, values, encode, sb);
-
- if (query != null && query.length() > 0) {
- sb.append('?');
- createURIComponent(UriComponent.Type.QUERY_PARAM, query, values, encode, sb);
- }
-
- if (fragment != null && fragment.length() > 0) {
- sb.append('#');
- createURIComponent(UriComponent.Type.FRAGMENT, fragment, values, encode, sb);
- }
- return sb.toString();
- }
-
- private static StringBuilder createURIComponent(final UriComponent.Type t,
- String template,
- final Map<String, ? extends Object> values,
- final boolean encode,
- final StringBuilder b) {
- if (template.indexOf('{') == -1) {
- b.append(template);
- return b;
- }
-
- // Find all template variables
- template = new UriTemplateParser(template).getNormalizedTemplate();
- final Matcher m = TEMPLATE_NAMES_PATTERN.matcher(template);
-
- int i = 0;
- while(m.find()) {
- b.append(template, i, m.start());
- Object tValue = values.get(m.group(1));
- if (tValue != null) {
- if (encode)
- tValue = UriComponent.encode(tValue.toString(), t);
- else
- tValue =UriComponent.contextualEncode(tValue.toString(), t);
- b.append(tValue);
- } else {
- throw templateVariableHasNoValue(m.group(1));
- }
- i = m.end();
- }
- b.append(template, i, template.length());
- return b;
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- * <p>
- * The template values are an array of Object and each Object instance
- * MUST support the toString() method to convert the template value to
- * a String instance.
- *
- * @param scheme the URI scheme component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the array of template values
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURI(final String scheme,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final Object[] values, final boolean encode) {
- return createURI(scheme, null,
- userInfo, host, port, path, query, fragment,
- values, encode);
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- * <p>
- * The template values are an array of Object and each Object instance
- * MUST support the toString() method to convert the template value to
- * a String instance.
- *
- * @param scheme the URI scheme component
- * @param authority the URI authority component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the array of template values
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURI(
- final String scheme, String authority,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final Object[] values, final boolean encode) {
-
- String[] stringValues = new String[values.length];
- for (int i = 0; i < values.length; i++) {
- if (values[i] != null)
- stringValues[i] = values[i].toString();
- }
-
- return createURIWithStringValues(
- scheme, authority,
- userInfo, host, port, path, query, fragment,
- stringValues, encode);
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- *
- * @param scheme the URI scheme component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the array of template values
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURIWithStringValues(final String scheme,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final String[] values, final boolean encode) {
- return createURIWithStringValues(
- scheme, null,
- userInfo, host, port, path, query, fragment,
- values, encode);
- }
-
- /**
- * Construct a URI from the component parts each of which may contain
- * template variables.
- *
- * @param scheme the URI scheme component
- * @param authority the URI authority component
- * @param userInfo the URI user info component
- * @param host the URI host component
- * @param port the URI port component
- * @param path the URI path component
- * @param query the URI query componnet
- * @param fragment the URI fragment component
- * @param values the array of template values
- * @param encode if true encode a template value according to the correspond
- * component type of the associated template variable, otherwise
- * contextually encode the template value
- * @return a URI
- */
- public final static String createURIWithStringValues(
- final String scheme, final String authority,
- final String userInfo, final String host, final String port,
- final String path, final String query, final String fragment,
- final String[] values, final boolean encode) {
-
- final Map<String, String> mapValues = new HashMap<String, String>();
- final StringBuilder sb = new StringBuilder();
- int offset = 0;
-
- if (scheme != null) {
- offset = createURIComponent(UriComponent.Type.SCHEME, scheme, values,
- offset, false, mapValues, sb);
- sb.append(':');
- }
-
- if (userInfo != null || host != null || port != null) {
- sb.append("//");
-
- if (userInfo != null && userInfo.length() > 0) {
- offset = createURIComponent(UriComponent.Type.USER_INFO, userInfo, values,
- offset, encode, mapValues, sb);
- sb.append('@');
- }
-
- if (host != null) {
- // TODO check IPv6 address
- offset = createURIComponent(UriComponent.Type.HOST, host, values,
- offset, encode, mapValues, sb);
- }
-
- if (port != null && port.length() > 0) {
- sb.append(':');
- offset = createURIComponent(UriComponent.Type.PORT, port, values,
- offset, false, mapValues, sb);
- }
- } else if (authority != null) {
- sb.append("//");
-
- offset = createURIComponent(UriComponent.Type.AUTHORITY, authority, values,
- offset, encode, mapValues, sb);
- }
-
- if (path != null)
- offset = createURIComponent(UriComponent.Type.PATH, path, values,
- offset, encode, mapValues, sb);
-
- if (query != null && query.length() > 0) {
- sb.append('?');
- offset = createURIComponent(UriComponent.Type.QUERY_PARAM, query, values,
- offset, encode, mapValues, sb);
- }
-
- if (fragment != null && fragment.length() > 0) {
- sb.append('#');
- offset = createURIComponent(UriComponent.Type.FRAGMENT, fragment, values,
- offset, encode, mapValues, sb);
- }
- return sb.toString();
- }
-
- private static int createURIComponent(final UriComponent.Type t,
- String template,
- final String[] values, final int offset,
- final boolean encode,
- final Map<String, String> mapValues,
- final StringBuilder b) {
- if (template.indexOf('{') == -1) {
- b.append(template);
- return offset;
- }
-
- // Find all template variables
- template = new UriTemplateParser(template).getNormalizedTemplate();
- final Matcher m = TEMPLATE_NAMES_PATTERN.matcher(template);
- int v = offset;
- int i = 0;
- while(m.find()) {
- b.append(template, i, m.start());
- final String tVariable = m.group(1);
- // Check if a template variable has already occurred
- // If so use the value to ensure that two or more declarations of
- // a template variable have the same value
- String tValue = mapValues.get(tVariable);
- if (tValue != null) {
- b.append(tValue);
- } else if (v < values.length) {
- tValue = values[v++];
- if (tValue != null) {
- if (encode)
- tValue = UriComponent.encode(tValue, t);
- else
- tValue = UriComponent.contextualEncode(tValue, t);
- mapValues.put(tVariable, tValue);
- b.append(tValue);
- } else {
- throw templateVariableHasNoValue(tVariable);
- }
- } else {
- throw templateVariableHasNoValue(tVariable);
- }
- i = m.end();
- }
- b.append(template, i, template.length());
- return v;
- }
-
- private static IllegalArgumentException templateVariableHasNoValue(String tVariable) {
- return new IllegalArgumentException("The template variable, " +
- tVariable + ", has no value");
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplateParser.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplateParser.java
deleted file mode 100644
index 249f420953b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/UriTemplateParser.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.uri;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * A URI template parser that parses JAX-RS specific URI templates.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class UriTemplateParser {
- /* package */ static final int[] EMPTY_INT_ARRAY = new int[0];
- private static final Set<Character> RESERVED_REGEX_CHARACTERS = initReserved();
-
- private static Set<Character> initReserved() {
- // TODO need to escape all regex characters present
- char[] reserved = {
- '.',
- '?',
- '(',
- ')'};
-
- Set<Character> s = new HashSet<Character>(reserved.length);
- for (char c : reserved) {
- s.add(c);
- }
- return s;
- }
- private static final Pattern TEMPLATE_VALUE_PATTERN = Pattern.compile("[^/]+?");
-
- private interface CharacterIterator {
-
- boolean hasNext();
-
- char next();
-
- char peek();
-
- int pos();
- }
-
- private static final class StringCharacterIterator implements CharacterIterator {
-
- private int pos;
- private String s;
-
- public StringCharacterIterator(final String s) {
- this.s = s;
- this.pos = 0;
- }
-
- @Override
- public boolean hasNext() {
- return pos < s.length();
- }
-
- @Override
- public char next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- return s.charAt(pos++);
- }
-
- @Override
- public char peek() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
-
- return s.charAt(pos);
- }
-
- @Override
- public int pos() {
- if (pos == 0) {
- throw new IllegalStateException("Iterator not used yet.");
- }
-
- return pos - 1;
- }
- }
- private final String template;
- private final StringBuffer regex = new StringBuffer();
- private final StringBuffer normalizedTemplate = new StringBuffer();
- private final StringBuffer literalCharactersBuffer = new StringBuffer();
- private final Pattern pattern;
- private final List<String> names = new ArrayList<String>();
- private final List<Integer> groupCounts = new ArrayList<Integer>();
- private final Map<String, Pattern> nameToPattern = new HashMap<String, Pattern>();
- private int numOfExplicitRegexes;
- private int literalCharacters;
-
- /**
- * Parse a template.
- *
- * @param template the template.
- * @throws IllegalArgumentException if the template is null, an empty string
- * or does not conform to a JAX-RS URI template.
- */
- public UriTemplateParser(final String template) throws IllegalArgumentException {
- if (template == null || template.length() == 0) {
- throw new IllegalArgumentException();
- }
-
- this.template = template;
- parse(new StringCharacterIterator(template));
- try {
- pattern = Pattern.compile(regex.toString());
- } catch (PatternSyntaxException ex) {
- throw new IllegalArgumentException("Invalid syntax for the template expression '"
- + regex + "'",
- ex);
- }
- }
-
- /**
- * Get the template.
- *
- * @return the template.
- */
- public final String getTemplate() {
- return template;
- }
-
- /**
- * Get the pattern.
- *
- * @return the pattern.
- */
- public final Pattern getPattern() {
- return pattern;
- }
-
- /**
- * Get the normalized template.
- * <p>
- * A normalized template is a template without any explicit regular
- * expressions.
- *
- * @return the normalized template.
- */
- public final String getNormalizedTemplate() {
- return normalizedTemplate.toString();
- }
-
- /**
- * Get the map of template names to patterns.
- *
- * @return the map of template names to patterns.
- */
- public final Map<String, Pattern> getNameToPattern() {
- return nameToPattern;
- }
-
- /**
- * Get the list of template names.
- *
- * @return the list of template names.
- */
- public final List<String> getNames() {
- return names;
- }
-
- /**
- * Get the capturing group counts for each template variable.
- *
- * @return the capturing group counts.
- */
- public final List<Integer> getGroupCounts() {
- return groupCounts;
- }
-
- /**
- * Get the group indexes to capturing groups.
- * <p>
- * Any nested capturing groups will be ignored and the
- * the group index will refer to the top-level capturing
- * groups associated with the templates variables.
- *
- * @return the group indexes to capturing groups.
- */
- public final int[] getGroupIndexes() {
- if (names.isEmpty()) {
- return EMPTY_INT_ARRAY;
- }
-
- int[] indexes = new int[names.size() + 1];
- indexes[0] = 1;
- for (int i = 1; i < indexes.length; i++) {
- indexes[i] = indexes[i - 1] + groupCounts.get(i - 1);
- }
- for (int i = 0; i < indexes.length; i++) {
- if (indexes[i] != i + 1) {
- return indexes;
- }
- }
- return EMPTY_INT_ARRAY;
- }
-
- /**
- * Get the number of explicit regular expressions.
- *
- * @return the number of explicit regular expressions.
- */
- public final int getNumberOfExplicitRegexes() {
- return numOfExplicitRegexes;
- }
-
- /**
- * Get the number of literal characters.
- *
- * @return the number of literal characters.
- */
- public final int getNumberOfLiteralCharacters() {
- return literalCharacters;
- }
-
- /**
- * Encode literal characters of a template.
- *
- * @param characters the literal characters
- * @return the encoded literal characters.
- */
- protected String encodeLiteralCharacters(final String characters) {
- return characters;
- }
-
- private void parse(final CharacterIterator ci) {
- try {
- while (ci.hasNext()) {
- char c = ci.next();
- if (c == '{') {
- processLiteralCharacters();
- parseName(ci);
- } else {
- literalCharactersBuffer.append(c);
- }
- }
- processLiteralCharacters();
- } catch (NoSuchElementException ex) {
- throw new IllegalArgumentException(
- "Invalid syntax for the template, \"" + template
- + "\". Check if a path parameter is terminated with a '}'.",
- ex);
- }
- }
-
- private void processLiteralCharacters() {
- if (literalCharactersBuffer.length() > 0) {
- literalCharacters += literalCharactersBuffer.length();
-
- String s = encodeLiteralCharacters(literalCharactersBuffer.toString());
-
- normalizedTemplate.append(s);
-
- // Escape if reserved regex character
- for (int i = 0; i < s.length(); i++) {
- char c = s.charAt(i);
- if (RESERVED_REGEX_CHARACTERS.contains(c)) {
- regex.append("\\");
- }
- regex.append(c);
- }
-
- literalCharactersBuffer.setLength(0);
- }
- }
-
- private void parseName(final CharacterIterator ci) {
- char c = consumeWhiteSpace(ci);
-
- StringBuilder nameBuffer = new StringBuilder();
- if (Character.isLetterOrDigit(c) || c == '_') {
- // Template name character
- nameBuffer.append(c);
- } else {
- throw new IllegalArgumentException("Illegal character '" + c
- + "' at position " + ci.pos() + " is not as the start of a name");
- }
-
- String nameRegexString = "";
- while (true) {
- c = ci.next();
- // "\\{(\\w[-\\w\\.]*)
- if (Character.isLetterOrDigit(c) || c == '_' || c == '-' || c == '.') {
- // Template name character
- nameBuffer.append(c);
- } else if (c == ':') {
- nameRegexString = parseRegex(ci);
- break;
- } else if (c == '}') {
- break;
- } else if (c == ' ') {
- c = consumeWhiteSpace(ci);
-
- if (c == ':') {
- nameRegexString = parseRegex(ci);
- break;
- } else if (c == '}') {
- break;
- } else {
- // Error
- throw new IllegalArgumentException("Illegal character '" + c
- + "' at position " + ci.pos() + " is not allowed after a name");
- }
- } else {
- throw new IllegalArgumentException("Illegal character '" + c
- + "' at position " + ci.pos() + " is not allowed as part of a name");
- }
- }
- String name = nameBuffer.toString();
- names.add(name);
-
- try {
- if (nameRegexString.length() > 0) {
- numOfExplicitRegexes++;
- }
- Pattern namePattern = (nameRegexString.length() == 0)
- ? TEMPLATE_VALUE_PATTERN : Pattern.compile(nameRegexString);
- if (nameToPattern.containsKey(name)) {
- if (!nameToPattern.get(name).equals(namePattern)) {
- throw new IllegalArgumentException("The name '" + name
- + "' is declared "
- + "more than once with different regular expressions");
- }
- } else {
- nameToPattern.put(name, namePattern);
- }
-
- // Determine group count of pattern
- Matcher m = namePattern.matcher("");
- int g = m.groupCount();
- groupCounts.add(g + 1);
-
- regex.append('(').
- append(namePattern).
- append(')');
- normalizedTemplate.append('{').
- append(name).
- append('}');
- } catch (PatternSyntaxException ex) {
- throw new IllegalArgumentException("Invalid syntax for the expression '" + nameRegexString
- + "' associated with the name '" + name + "'",
- ex);
- }
- }
-
- private String parseRegex(final CharacterIterator ci) {
- StringBuilder regexBuffer = new StringBuilder();
-
- int braceCount = 1;
- while (true) {
- char c = ci.next();
- if (c == '{') {
- braceCount++;
- } else if (c == '}') {
- braceCount--;
- if (braceCount == 0) {
- break;
- }
- }
- regexBuffer.append(c);
- }
-
- return regexBuffer.toString().trim();
- }
-
- private char consumeWhiteSpace(final CharacterIterator ci) {
- char c;
- do {
- c = ci.next();
- } while (Character.isWhitespace(c));
-
- return c;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/package-info.java
deleted file mode 100644
index 8125cf77ac7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/uri/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for JAX-RS URI templates and encoding/decoding URI components.
- */
-package com.sun.jersey.api.uri;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/view/ImplicitProduces.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/view/ImplicitProduces.java
deleted file mode 100644
index ea3f6d468b6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/view/ImplicitProduces.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.view;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines the media type(s) that a resource class can produce for
- * implicit views.
- * <p>
- * The list of media types may be declared individually as String items or
- * as a comma separated list of one or more String items.
- * <p>
- * A quality source parameter, qs, may be declared as a parameter of a media
- * type. This enables the application to prefer to produce say "text/html" over
- * "application/xml" if the former has a higher quality source value than
- * the latter and the former is an acceptable media type.
- */
-@Inherited
-@Target({ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ImplicitProduces {
- /**
- * A list of media types. E.g. "image/jpeg,image/gif"
- */
- String[] value();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/view/Viewable.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/view/Viewable.java
deleted file mode 100644
index 0e5983b40ef..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/view/Viewable.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.api.view;
-
-import com.sun.jersey.spi.template.TemplateContext;
-import com.sun.jersey.spi.template.ViewProcessor;
-
-/**
- * A viewable type referencing a template by name and a model to be passed
- * to the template. Such a type may be returned by a resource method of a
- * resource class. In this respect the template is the view and the controller
- * is the resource class in the Model View Controller pattern.
- * <p>
- * The template name may be declared as absolute template name if the name
- * begins with a '/', otherwise the template name is declared as a relative
- * template name.
- * <p>
- * A relative template name requires resolving to an absolute template name
- * when the viewable type is processed.
- *
- * If a resolving class is present then that class will be used to resolve the
- * relative template name.
- *
- * If a resolving class is not present then the class of the last matching
- * resource obtained from {@link javax.ws.rs.core.UriInfo#getMatchedResources() },
- * namely the class obtained from the expression
- * <code>uriInfo.getMatchedResources().get(0).getClass()</code>, is utilized
- * as the resolving class.
- *
- * If there are no matching resources then an error will result.
- *
- * <p>
- * The resolving class, and super classes in the inheritence hierarchy, are
- * utilized to generate the absolute template name as follows.
- *
- * The base path starts with '/' character, followed by the fully
- * qualified class name of the resolving class, with any '.' and '$' characters
- * replaced with a '/' character, followed by a '/' character,
- * followed by the relative template name.
- *
- * If the absolute template name cannot be resolved into a template reference
- * (see {@link ViewProcessor} and {@link TemplateContext}) then the super class
- * of the resolving class is utilized, and is set as the resolving class.
- * Traversal up the inheritence hierarchy proceeds until an absolute template
- * name can be resolved into a template reference, or the Object class is
- * reached, which means the absolute template name could not be resolved and
- * an error will result.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class Viewable {
-
- private final String templateName;
-
- private final Object model;
-
- private final Class<?> resolvingClass;
-
- /**
- * Construct a new viewable type with a template name.
- * <p>
- * The model will be set to <code>null</code>.
- *
- * @param templateName the template name, shall not be <code>null</code>.
- */
- public Viewable(String templateName) {
- this(templateName, null, null);
- }
-
- /**
- * Construct a new viewable type with a template name and a model.
- *
- * @param templateName the template name, shall not be <code>null</code>.
- * @param model the model, may be <code>null</code>.
- */
- public Viewable(String templateName, Object model) {
- this(templateName, model, null);
- }
-
- /**
- * Construct a new viewable type with a template name, a model
- * and a resolving class.
- *
- * @param templateName the template name, shall not be <code>null</code>.
- * @param model the model, may be <code>null</code>.
- * @param resolvingClass the class to use to resolve the template name
- * if the template is not absolute, if <code>null</code> then the resolving
- * class will be obtained from the last matching resource.
- * @throws IllegalArgumentException if the template name is <code>null</code>.
- */
- public Viewable(String templateName, Object model, Class<?> resolvingClass)
- throws IllegalArgumentException {
- if (templateName == null)
- throw new IllegalArgumentException("The template name MUST not be null");
-
- this.templateName = templateName;
- this.model = model;
- this.resolvingClass = resolvingClass;
- }
-
- /**
- * Get the template name.
- *
- * @return the template name.
- */
- public String getTemplateName() {
- return templateName;
- }
-
- /**
- * Get the model.
- *
- * @return the model.
- */
- public Object getModel() {
- return model;
- }
-
- /**
- * Get the resolving class.
- *
- * @return the resolving class.
- */
- public Class<?> getResolvingClass() {
- return resolvingClass;
- }
-
- /**
- *
- * @return true if the template name is absolute, and starts with a
- * '/' character
- */
- public boolean isTemplateNameAbsolute() {
- return templateName.length() > 0 && templateName.charAt(0) == '/';
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/view/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/view/package-info.java
deleted file mode 100644
index f7c11f67cef..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/view/package-info.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for Model, View and Controller (MVC).
- * <p>
- * Given the MVC pattern the Controller corresponds to a resource class,
- * the View to a template referenced by a template name, and the Model
- * to a Java object (or a Java bean).
- * <p>
- * A resource method of a resource class may return an instance of
- * {@link com.sun.jersey.api.view.Viewable} that encapsulates the template name
- * and the model. In this respect the instance of
- * {@link com.sun.jersey.api.view.Viewable} is the response entity. Such a
- * viewable response entity may be set in contexts other than a resource
- * method but for the purposes of this section the focus is on resource methods.
- * <p>
- * The {@link com.sun.jersey.api.view.Viewable}, returned by a resource method,
- * will be processed such that the template name is resolved to a template
- * reference that identifies a template capable of being processed by an
- * appropriate view processor.
- *
- * The view processor then processes template given the model to produce a
- * response entity that is returned to the client.
- * <p>
- * For example, the template name could reference a Java Server Page (JSP) and
- * the model will be accessible to that JSP. The JSP view processor will
- * process the JSP resulting in an HTML document that is returned
- * as the response entity. (See later for more details.)
- * <p>
- * Two forms of returning {@link com.sun.jersey.api.view.Viewable} instances
- * are supported: explicit; and implicit.
- *
- * <h2>Explicit views</h2>
- *
- * <h2>Implicit views</h2>
- *
- * <h2>Integration with Java Server Pages (JSPs)</h2>
- *
- * <h2>Developing a View Processor</h2>
- */
-package com.sun.jersey.api.view;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/WadlGeneratorTask.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/WadlGeneratorTask.java
deleted file mode 100644
index d77c4d143c8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/WadlGeneratorTask.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.wadl;
-
-import com.sun.research.ws.wadl.Application;
-import com.sun.jersey.api.core.ClasspathResourceConfig;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller;
-import com.sun.jersey.server.wadl.WadlBuilder;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Reference;
-
-/**
- * Ant task for generating WADL for root resource classes.
- *
- * The task requires that the destfile attribute be set to the location
- * of the WADL file to be generated, the baseUri attribute set to the base
- * URI of the WADL resources, and the classpath be set.
- *
- * The task will scan all classes in the classpath obtain the root resource
- * classes and then create a WADL document from those root resources.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WadlGeneratorTask extends Task {
-
- private Path classpath;
-
- public Path getClasspath() {
- return classpath;
- }
-
- public void setClasspath(Path classpath) {
- if (this.classpath == null) {
- this.classpath = classpath;
- } else {
- this.classpath.append(classpath);
- }
- }
-
- public Path createClasspath() {
- if (classpath == null) {
- classpath = new Path(getProject());
- }
- return classpath.createPath();
- }
-
- public void setClasspathRef(Reference r) {
- createClasspath().setRefid(r);
- }
-
-
- private File wadlFile;
-
- public File getDestfile() {
- return wadlFile;
- }
-
- public void setDestfile(File wadlFile) {
- this.wadlFile = wadlFile;
- }
-
- private String baseUri;
-
- public String getbaseUri() {
- return baseUri;
- }
-
- public void setBaseUri(String baseUri) {
- this.baseUri = baseUri;
- }
-
- @Override
- public void execute() throws BuildException {
- if (classpath == null) {
- throw new BuildException("The classpath is not defined");
- }
- if (wadlFile == null) {
- throw new BuildException("destfile attribute required", getLocation());
- }
-
- if (baseUri == null || baseUri.length() == 0) {
- throw new BuildException("baseUri attribute required", getLocation());
- }
-
- try {
- Application a = createApplication(classpath.list());
- a.getResources().setBase(baseUri);
- JAXBContext c = JAXBContext.newInstance("com.sun.research.ws.wadl",
- this.getClass().getClassLoader());
- Marshaller m = c.createMarshaller();
- OutputStream out = new BufferedOutputStream(new FileOutputStream(wadlFile));
- m.marshal(a, out);
- out.close();
- } catch (Exception e) {
- throw new BuildException(e);
- }
- }
-
- private Application createApplication(String[] paths) {
- final ClassLoader cl = Thread.currentThread().getContextClassLoader();
- final ClassLoader ncl = new Loader(classpath.list(), this.getClass().getClassLoader());
- Thread.currentThread().setContextClassLoader(ncl);
- try {
- ResourceConfig rc = new ClasspathResourceConfig(classpath.list());
- rc.validate();
- Set<AbstractResource> s = new HashSet<AbstractResource>();
- for (Class c : rc.getRootResourceClasses()) {
- s.add(IntrospectionModeller.createResource(c));
- }
- return new WadlBuilder().generate(s);
- } catch(Exception e) {
- throw new BuildException(e);
- } finally {
- Thread.currentThread().setContextClassLoader(cl);
- }
- }
-
- private static class Loader extends URLClassLoader {
- Loader(String[] paths, ClassLoader parent) {
- super(getURLs(paths), parent);
- }
-
- Loader(String[] paths) {
- super(getURLs(paths));
- }
-
- @Override
- public Class findClass(String name) throws ClassNotFoundException {
- Class c = super.findClass(name);
- return c;
- }
-
- private static URL[] getURLs(String[] paths) {
- List<URL> urls = new ArrayList<URL>();
- for (String path: paths) {
- try {
- urls.add(new File(path).toURI().toURL());
- } catch (MalformedURLException e) {
- throw new RuntimeException(e);
- }
- }
-
- URL[] us = urls.toArray(new URL[0]);
- return us;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.java
deleted file mode 100644
index 88266409fc2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.wadl.config;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc;
-import com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport;
-import com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport;
-
-/**
- * Provides a configured {@link WadlGenerator} with all decorations (the default
- * wadl generator decorated by other generators).
- * <p>
- * <strong>Creating a WadlGeneratorConfig</strong><br/>
- * <br/>
- * If you want to create an instance at runtime you have two options:
- * <ul>
- * <li>Configure the WadlGenerator class and property names/values</li>
- * <li>Create your {@link WadlGenerator} instances by yourself</li>
- * </ul>
- *
- * The first option would look like this:
- * <pre><code>WadlGeneratorConfig config = WadlGeneratorConfig
- .generator( MyWadlGenerator.class )
- .prop( "someProperty", "someValue" )
- .generator( MyWadlGenerator2.class )
- .prop( "someProperty", "someValue" )
- .prop( "anotherProperty", "anotherValue" )
- .build();
- * </code></pre>
- *
- * The second option, creating the {@link WadlGenerator}s by yourself, would look like the following:
- * <pre><code>WadlGeneratorConfig config = WadlGeneratorConfig
- .generator( generator )
- .generator( generator2 )
- .build();
- * </code></pre>
- * <br/>
- * If you want to specify the {@link WadlGeneratorConfig} in the web.xml you have
- * to subclass it and set the servlet init-param {@link ResourceConfig#PROPERTY_WADL_GENERATOR_CONFIG}
- * to the name of your subclass. This class might look like this:
- * <pre><code>class MyWadlGeneratorConfig extends WadlGeneratorConfig {
-
- public List<WadlGeneratorDescription> configure() {
- return generator( MyWadlGenerator.class )
- .prop( "foo", propValue )
- .generator( MyWadlGenerator2.class )
- .prop( "bar", propValue2 )
- .descriptions();
- }
-
- }
- * </code></pre>
- *
- * </p>
- *
- * <p>
- * <strong>Configuring the WadlGenerator</strong><br/>
- * <br/>
- * The {@link WadlGenerator} properties will be populated with the provided properties like this:
- * <ul>
- * <li>The types match exactly:<br/>
- * if the WadlGenerator property is of type <code>org.example.Foo</code> and the
- * provided property value is of type <code>org.example.Foo</code></li>
- * <li>Types that provide a constructor for the provided type (mostly java.lang.String)</li>
- * <li>java.io.InputStream: The {@link InputStream} can e.g. represent a file. The stream is loaded from the
- * property value (provided by the {@link WadlGeneratorDescription}) via
- * {@link ClassLoader#getResourceAsStream(String)}. It will be closed after {@link WadlGenerator#init()} was called.
- * </li>
- *
- * <li><strong>Deprected, will be removed in future versions:</strong><br/>
- * The WadlGenerator property is of type {@link File} and the provided property value is a {@link String}:<br/>
- * the provided property value can contain the prefix <em>classpath:</em> to denote, that the
- * path to the file is relative to the classpath. In this case, the property value is stripped by
- * the prefix <em>classpath:</em> and the {@link File} is created via
- * <pre><code>new File( generator.getClass().getResource( strippedFilename ).toURI() )</code></pre>
- * Notice that the filename is loaded from the classpath in this case, e.g. <em>classpath:test.xml</em>
- * refers to a file in the package of the class ({@link WadlGeneratorDescription#getGeneratorClass()}). The
- * file reference <em>classpath:/test.xml</em> refers to a file that is in the root of the classpath.
- * </li>
- *
- * </ul>
- * </p>
- * <p>
- * <strong>Existing {@link WadlGenerator} implementations:</strong><br/>
- * <br/>
- * <ul>
- * <li>{@link WadlGeneratorApplicationDoc}</li>
- * <li>{@link WadlGeneratorGrammarsSupport}</li>
- * <li>{@link WadlGeneratorResourceDocSupport}</li>
- * </ul>
- * </p>
- * <p>
- * A common example for a {@link WadlGeneratorConfig} would be this:
- * <pre><code>class MyWadlGeneratorConfig extends WadlGeneratorConfig {
-
- public List<WadlGeneratorDescription> configure() {
- return generator( WadlGeneratorApplicationDoc.class )
- .prop( "applicationDocsStream", "application-doc.xml" )
- .generator( WadlGeneratorGrammarsSupport.class )
- .prop( "grammarsStream", "application-grammars.xml" )
- .generator( WadlGeneratorResourceDocSupport.class )
- .prop( "resourceDocStream", "resourcedoc.xml" )
- .descriptions();
- }
-
- }
- * </code></pre>
- * </p>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: WadlGeneratorConfig.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-public abstract class WadlGeneratorConfig {
-
- // private static final Logger LOGGER = Logger.getLogger( WadlGeneratorConfig.class.getName() );
-
- private WadlGenerator _wadlGenerator;
-
- public WadlGeneratorConfig() {
- }
-
- /**
- * Creates a new WadlGeneratorConfig from the provided wadlGenerator (must already be initialized).
- * @param wadlGenerator the wadl generator to provide, must not be null.
- */
- public WadlGeneratorConfig( WadlGenerator wadlGenerator ) {
- if ( wadlGenerator == null ) {
- throw new IllegalArgumentException( "The wadl generator must not be null." );
- }
- _wadlGenerator = wadlGenerator;
- }
-
- public abstract List<WadlGeneratorDescription> configure();
-
- /**
- * Get or load the initialized {@link WadlGenerator}, based on the {@link WadlGeneratorDescription}s
- * provided by {@link #configure()}.
- * @return the initialized {@link WadlGenerator}.
- */
- public synchronized WadlGenerator getWadlGenerator() {
- if ( _wadlGenerator == null ) {
- final List<WadlGeneratorDescription> wadlGeneratorDescriptions = configure();
- try {
- _wadlGenerator = WadlGeneratorLoader.loadWadlGeneratorDescriptions( wadlGeneratorDescriptions );
- } catch ( Exception e ) {
- throw new RuntimeException( "Could not load wadl generators from wadlGeneratorDescriptions.", e );
- }
- }
- return _wadlGenerator;
- }
-
- /**
- * Start to build an instance of {@link WadlGeneratorConfig}:
- * <pre><code>generator(&lt;class&gt;)
- * .prop(&lt;name&gt;, &lt;value&gt;)
- * .prop(&lt;name&gt;, &lt;value&gt;)
- * .generator(&lt;class&gt;)
- * .prop(&lt;name&gt;, &lt;value&gt;)
- * .prop(&lt;name&gt;, &lt;value&gt;)
- * .build()</code></pre>
- * @param generatorClass the class of the wadl generator to configure
- * @return an instance of {@link WadlGeneratorConfigDescriptionBuilder}.
- */
- public static WadlGeneratorConfigDescriptionBuilder generator( Class<? extends WadlGenerator> generatorClass ) {
- return new WadlGeneratorConfigDescriptionBuilder().generator( generatorClass );
- }
-
- /**
- * Start to build an instance of {@link WadlGeneratorConfig}:
- * <pre><code>generator(&lt;generator&gt;).generator(&lt;generator&gt;).build()</code></pre>
- * @param generator the configured wadl generator
- * @return an instance of {@link WadlGeneratorConfigBuilder}.
- */
- public static WadlGeneratorConfigBuilder generator( WadlGenerator generator ) {
- return new WadlGeneratorConfigBuilder().generator( generator );
- }
-
- public static class WadlGeneratorConfigDescriptionBuilder {
-
- private List<WadlGeneratorDescription> _descriptions;
- private WadlGeneratorDescription _description;
-
- public WadlGeneratorConfigDescriptionBuilder() {
- _descriptions = new ArrayList<WadlGeneratorDescription>();
- }
-
- public WadlGeneratorConfigDescriptionBuilder generator( Class<? extends WadlGenerator> generatorClass ) {
- if ( _description != null ) {
- _descriptions.add( _description );
- }
- _description = new WadlGeneratorDescription();
- _description.setGeneratorClass( generatorClass );
- return this;
- }
-
- /**
- * Specify the property value for the current {@link WadlGenerator}.
- * <p>
- * The {@link WadlGenerator} property type can be of any type with
- * the following contraints:
- * <p>
- * If the {@link WadlGenerator} property type is equal to the
- * property value type then the property value is set as the
- * {@link WadlGenerator} property value.
- * </p>
- * <p>
- * If the {@link WadlGenerator} property type has a constructor with
- * a single {@link String} parameter type and the property value is a
- * {@link String} then an instance of the property type is constructed
- * with the property value and that instance is set as the
- * {@link WadlGenerator} property value.
- * </p>
- * <p>
- * If the {@link WadlGenerator} property type is of type {@link File},
- * then the specified property value must be a {@link String} starting
- * with the prefix <em>classpath:</em> to denote, that the File shall
- * be loaded from the classpath like this:
- * <pre><code>new File( generator.getClass().getResource( strippedFilename ).toURI() )</code></pre>
- * Notice that the file is loaded as a resource from the classpath
- * in this case, therefore <em>classpath:test.xml</em>
- * refers to a file in the package of the specified
- * <code>&lt;classname&gt;</code>. The file reference
- * <em>classpath:/test.xml</em> refers to a file that is in the root
- * of the classpath.
- * </p>
- * <p>
- * If the {@link WadlGenerator} property type is of type
- * {@link InputStream}, then the specified property value must be a
- * {@link String} and the instance of {@link InputStream} is obtained
- * with {@link ClassLoader#getResourceAsStream(String)} using the
- * current threads context classloader.
- * The {@link InputStream} will be closed after
- * {@link WadlGenerator#init()} was called and therefore must not be
- * closed by the {@link WadlGenerator} using this stream.
- * </p>
- * @param propName the property name
- * @param propValue the stringified property value
- * @return this builder instance
- */
- public WadlGeneratorConfigDescriptionBuilder prop( String propName, Object propValue ) {
- if ( _description.getProperties() == null ) {
- _description.setProperties( new Properties() );
- }
- _description.getProperties().put( propName, propValue );
- return this;
- }
-
- public List<WadlGeneratorDescription> descriptions() {
- if ( _description != null ) {
- _descriptions.add( _description );
- }
- return _descriptions;
- }
-
- public WadlGeneratorConfig build() {
- if ( _description != null ) {
- _descriptions.add( _description );
- }
- return new WadlGeneratorConfigImpl( _descriptions );
- }
-
- }
-
- static class WadlGeneratorConfigImpl extends WadlGeneratorConfig {
-
- public List<WadlGeneratorDescription> _descriptions;
-
- public WadlGeneratorConfigImpl(
- List<WadlGeneratorDescription> descriptions) {
- _descriptions = descriptions;
- }
-
- @Override
- public List<WadlGeneratorDescription> configure() {
- return _descriptions;
- }
-
- }
-
- public static class WadlGeneratorConfigBuilder {
-
- private List<WadlGenerator> _generators;
-
- public WadlGeneratorConfigBuilder() {
- _generators = new ArrayList<WadlGenerator>();
- }
-
- public WadlGeneratorConfigBuilder generator( WadlGenerator generator ) {
- if ( generator == null ) {
- throw new IllegalArgumentException( "The wadl generator must not be null." );
- }
- _generators.add( generator );
- return this;
- }
-
- public WadlGeneratorConfig build() {
- try {
- final WadlGenerator wadlGenerator = WadlGeneratorLoader.loadWadlGenerators( _generators );
- return new WadlGeneratorConfigGeneratorImpl( wadlGenerator ) {
-
- };
- } catch ( Exception e ) {
- throw new RuntimeException( "Could not load wadl generators.", e );
- }
- }
-
- }
-
- static class WadlGeneratorConfigGeneratorImpl extends WadlGeneratorConfig {
-
- private final WadlGenerator _wadlGenerator;
-
- public WadlGeneratorConfigGeneratorImpl(WadlGenerator wadlGenerator) {
- _wadlGenerator = wadlGenerator;
- }
-
- @Override
- public List<WadlGeneratorDescription> configure() {
- throw new UnsupportedOperationException( "Must not be called" );
- }
-
- /* (non-Javadoc)
- * @see com.sun.jersey.server.impl.wadl.config.WadlGeneratorConfig#getWadlGenerator()
- */
- @Override
- public synchronized WadlGenerator getWadlGenerator() {
- return _wadlGenerator;
- }
-
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.java
deleted file mode 100644
index 37dd9bd273c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.wadl.config;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.jersey.server.wadl.WadlGeneratorImpl;
-
-/**
- * Loads a {@link WadlGeneratorConfig} and provides access to the {@link WadlGenerator}
- * provided by the loaded {@link WadlGeneratorConfig}.<br/>
- * If no {@link WadlGeneratorConfig} is provided, the default {@link WadlGenerator}
- * will be loaded.<br />
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: WadlGeneratorConfigLoader.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-public class WadlGeneratorConfigLoader {
-
- /**
- * Load the {@link WadlGeneratorConfig} from the provided {@link ResourceConfig} using the
- * property {@link ResourceConfig#PROPERTY_WADL_GENERATOR_CONFIG}.
- *
- * <p>
- * The type of this property must be a subclass or an instance of a subclass of
- * {@link WadlGeneratorConfig}.<br/>
- * If it's not set, the default {@link WadlGeneratorImpl} will be used.
- * </p>
- *
- * @param resourceConfig
- * @return the initialized {@link WadlGenerator}.
- */
- public static WadlGenerator loadWadlGeneratorsFromConfig( ResourceConfig resourceConfig ) {
- final Object wadlGeneratorConfigProperty = resourceConfig.getProperty(
- ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG );
- if ( wadlGeneratorConfigProperty == null ) {
- final WadlGenerator wadlGenerator = new WadlGeneratorImpl();
- try {
- wadlGenerator.init();
- return wadlGenerator;
- } catch ( Exception e ) {
- throw new RuntimeException( "Could not init the " + wadlGenerator.getClass().getName(), e );
- }
- }
- else {
-
- try {
-
- if ( wadlGeneratorConfigProperty instanceof WadlGeneratorConfig ) {
- return ( (WadlGeneratorConfig)wadlGeneratorConfigProperty ).getWadlGenerator();
- }
-
- final Class<? extends WadlGeneratorConfig> configClazz;
- if ( wadlGeneratorConfigProperty instanceof Class ) {
- configClazz = ( (Class<?>)wadlGeneratorConfigProperty ).
- asSubclass( WadlGeneratorConfig.class );
- }
- else if ( wadlGeneratorConfigProperty instanceof String ) {
- configClazz = ReflectionHelper.classForNameWithException( (String) wadlGeneratorConfigProperty ).
- asSubclass( WadlGeneratorConfig.class );
- }
- else {
- throw new RuntimeException( "The property " + ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG +
- " is an invalid type: " + wadlGeneratorConfigProperty.getClass().getName() +
- " (supported: String, Class<? extends WadlGeneratorConfiguration>," +
- " WadlGeneratorConfiguration)" );
- }
-
- final WadlGeneratorConfig config = configClazz.newInstance();
-
- return config.getWadlGenerator();
-
- } catch ( Exception e ) {
- throw new RuntimeException( "Could not load WadlGeneratorConfiguration," +
- " check the configuration of " + ResourceConfig.PROPERTY_WADL_GENERATOR_CONFIG, e );
- }
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.java
deleted file mode 100644
index e7a3622056a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.wadl.config;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.Properties;
-
-import com.sun.jersey.server.wadl.WadlGenerator;
-
-/**
- * This is the model for the definition of wadl generators via configuration properties.<br />
- * The properties refer to the properties of the {@link WadlGenerator} implementation with
- * the specified {@link WadlGeneratorDescription#getGeneratorClass()}. The {@link WadlGenerator} properties
- * are populated with the provided properties like this:
- * <ul>
- * <li>The types match exactly:<br/>if the WadlGenerator property is of type <code>org.example.Foo</code> and the
- * provided property value is of type <code>org.example.Foo</code></li>
- * <li>Types that provide a constructor for the provided type (mostly java.lang.String)</li>
- * <li>The WadlGenerator property is of type {@link InputStream}: The stream is loaded from the
- * property value (provided by the {@link WadlGeneratorDescription}) via
- * {@link ClassLoader#getResourceAsStream(String)}. It will be closed after {@link WadlGenerator#init()} was called.
- * </li>
- *
- * <li><strong>Deprected, will be removed in future versions:</strong><br/>
- * The WadlGenerator property is of type {@link File} and the provided property value is a {@link String}:<br/>
- * the provided property value can contain the prefix <em>classpath:</em> to denote, that the
- * path to the file is relative to the classpath. In this case, the property value is stripped by
- * the prefix <em>classpath:</em> and the {@link File} is created via
- * <pre><code>new File( generator.getClass().getResource( strippedFilename ).toURI() )</code></pre>
- * Notice that the filename is loaded from the classpath in this case, e.g. <em>classpath:test.xml</em>
- * refers to a file in the package of the class ({@link WadlGeneratorDescription#getGeneratorClass()}). The
- * file reference <em>classpath:/test.xml</em> refers to a file that is in the root of the classpath.
- * </li>
- *
- * </ul>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: WadlGeneratorDescription.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-public class WadlGeneratorDescription {
-
- private Class<? extends WadlGenerator> _generatorClass;
- private Properties _properties;
-
- public WadlGeneratorDescription() {
- }
-
- public WadlGeneratorDescription( Class<? extends WadlGenerator> generatorClass, Properties properties ) {
- _generatorClass = generatorClass;
- _properties = properties;
- }
-
- /**
- * @return the generatorClass
- */
- public Class<? extends WadlGenerator> getGeneratorClass() {
- return _generatorClass;
- }
- /**
- * @param generatorClass the generatorClass to set
- */
- public void setGeneratorClass( Class<? extends WadlGenerator> generatorClass ) {
- _generatorClass = generatorClass;
- }
- /**
- * @return the properties
- */
- public Properties getProperties() {
- return _properties;
- }
- /**
- * @param properties the properties to set
- */
- public void setProperties( Properties properties ) {
- _properties = properties;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.java
deleted file mode 100644
index 89d71657d75..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.api.wadl.config;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.jersey.server.wadl.WadlGeneratorImpl;
-
-/**
- * Loads {@link WadlGenerator}s from a provided list of {@link WadlGeneratorDescription}s.<br/>
- * The properties of the {@link WadlGeneratorDescription}s can refer to {@link WadlGenerator} properties
- * of these types:
- * <ul>
- *
- * <li>exact match: if the WadlGenerator property is of type <code>org.example.Foo</code> and the
- * property value provided by the {@link WadlGeneratorDescription} is of type <code>org.example.Foo</code></li>
- *
- * <li>java.io.InputStream: The {@link InputStream} can e.g. represent a file. The stream is loaded from the
- * property value (provided by the {@link WadlGeneratorDescription}) via
- * {@link ClassLoader#getResourceAsStream(String)}. It will be closed after {@link WadlGenerator#init()} was called.
- * </li>
- *
- * <li>Types that provide a constructor for the provided type (mostly java.lang.String)</li>
- *
- * <li><strong>Deprected, will be removed in future versions from the {@link WadlGeneratorLoader}:</strong><br/>
- * java.lang.File: The property value can contain the prefix <em>classpath:</em> to denote, that the
- * path to the file is relative to the classpath. In this case, the property value is stripped by
- * the prefix <em>classpath:</em> and the java.lang.File is created via
- * <pre><code>new File( generator.getClass().getResource( strippedFilename ).toURI() )</code></pre></li>
- *
- * </ul>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: WadlGeneratorLoader.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-class WadlGeneratorLoader {
-
- private static final Logger LOGGER = Logger.getLogger(WadlGeneratorLoader.class.getName());
-
- static WadlGenerator loadWadlGenerators(
- List<WadlGenerator> wadlGenerators) throws Exception {
- WadlGenerator wadlGenerator = new WadlGeneratorImpl();
- if (wadlGenerators != null && !wadlGenerators.isEmpty()) {
- for (WadlGenerator generator : wadlGenerators) {
- generator.setWadlGeneratorDelegate(wadlGenerator);
- wadlGenerator = generator;
- }
- }
- wadlGenerator.init();
- return wadlGenerator;
- }
-
- static WadlGenerator loadWadlGeneratorDescriptions(WadlGeneratorDescription... wadlGeneratorDescriptions) throws Exception {
- final List<WadlGeneratorDescription> list = wadlGeneratorDescriptions != null ? Arrays.asList(wadlGeneratorDescriptions) : null;
- return loadWadlGeneratorDescriptions(list);
- }
-
- static WadlGenerator loadWadlGeneratorDescriptions(List<WadlGeneratorDescription> wadlGeneratorDescriptions) throws Exception {
- WadlGenerator wadlGenerator = new WadlGeneratorImpl();
-
- final CallbackList callbacks = new CallbackList();
- try {
- if (wadlGeneratorDescriptions != null && !wadlGeneratorDescriptions.isEmpty()) {
- for (WadlGeneratorDescription wadlGeneratorDescription : wadlGeneratorDescriptions) {
- final WadlGeneratorControl control = loadWadlGenerator(wadlGeneratorDescription, wadlGenerator);
- wadlGenerator = control.wadlGenerator;
- callbacks.add(control.callback);
- }
- }
- wadlGenerator.init();
- } finally {
- callbacks.callback();
- }
-
- return wadlGenerator;
-
- }
-
- private static WadlGeneratorControl loadWadlGenerator(
- WadlGeneratorDescription wadlGeneratorDescription,
- com.sun.jersey.server.wadl.WadlGenerator wadlGeneratorDelegate) throws Exception {
- LOGGER.info("Loading wadlGenerator " + wadlGeneratorDescription.getGeneratorClass().getName());
- final WadlGenerator generator = wadlGeneratorDescription.getGeneratorClass().newInstance();
- generator.setWadlGeneratorDelegate(wadlGeneratorDelegate);
- CallbackList callbacks = null;
- if (wadlGeneratorDescription.getProperties() != null
- && !wadlGeneratorDescription.getProperties().isEmpty()) {
- callbacks = new CallbackList();
- for (Entry<Object, Object> entry : wadlGeneratorDescription.getProperties().entrySet()) {
- final Callback callback = setProperty(generator, entry.getKey().toString(), entry.getValue());
- callbacks.add(callback);
- }
- }
-
- return new WadlGeneratorControl(generator, callbacks);
- }
-
- /**
- * Set the object (generator) property with the given name to the specified value.
- * @param generator the object, on which the property shall be set
- * @param propertyName the name of the property, that shall be set
- * @param propertyValue the value to populate the property with
- * @return a {@link Callback} object that must be called later, or null if no callback is required.
- * @throws Exception if s.th. goes wrong
- */
- private static Callback setProperty(final Object generator, final String propertyName, final Object propertyValue)
- throws Exception {
-
- Callback result = null;
-
- final String methodName = "set" + propertyName.substring(0, 1).toUpperCase() + propertyName.substring(1);
- final Method method = getMethodByName(methodName, generator.getClass());
- if (method.getParameterTypes().length != 1) {
- throw new RuntimeException("Method " + methodName + " is no setter, it does not expect exactly one parameter, but " + method.getParameterTypes().length);
- }
- final Class<?> paramClazz = method.getParameterTypes()[0];
- if (paramClazz == propertyValue.getClass()) {
- method.invoke(generator, propertyValue);
- } else if (File.class.equals(paramClazz) && propertyValue instanceof String) {
-
- /* This is now deprecated and can be removed in future versions.
- * It's beeing replaced by the InputStream support, which must be used in
- * a JEE environment instead of files.
- */
-
- LOGGER.warning("Configuring the " + method.getDeclaringClass().getSimpleName()
- + " with the file based property " + propertyName + " is deprecated and will be removed"
- + " in future versions of jersey! You should use the InputStream based property instead.");
-
- final String filename = propertyValue.toString();
- if (filename.startsWith("classpath:")) {
- final String strippedFilename = filename.substring("classpath:".length());
- final URL resource = generator.getClass().getResource(strippedFilename);
- if (resource == null) {
- throw new RuntimeException("The file '" + strippedFilename + "' does not exist in the classpath."
- + " It's loaded by the generator class, so if you use a relative filename it's relative to"
- + " the generator class, otherwise you might want to load it via an absolute classpath reference like"
- + " classpath:/somefile.xml");
- }
- final File file = new File(resource.toURI());
- method.invoke(generator, file);
- } else {
- method.invoke(generator, new File(filename));
- }
- } else if (InputStream.class.equals(paramClazz) && propertyValue instanceof String) {
- final String resource = propertyValue.toString();
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null) {
- loader = WadlGeneratorLoader.class.getClassLoader();
- }
- final InputStream is = loader.getResourceAsStream(resource);
- if (is == null) {
- String message = "The resource '" + resource + "' does not exist.";
- throw new RuntimeException(message);
- }
- result = new Callback() {
-
- public void callback() {
- try {
- is.close();
- } catch (IOException e) {
- LOGGER.log(Level.WARNING, "Could not close InputStream from resource " + resource, e);
- }
- }
- };
- /* if the method invocation fails we need to close the input stream
- * by ourselves...
- */
- try {
- method.invoke(generator, is);
- } catch (Exception e) {
- is.close();
- throw e;
- }
- } else {
- /* does the param class provide a constructor for string?
- */
- final Constructor<?> paramTypeConstructor = paramClazz.getConstructor(propertyValue.getClass());
- if (paramTypeConstructor != null) {
- final Object typedPropertyValue = paramTypeConstructor.newInstance(propertyValue);
- method.invoke(generator, typedPropertyValue);
- } else {
- throw new RuntimeException("The property '" + propertyName + "' could not be set"
- + " because the expected parameter is neither of type " + propertyValue.getClass()
- + " nor of any type that provides a constructor expecting a " + propertyValue.getClass() + "."
- + " The expected parameter is of type " + paramClazz.getName());
- }
- }
-
- return result;
- }
-
- private static Method getMethodByName(final String methodName, final Class<?> clazz) {
- for (Method method : clazz.getMethods()) {
- if (method.getName().equals(methodName)) {
- return method;
- }
- }
- throw new RuntimeException("Method '" + methodName + "' not found for class " + clazz.getName());
- }
-
- private static class WadlGeneratorControl {
-
- WadlGenerator wadlGenerator;
- Callback callback;
-
- /**
- * The constructor.
- * @param wadlGenerator the generator, must not be null
- * @param callback the callback, can be null
- */
- public WadlGeneratorControl(WadlGenerator wadlGenerator,
- Callback callback) {
- this.wadlGenerator = wadlGenerator;
- this.callback = callback;
- }
- }
-
- private static interface Callback {
-
- void callback();
- }
-
- private static class CallbackList extends ArrayList<Callback> implements Callback {
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Callback all registered {@link Callback} items.
- */
- public void callback() {
- for (Callback callback : this) {
- callback.callback();
- }
- }
-
- /**
- * Appends the specified element to the end of the list, if the element is not null.
- *
- * @param e the element to append, can be null.
- * @return true if the element was appended to the list, otherwise null.
- */
- @Override
- public boolean add(Callback e) {
- return e != null ? super.add(e) : false;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/package-info.java
deleted file mode 100644
index cf85e43b894..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/config/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for configuring WADL generation.
- */
-package com.sun.jersey.api.wadl.config;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/package-info.java
deleted file mode 100644
index 1bf0de76a75..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/api/wadl/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for WADL generation.
- */
-package com.sun.jersey.api.wadl;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/ImplMessages.java b/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/ImplMessages.java
deleted file mode 100644
index 97e6e8def91..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/ImplMessages.java
+++ /dev/null
@@ -1,54 +0,0 @@
-
-package com.sun.jersey.atom.rome.impl;
-
-import com.sun.jersey.localization.Localizable;
-import com.sun.jersey.localization.LocalizableMessageFactory;
-import com.sun.jersey.localization.Localizer;
-
-
-/**
- * Defines string formatting method for each constant in the resource file
- *
- */
-public final class ImplMessages {
-
- private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.jersey.atom.rome.impl.impl");
- private final static Localizer localizer = new Localizer();
-
- public static Localizable localizableERROR_MARSHALLING_ATOM(Object arg0) {
- return messageFactory.getMessage("error.marshalling.atom", arg0);
- }
-
- /**
- * Error marshalling out Atom object of type "{0}".
- *
- */
- public static String ERROR_MARSHALLING_ATOM(Object arg0) {
- return localizer.localize(localizableERROR_MARSHALLING_ATOM(arg0));
- }
-
- public static Localizable localizableERROR_NOT_ATOM_FEED(Object arg0) {
- return messageFactory.getMessage("error.not.atom.feed", arg0);
- }
-
- /**
- * Feed is Not of type Atom Feed : "{0}".
- *
- */
- public static String ERROR_NOT_ATOM_FEED(Object arg0) {
- return localizer.localize(localizableERROR_NOT_ATOM_FEED(arg0));
- }
-
- public static Localizable localizableERROR_CREATING_ATOM(Object arg0) {
- return messageFactory.getMessage("error.creating.atom", arg0);
- }
-
- /**
- * Error creating Atom object of type "{0}".
- *
- */
- public static String ERROR_CREATING_ATOM(Object arg0) {
- return localizer.localize(localizableERROR_CREATING_ATOM(arg0));
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/impl.properties b/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/impl.properties
deleted file mode 100644
index f0af1a17ce0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/impl.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-error.marshalling.atom=Error marshalling out Atom object of type "{0}".
-error.creating.atom=Error creating Atom object of type "{0}".
-error.not.atom.feed=Feed is Not of type Atom Feed : "{0}".
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.java
deleted file mode 100644
index 066cc5908f7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.atom.rome.impl.provider.entity;
-
-import com.sun.jersey.atom.rome.impl.ImplMessages;
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.syndication.feed.atom.Entry;
-import com.sun.syndication.feed.atom.Feed;
-import com.sun.syndication.io.FeedException;
-import com.sun.syndication.io.WireFeedInput;
-import com.sun.syndication.io.WireFeedOutput;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.Format;
-import org.jdom.output.XMLOutputter;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class AtomEntryProvider extends AbstractMessageReaderWriterProvider<Entry> {
- private static final String FEED_TYPE = "atom_1.0";
-
- public AtomEntryProvider() {
- Class<?> c = Entry.class;
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == Entry.class;
- }
-
- public Entry readFrom(
- Class<Entry> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- return parseEntry(entityStream);
- } catch (FeedException cause) {
- IOException effect = new IOException(ImplMessages.ERROR_CREATING_ATOM(type));
- effect.initCause(cause);
- throw effect;
- } catch (JDOMException cause2) {
- IOException effect = new IOException(ImplMessages.ERROR_CREATING_ATOM(type));
- effect.initCause(cause2);
- throw effect;
- }
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == Entry.class;
- }
-
- public void writeTo(
- Entry t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- serializeEntry(t, entityStream);
- } catch (FeedException cause) {
- IOException effect = new IOException(ImplMessages.ERROR_MARSHALLING_ATOM(t.getClass()));
- effect.initCause(cause);
- throw effect;
- }
- }
-
- /**
- * Parse entry from InputStream.
- */
- private static Entry parseEntry(InputStream in)
- throws JDOMException, IOException, IllegalArgumentException, FeedException {
- // Parse entry into JDOM tree
- SAXBuilder builder = new SAXBuilder();
- Document entryDoc = builder.build(in);
- Element fetchedEntryElement = entryDoc.getRootElement();
- fetchedEntryElement.detach();
-
- // Put entry into a JDOM document with 'feed' root so that Rome can handle it
- Feed feed = new Feed();
- feed.setFeedType(FEED_TYPE);
- WireFeedOutput wireFeedOutput = new WireFeedOutput();
- Document feedDoc = wireFeedOutput.outputJDom(feed);
- feedDoc.getRootElement().addContent(fetchedEntryElement);
-
- WireFeedInput input = new WireFeedInput();
- Feed parsedFeed = (Feed)input.build(feedDoc);
- return (Entry)parsedFeed.getEntries().get(0);
- }
-
- /**
- * Serialize an entry to an OutputStream.
- *
- * @param entry the entry to serialize
- * @param out the output stream to which the entry will be written
- * @throws java.lang.IllegalArgumentException if the entry is malformed
- * @throws com.sun.syndication.io.FeedException if an error is raised by the ROME library
- * @throws java.io.IOException if an IO error occurs
- */
- @SuppressWarnings("unchecked")
- private static void serializeEntry(Entry entry, OutputStream out)
- throws IllegalArgumentException, FeedException, IOException {
- // Build a feed containing only the entry
- List entries = new ArrayList();
- entries.add(entry);
- Feed feed1 = new Feed();
- feed1.setFeedType( FEED_TYPE);
- feed1.setEntries(entries);
-
- // Use Rome to output feed as a JDOM document
- WireFeedOutput wireFeedOutput = new WireFeedOutput();
- Document feedDoc = wireFeedOutput.outputJDom(feed1);
-
- // Grab entry element from feed and get JDOM to serialize it
- Element entryElement= (Element)feedDoc.getRootElement().getChildren().get(0);
-
- XMLOutputter outputter = new XMLOutputter();
- outputter.setFormat(Format.getPrettyFormat());
-
- outputter.output(entryElement, out);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.java
deleted file mode 100644
index ec6187868dd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.atom.rome.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.syndication.feed.WireFeed;
-import com.sun.syndication.feed.atom.Feed;
-import com.sun.syndication.io.FeedException;
-import com.sun.syndication.io.WireFeedInput;
-import com.sun.syndication.io.WireFeedOutput;
-import com.sun.jersey.atom.rome.impl.ImplMessages;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-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;
-import org.jdom.Document;
-import org.jdom.output.Format;
-import org.jdom.output.XMLOutputter;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class AtomFeedProvider extends AbstractMessageReaderWriterProvider<Feed> {
- private static final String FEED_TYPE = "atom_1.0";
-
- public AtomFeedProvider() {
- Class<?> c = Feed.class;
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == Feed.class;
- }
-
- public Feed readFrom(
- Class<Feed> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- WireFeedInput input = new WireFeedInput();
- WireFeed wireFeed = input.build(new InputStreamReader(entityStream));
- if (!(wireFeed instanceof Feed)) {
- throw new IOException(ImplMessages.ERROR_NOT_ATOM_FEED(type));
- }
- return (Feed)wireFeed;
- } catch (FeedException cause) {
- IOException effect = new IOException(ImplMessages.ERROR_MARSHALLING_ATOM(type));
- effect.initCause(cause);
- throw effect;
- }
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == Feed.class;
- }
-
- public void writeTo(
- Feed t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- t.setFeedType(FEED_TYPE);
- WireFeedOutput wireFeedOutput = new WireFeedOutput();
- Document feedDoc = wireFeedOutput.outputJDom(t);
-
- XMLOutputter outputter = new XMLOutputter();
- outputter.setFormat(Format.getPrettyFormat());
- outputter.output(feedDoc, entityStream);
- } catch ( FeedException cause) {
- IOException effect = new IOException(ImplMessages.ERROR_MARSHALLING_ATOM(t.getClass()));
- effect.initCause(cause);
- throw effect;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/ClientRequestImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/ClientRequestImpl.java
deleted file mode 100644
index 7de48f14f88..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/ClientRequestImpl.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.impl;
-
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientRequestAdapter;
-import com.sun.jersey.core.header.OutBoundHeaders;
-
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public final class ClientRequestImpl extends ClientRequest implements ClientRequestAdapter {
- private Map<String, Object> properties;
-
- private URI uri;
-
- private String method;
-
- private Object entity;
-
- private final MultivaluedMap<String, Object> metadata;
-
- private ClientRequestAdapter adapter;
-
- public ClientRequestImpl(URI uri, String method) {
- this(uri, method, null, null);
- }
-
- public ClientRequestImpl(URI uri, String method, Object entity) {
- this(uri, method, entity, null);
- }
-
- public ClientRequestImpl(URI uri, String method,
- Object entity, MultivaluedMap<String, Object> metadata) {
- this.uri = uri;
- this.method = method;
- this.entity = entity;
- this.metadata = (metadata != null) ? metadata : new OutBoundHeaders();
- this.adapter = this;
- }
-
- public Map<String, Object> getProperties() {
- if (properties == null)
- properties = new HashMap<String, Object>();
-
- return properties;
- }
-
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
-
- public URI getURI() {
- return uri;
- }
-
- public void setURI(URI uri) {
- this.uri = uri;
- }
-
- public String getMethod() {
- return method;
- }
-
- public void setMethod(String method) {
- this.method = method;
- }
-
- public Object getEntity() {
- return entity;
- }
-
- public void setEntity(Object entity) {
- this.entity = entity;
- }
-
- public MultivaluedMap<String, Object> getMetadata() {
- return getHeaders();
- }
-
- public MultivaluedMap<String, Object> getHeaders() {
- return metadata;
- }
-
- public ClientRequestAdapter getAdapter() {
- return adapter;
- }
-
- public void setAdapter(ClientRequestAdapter adapter) {
- this.adapter = (adapter != null) ? adapter : this;
- }
-
- @Override
- public ClientRequest clone() {
- return new ClientRequestImpl(this.uri, this.method,
- this.entity, clone(this.metadata));
- }
-
- private static MultivaluedMap<String, Object> clone(MultivaluedMap<String, Object> md) {
- MultivaluedMap<String, Object> clone = new OutBoundHeaders();
- for (Map.Entry<String, List<Object>> e : md.entrySet()) {
- clone.put(e.getKey(), new ArrayList<Object>(e.getValue()));
- }
- return clone;
- }
-
-
- // ClientRequestAdapter
-
- public OutputStream adapt(ClientRequest request, OutputStream out) throws IOException {
- return out;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/CopyOnWriteHashMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/CopyOnWriteHashMap.java
deleted file mode 100644
index 02f593c956a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/CopyOnWriteHashMap.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.client.impl;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * A basic copy on write HashMap.
- * <p>
- * If an instance is cloned then any methods invoked on the instance or clone
- * that result in state modification will result in copying of the state
- * before modification.
- *
- * @author Paul.Sandoz@Oracle.Com
- * @author pavel.bucek@oracle.com
- */
-public class CopyOnWriteHashMap<K,V> implements Map<K,V> {
- private volatile Map<K,V> core;
-
- private volatile Map<K,V> view;
-
- private final AtomicBoolean requiresCopyOnWrite;
-
- public CopyOnWriteHashMap() {
- this.core = new HashMap<K, V>();
- this.requiresCopyOnWrite = new AtomicBoolean(false);
- }
-
- private CopyOnWriteHashMap(CopyOnWriteHashMap<K,V> that) {
- this.core = that.core;
- this.requiresCopyOnWrite = new AtomicBoolean(true);
- }
-
- @Override
- public CopyOnWriteHashMap<K,V> clone() {
- try {
- return new CopyOnWriteHashMap(this);
- } finally {
- requiresCopyOnWrite.set(true);
- }
- }
-
- private void copy() {
- if (requiresCopyOnWrite.compareAndSet(true, false)) {
- core = new HashMap<K, V>(core);
- view = null;
- }
- }
-
- @Override
- public int size() {
- return core.size();
- }
-
- @Override
- public boolean isEmpty() {
- return core.isEmpty();
- }
-
- @Override
- public boolean containsKey(Object key) {
- return core.containsKey(key);
- }
-
- @Override
- public boolean containsValue(Object value) {
- return core.containsValue(value);
- }
-
- @Override
- public V get(Object key) {
- return core.get(key);
- }
-
- @Override
- public V put(K key, V value) {
- copy();
- return core.put(key,value);
- }
-
- @Override
- public V remove(Object key) {
- copy();
- return core.remove(key);
- }
-
- @Override
- public void putAll(Map<? extends K, ? extends V> t) {
- copy();
- core.putAll(t);
- }
-
- @Override
- public void clear() {
- core = new HashMap<K, V>();
- copy();
- }
-
- @Override
- public Set<K> keySet() {
- return getView().keySet();
- }
-
- @Override
- public Collection<V> values() {
- return getView().values();
- }
-
- @Override
- public Set<Entry<K,V>> entrySet() {
- return getView().entrySet();
- }
-
- @Override
- public String toString() {
- return core.toString();
- }
-
- private Map<K, V> getView() {
- if (view == null) {
- view = Collections.unmodifiableMap(core);
- }
- return view;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/async/FutureClientResponseListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/async/FutureClientResponseListener.java
deleted file mode 100644
index 351c6b3cbf7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/impl/async/FutureClientResponseListener.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.client.impl.async;
-
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.async.FutureListener;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.FutureTask;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class FutureClientResponseListener<T> extends FutureTask<T>
- implements FutureListener<ClientResponse> {
-
- private static final Callable NO_OP_CALLABLE = new Callable() {
- public Object call() throws Exception {
- throw new IllegalStateException();
- }
- };
-
- private Future<ClientResponse> f;
-
- public FutureClientResponseListener() {
- super(NO_OP_CALLABLE);
- }
-
- public void setCancelableFuture(Future<ClientResponse> f) {
- this.f = f;
- }
-
- @Override
- public boolean cancel(boolean mayInterruptIfRunning) {
- if (f.isCancelled()) {
- if (!super.isCancelled()) {
- super.cancel(true);
- }
- return false;
- }
-
- boolean cancelled = f.cancel(mayInterruptIfRunning);
- if (cancelled) {
- super.cancel(true);
- }
-
- return cancelled;
- }
-
- @Override
- public boolean isCancelled() {
- if (f.isCancelled()) {
- if (!super.isCancelled()) {
- super.cancel(true);
- }
- return true;
- } else {
- return false;
- }
- }
-
- // FutureListener
-
- public void onComplete(Future<ClientResponse> response) {
- try {
- set(get(response.get()));
- } catch (CancellationException ex) {
- super.cancel(true);
- } catch (ExecutionException ex) {
- setException(ex.getCause());
- } catch (Throwable t) {
- setException(t);
- }
- }
-
- protected abstract T get(ClientResponse response);
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/osgi/Activator.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/osgi/Activator.java
deleted file mode 100644
index 2580ea74db8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/osgi/Activator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.client.osgi;
-
-import com.sun.ws.rs.ext.RuntimeDelegateImpl;
-
-import javax.ws.rs.ext.RuntimeDelegate;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-import java.util.logging.Logger;
-
-/**
- *
- * @author japod
- */
-public class Activator implements BundleActivator {
-
- private static final Logger LOGGER = Logger.getLogger(Activator.class.getName());
-
- //@Override
- public void start(BundleContext bc) throws Exception {
-
- Bundle jerseyServerBundle = getJerseyServerBundle(bc);
-
- if (jerseyServerBundle == null) {
- LOGGER.config("jersey-client bundle registers JAX-RS RuntimeDelegate");
- RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
- } else {
- jerseyServerBundle.start();
- }
- }
-
- private Bundle getJerseyServerBundle(BundleContext bc) {
- for (Bundle b : bc.getBundles()) {
- final String symbolicName = b.getSymbolicName();
- if ((symbolicName != null) && symbolicName.endsWith("jersey-server")) {
- return b;
- }
- }
- return null;
- }
-
- //@Override
- public void stop(BundleContext bc) throws Exception {
- // TODO: what now brown cow?
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxy.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxy.java
deleted file mode 100644
index b849192d700..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxy.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.client.proxy;
-
-import com.sun.jersey.api.client.ClientHandler;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.async.AsyncClientHandler;
-import java.util.concurrent.Future;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ViewProxy<T> {
-
- T view(Class<T> type, ClientRequest request, ClientHandler handler);
-
- T view(T v, ClientRequest request, ClientHandler handler);
-
- Future<T> asyncView(Class<T> type, ClientRequest request, AsyncClientHandler handler);
-
- Future<T> asyncView(T v, ClientRequest request, AsyncClientHandler handler);
-
- T view(Class<T> type, ClientResponse response);
-
- T view(T v, ClientResponse cr);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxyProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxyProvider.java
deleted file mode 100644
index 795fbfff70d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/proxy/ViewProxyProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.client.proxy;
-
-import com.sun.jersey.api.client.Client;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ViewProxyProvider {
-
- <T> ViewProxy<T> proxy(Client client, Class<T> c);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HTTPSProperties.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HTTPSProperties.java
deleted file mode 100644
index b846371d113..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HTTPSProperties.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.urlconnection;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientRequest;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import java.security.NoSuchAlgorithmException;
-
-/**
- * HTTPS properties for SSL configuration of a {@link HttpsURLConnection}.
- * <p>
- * An instance of this class may be added as a property of the {@link Client}
- * or {@link ClientRequest} using the property name
- * {@link #PROPERTY_HTTPS_PROPERTIES}.
- *
- * @author pavel.bucek@sun.com
- */
-public class HTTPSProperties {
-
- /**
- * HTTPS properties property.
- *
- * The value MUST be an instance of {@link com.sun.jersey.client.urlconnection.HTTPSProperties}.
- *
- * If the property is absent then HTTPS properties will not be used.
- */
- public static final String PROPERTY_HTTPS_PROPERTIES =
- "com.sun.jersey.client.impl.urlconnection.httpsProperties";
-
- private HostnameVerifier hostnameVerifier = null;
-
- private SSLContext sslContext = null;
-
- /**
- * Construct default properties with no {@link HostnameVerifier}
- * and a {@link SSLContext} constructed using <code>SSLContext.getInstance("SSL")</code>.
- *
- * @throws java.security.NoSuchAlgorithmException if the SSLContext could not
- * be created.
- */
- public HTTPSProperties() throws NoSuchAlgorithmException {
- this(null, SSLContext.getInstance("SSL"));
- }
-
- /**
- * Construct with a {@link HostnameVerifier} and a {@link SSLContext}
- * constructed using <code>SSLContext.getInstance("SSL")</code>.
- *
- * @param hv the HostnameVerifier.
- * @throws java.security.NoSuchAlgorithmException if the SSLContext could not
- * be created.
- */
- public HTTPSProperties(HostnameVerifier hv) throws NoSuchAlgorithmException {
- this (hv, SSLContext.getInstance("SSL"));
- }
-
- /**
- * Construct with a {@link HostnameVerifier} and a {@link SSLContext}.
- *
- * @param hv the HostnameVerifier.
- * @param c the SSLContext. Must not be null.
- */
- public HTTPSProperties(HostnameVerifier hv, SSLContext c) {
- if(c == null)
- throw new IllegalArgumentException("SSLContext must not be null");
-
- this.hostnameVerifier = hv;
- this.sslContext = c;
- }
-
-
- /**
- * Get the P{@link HostnameVerifier}.
- *
- * @return the HostnameVerifier, is <code>null</code> if not set
- * at construction.
- */
- public HostnameVerifier getHostnameVerifier() {
- return hostnameVerifier;
- }
-
- /**
- * Get the {@link SSLContext}.
- *
- * @return the SSLContext.
- */
- public SSLContext getSSLContext() {
- return sslContext;
- }
-
- /**
- * Set the {@link HttpsURLConnection} with the HTTPS properties.
- *
- * @param connection the HttpsURLConnection.
- */
- public void setConnection(HttpsURLConnection connection) {
- if (hostnameVerifier != null)
- connection.setHostnameVerifier(hostnameVerifier);
- connection.setSSLSocketFactory(sslContext.getSocketFactory());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.java
deleted file mode 100644
index 62969e9831d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.urlconnection;
-
-import com.sun.jersey.api.client.Client;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-/**
- * A factory for {@link HttpURLConnection} instances.
- * <p>
- * A factory may be used to create a {@link HttpURLConnection} and configure
- * it in a custom manner that is not possible using the Client API.
- * <p>
- * A factory instance may be registered with the constructor
- * {@link URLConnectionClientHandler#URLConnectionClientHandler(com.sun.jersey.client.urlconnection.HttpURLConnectionFactory)}.
- * Then the {@link URLConnectionClientHandler} instance may be registered with a {@link Client}
- * using the constructor {@link Client#Client(com.sun.jersey.api.client.ClientHandler) }.
- *
- * @author pavel.bucek@sun.com
- */
-public interface HttpURLConnectionFactory {
-
- /**
- * Get a {@link HttpURLConnection} for a given URL.
- * <p>
- * This method is re-entrant so implementation should not return the same
- * {@link HttpURLConnection} instance for multiple and concurrent requests.
- *
- * @param url the URL.
- * @return the {@link HttpURLConnection}.
- * @throws java.io.IOException
- */
- public HttpURLConnection getHttpURLConnection(URL url) throws IOException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.java b/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.java
deleted file mode 100644
index b9e510f1d36..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.client.urlconnection;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientHandlerException;
-import com.sun.jersey.api.client.ClientRequest;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.CommittingOutputStream;
-import com.sun.jersey.api.client.TerminatingClientHandler;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.core.header.InBoundHeaders;
-
-import javax.net.ssl.HttpsURLConnection;
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Field;
-import java.net.HttpURLConnection;
-import java.net.ProtocolException;
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A terminating client handler that uses {@link HttpURLConnection} or
- * {@link HttpsURLConnection} to make HTTP requests and receive HTTP responses.
- * <p>
- * By default a {@link HttpURLConnection} or {@link HttpsURLConnection}
- * instance is obtained using {@link URL#openConnection() }. This behaviour
- * may be overridden by registering an {@link HttpURLConnectionFactory}
- * instance when constructing this class.
- * <p>
- * For SSL configuration of HTTPS the {@link HTTPSProperties} may be used
- * and an instance added as a property of the {@link Client} or
- * {@link ClientRequest}.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see HttpURLConnectionFactory
- */
-public final class URLConnectionClientHandler extends TerminatingClientHandler {
-
- /**
- * A value of "true" declares that the client will try
- * to set unsupported HTTP method to HttpURLConnection via reflection.
- * Enabling this feature might cause security related warnings/errors
- * and it might break when other JDK implementation is used.
- *
- * Use only when you know what you are doing.
- *
- * The value MUST be an instance of {@link java.lang.Boolean}.
- * If the property is absent then the default value is "false".
- */
- public static final String PROPERTY_HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND =
- "com.sun.jersey.client.property.httpUrlConnectionSetMethodWorkaround";
-
-
- private final class URLConnectionResponse extends ClientResponse {
- private final String method;
- private final HttpURLConnection uc;
-
- URLConnectionResponse(int status, InBoundHeaders headers, InputStream entity, String method, HttpURLConnection uc) {
- super(status, headers, entity, getMessageBodyWorkers());
- this.method = method;
- this.uc = uc;
- }
-
- @Override
- public boolean hasEntity() {
- if (method.equals("HEAD") || getEntityInputStream() == null)
- return false;
-
- int l = uc.getContentLength();
- return l > 0 || l == -1;
- }
-
- @Override
- public String toString() {
- return uc.getRequestMethod() + " " + uc.getURL() + " returned a response status of " + this.getStatus() +
- " " + this.getClientResponseStatus();
- }
- }
-
- private HttpURLConnectionFactory httpURLConnectionFactory = null;
-
- /**
- * Construct a new instance with an HTTP URL connection factory.
- *
- * @param httpURLConnectionFactory the HTTP URL connection factory.
- */
- public URLConnectionClientHandler(HttpURLConnectionFactory httpURLConnectionFactory) {
- this.httpURLConnectionFactory = httpURLConnectionFactory;
- }
-
- public URLConnectionClientHandler() {
- this(null);
- }
-
-
- /**
- * ClientRequest handler.
- *
- * @param ro ClientRequest
- * @return Server response represented as ClientResponse
- */
- public ClientResponse handle(ClientRequest ro) {
- try {
- return _invoke(ro);
- } catch (Exception ex) {
- throw new ClientHandlerException(ex);
- }
- }
-
- private ClientResponse _invoke(final ClientRequest ro) throws IOException {
- final HttpURLConnection uc;
-
- if(this.httpURLConnectionFactory == null) {
- uc = (HttpURLConnection)ro.getURI().toURL().openConnection();
- } else {
- uc = this.httpURLConnectionFactory.getHttpURLConnection(ro.getURI().toURL());
- }
-
- Integer readTimeout = (Integer)ro.getProperties().get(
- ClientConfig.PROPERTY_READ_TIMEOUT);
- if (readTimeout != null) {
- uc.setReadTimeout(readTimeout);
- }
-
- Integer connectTimeout = (Integer)ro.getProperties().get(
- ClientConfig.PROPERTY_CONNECT_TIMEOUT);
- if (connectTimeout != null) {
- uc.setConnectTimeout(connectTimeout);
- }
-
- Boolean followRedirects = (Boolean)ro.getProperties().get(
- ClientConfig.PROPERTY_FOLLOW_REDIRECTS);
- if (followRedirects != null) {
- uc.setInstanceFollowRedirects(followRedirects);
- }
-
- if (uc instanceof HttpsURLConnection) {
- HTTPSProperties httpsProperties = (HTTPSProperties) ro.getProperties().get(
- HTTPSProperties.PROPERTY_HTTPS_PROPERTIES);
- if (httpsProperties != null) {
- httpsProperties.setConnection((HttpsURLConnection)uc);
- }
- }
-
- Boolean httpUrlConnectionSetMethodWorkaround = (Boolean)ro.getProperties().get(
- PROPERTY_HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND);
- if (httpUrlConnectionSetMethodWorkaround != null && httpUrlConnectionSetMethodWorkaround == true) {
- setRequestMethodUsingWorkaroundForJREBug(uc, ro.getMethod());
- } else {
- uc.setRequestMethod(ro.getMethod());
- }
-
- // Write the request headers
- writeOutBoundHeaders(ro.getHeaders(), uc);
-
- // Write the entity (if any)
- Object entity = ro.getEntity();
- if (entity != null) {
- uc.setDoOutput(true);
-
- writeRequestEntity(ro, new RequestEntityWriterListener() {
- public void onRequestEntitySize(long size) {
- if (size != -1 && size < Integer.MAX_VALUE) {
- // HttpURLConnection uses the int type for content length
- uc.setFixedLengthStreamingMode((int)size);
- } else {
- // TODO it appears HttpURLConnection has some bugs in
- // chunked encoding
- // uc.setChunkedStreamingMode(0);
- Integer chunkedEncodingSize = (Integer)ro.getProperties().get(
- ClientConfig.PROPERTY_CHUNKED_ENCODING_SIZE);
- if (chunkedEncodingSize != null) {
- uc.setChunkedStreamingMode(chunkedEncodingSize);
- }
- }
- }
-
- public OutputStream onGetOutputStream() throws IOException {
- return new CommittingOutputStream() {
- @Override
- protected OutputStream getOutputStream() throws IOException {
- return uc.getOutputStream();
- }
-
- @Override
- public void commit() throws IOException {
- writeOutBoundHeaders(ro.getHeaders(), uc);
- }
- };
- }
- });
- } else {
- writeOutBoundHeaders(ro.getHeaders(), uc);
- }
-
- // Return the in-bound response
- return new URLConnectionResponse(
- uc.getResponseCode(),
- getInBoundHeaders(uc),
- getInputStream(uc),
- ro.getMethod(),
- uc);
- }
-
- /**
- * Workaround for a bug in <code>HttpURLConnection.setRequestMethod(String)</code>
- * The implementation of Sun Microsystems is throwing a <code>ProtocolException</code>
- * when the method is other than the HTTP/1.1 default methods. So
- * to use PROPFIND and others, we must apply this workaround.
- *
- * See issue http://java.net/jira/browse/JERSEY-639
- */
-
- private static final void setRequestMethodUsingWorkaroundForJREBug(final HttpURLConnection httpURLConnection, final String method) {
- try {
- httpURLConnection.setRequestMethod(method); // Check whether we are running on a buggy JRE
- } catch (final ProtocolException pe) {
- try {
- final Class<?> httpURLConnectionClass = httpURLConnection.getClass();
- final Field methodField = httpURLConnectionClass.getSuperclass().getDeclaredField("method");
- methodField.setAccessible(true);
- methodField.set(httpURLConnection, method);
- } catch (final Exception e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- private void writeOutBoundHeaders(MultivaluedMap<String, Object> metadata, HttpURLConnection uc) {
- for (Map.Entry<String, List<Object>> e : metadata.entrySet()) {
- List<Object> vs = e.getValue();
- if (vs.size() == 1) {
- uc.setRequestProperty(e.getKey(), ClientRequest.getHeaderValue(vs.get(0)));
- } else {
- StringBuilder b = new StringBuilder();
- boolean add = false;
- for (Object v : e.getValue()) {
- if (add) b.append(',');
- add = true;
- b.append(ClientRequest.getHeaderValue(v));
- }
- uc.setRequestProperty(e.getKey(), b.toString());
- }
- }
- }
-
- private InBoundHeaders getInBoundHeaders(HttpURLConnection uc) {
- InBoundHeaders headers = new InBoundHeaders();
- for (Map.Entry<String, List<String>> e : uc.getHeaderFields().entrySet()) {
- if (e.getKey() != null)
- headers.put(e.getKey(), e.getValue());
- }
- return headers;
- }
-
- private InputStream getInputStream(HttpURLConnection uc) throws IOException {
- if (uc.getResponseCode() < 300) {
- return uc.getInputStream();
- } else {
- InputStream ein = uc.getErrorStream();
- return (ein != null)
- ? ein : new ByteArrayInputStream(new byte[0]);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableLanguageTag.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableLanguageTag.java
deleted file mode 100644
index 4750c09a1f2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableLanguageTag.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-
-/**
- * An acceptable language tag.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AcceptableLanguageTag extends LanguageTag implements QualityFactor {
-
- protected int quality = DEFAULT_QUALITY_FACTOR;
-
- public AcceptableLanguageTag(String primaryTag, String subTags) {
- super(primaryTag, subTags);
- }
-
- public AcceptableLanguageTag(String header) throws ParseException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public AcceptableLanguageTag(HttpHeaderReader reader) throws ParseException {
- // Skip any white space
- reader.hasNext();
-
- tag = reader.nextToken();
- if (!tag.equals("*"))
- parse(tag);
- else
- primaryTag = tag;
-
- if (reader.hasNext()) {
- quality = HttpHeaderReader.readQualityFactorParameter(reader);
- }
- }
-
- public int getQuality() {
- return quality;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableMediaType.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableMediaType.java
deleted file mode 100644
index 5ededf85ad7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableMediaType.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-import javax.ws.rs.core.MediaType;
-import java.util.Map;
-
-/**
- * An acceptable media type.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AcceptableMediaType extends MediaType implements QualityFactor {
- private final int q;
-
- public AcceptableMediaType(String p, String s) {
- super(p, s);
- q = DEFAULT_QUALITY_FACTOR;
- }
-
- public AcceptableMediaType(String p, String s, int q, Map<String, String> parameters) {
- super(p, s, parameters);
- this.q = q;
- }
-
- public int getQuality() {
- return q;
- }
-
- public static AcceptableMediaType valueOf(HttpHeaderReader reader) throws ParseException {
- // Skip any white space
- reader.hasNext();
-
- // Get the type
- String type = reader.nextToken();
- String subType = "*";
- // Some HTTP implements use "*" to mean "*/*"
- if (reader.hasNextSeparator('/', false)) {
- reader.next(false);
- // Get the subtype
- subType = reader.nextToken();
- }
-
- Map<String, String> parameters = null;
- int quality = DEFAULT_QUALITY_FACTOR;
- if (reader.hasNext()) {
- parameters = HttpHeaderReader.readParameters(reader);
- if (parameters != null) {
- String v = parameters.get(QUALITY_FACTOR);
- if (v != null)
- quality = HttpHeaderReader.readQualityFactor(v);
- }
- }
-
- return new AcceptableMediaType(type, subType, quality, parameters);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableToken.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableToken.java
deleted file mode 100644
index bc97f285aef..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/AcceptableToken.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-
-/**
- * An acceptable token.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AcceptableToken extends Token implements QualityFactor {
- protected int quality = DEFAULT_QUALITY_FACTOR;
-
- public AcceptableToken(String header) throws ParseException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public AcceptableToken(HttpHeaderReader reader) throws ParseException {
- // Skip any white space
- reader.hasNext();
-
- token = reader.nextToken();
-
- if (reader.hasNext()) {
- quality = HttpHeaderReader.readQualityFactorParameter(reader);
- }
- }
-
- public int getQuality() {
- return quality;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/ContentDisposition.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/ContentDisposition.java
deleted file mode 100644
index 01ea9916610..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/ContentDisposition.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Map;
-
-/**
- * A content disposition header.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author imran@smartitengineering.com
- */
-public class ContentDisposition {
- private String type;
-
- private Map<String, String> parameters;
-
- private String fileName;
-
- private Date creationDate;
-
- private Date modificationDate;
-
- private Date readDate;
-
- private long size;
-
- protected ContentDisposition(String type, String fileName,
- Date creationDate, Date modificationDate, Date readDate,
- long size) {
- this.type = type;
- this.fileName = fileName;
- this.creationDate = creationDate;
- this.modificationDate = modificationDate;
- this.readDate = readDate;
- this.size = size;
- }
-
- public ContentDisposition(String header) throws ParseException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public ContentDisposition(HttpHeaderReader reader) throws ParseException {
- reader.hasNext();
-
- type = reader.nextToken();
-
- if (reader.hasNext())
- parameters = HttpHeaderReader.readParameters(reader);
- if (parameters == null)
- parameters = Collections.emptyMap();
- else
- parameters = Collections.unmodifiableMap(parameters);
-
- createParameters();
- }
-
- /**
- * Get the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Get the parameters.
- *
- * @return the parameters
- */
- public Map<String, String> getParameters() {
- return parameters;
- }
-
- /**
- * Get the filename parameter.
- *
- * @return the size
- */
- public String getFileName() {
- return fileName;
- }
-
- /**
- * Get the creation-date parameter.
- *
- * @return the creationDate
- */
- public Date getCreationDate() {
- return creationDate;
- }
-
- /**
- * Get the modification-date parameter.
- *
- * @return the modificationDate
- */
- public Date getModificationDate() {
- return modificationDate;
- }
-
- /**
- * Get the read-date parameter.
- *
- * @return the readDate
- */
- public Date getReadDate() {
- return readDate;
- }
-
- /**
- * Get the size parameter.
- *
- * @return the size
- */
- public long getSize() {
- return size;
- }
-
- /**
- * Convert the disposition to a "Content-Disposition" header value.
- *
- * @return the "Content-Disposition" value.
- */
- @Override
- public String toString() {
- return toStringBuffer().toString();
- }
-
- protected StringBuilder toStringBuffer() {
- StringBuilder sb = new StringBuilder();
-
- sb.append(type);
- addStringParameter(sb, "filename", fileName);
- addDateParameter(sb, "creation-date", creationDate);
- addDateParameter(sb, "modification-date", modificationDate);
- addDateParameter(sb, "read-date", readDate);
- addLongParameter(sb, "size", size);
-
- return sb;
- }
-
- protected void addStringParameter(StringBuilder sb, String name, String p) {
- if (p != null)
- sb.append("; ").append(name).append("=\"").append(p).append("\"");
- }
-
- protected void addDateParameter(StringBuilder sb, String name, Date p) {
- if (p != null)
- sb.append("; ").append(name).append("=\"").append(HttpDateFormat.getPreferedDateFormat().format(p)).append("\"");
- }
-
- protected void addLongParameter(StringBuilder sb, String name, Long p) {
- if (p != -1)
- sb.append("; ").append(name).append('=').append(Long.toString(p));
- }
-
-
- private void createParameters() throws ParseException {
- fileName = parameters.get("filename");
-
- creationDate = createDate("creation-date");
-
- modificationDate = createDate("modification-date");
-
- readDate = createDate("read-date");
-
- size = createLong("size");
- }
-
- private Date createDate(String name) throws ParseException {
- String value = parameters.get(name);
- if (value == null)
- return null;
- return HttpDateFormat.getPreferedDateFormat().parse(value);
- }
-
- private long createLong(String name) throws ParseException {
- String value = parameters.get(name);
- if (value == null)
- return -1;
- try {
- return Long.valueOf(value);
- } catch (NumberFormatException e) {
- throw new ParseException("Error parsing size parameter of value, " + value, 0);
- }
- }
-
- /**
- * Start building content disposition.
- *
- * @param type the disposition typr.
- * @return the content disposition builder.
- */
- public static ContentDispositionBuilder type(String type) {
- return new ContentDispositionBuilder(type);
- }
-
- /**
- * Builder to build content disposition.
- *
- * @param <T> the builder type.
- * @param <V> the content disposition type.
- */
- public static class ContentDispositionBuilder<T extends ContentDispositionBuilder, V extends ContentDisposition> {
- protected String type;
-
- protected String fileName;
-
- protected Date creationDate;
-
- protected Date modificationDate;
-
- protected Date readDate;
-
- protected long size = -1;
-
- ContentDispositionBuilder(String type) {
- this.type = type;
- }
-
- /**
- * Add the "file-name" parameter.
- *
- * @param fileName the "file-name" parameter. If null the value
- * is removed
- * @return this builder.
- */
- public T fileName(String fileName) {
- this.fileName = fileName;
- return (T)this;
- }
-
- /**
- * Add the "creation-date" parameter.
- *
- * @param creationDate the "creation-date" parameter. If null the value
- * is removed
- * @return this builder.
- */
- public T creationDate(Date creationDate) {
- this.creationDate = creationDate;
- return (T)this;
- }
-
- /**
- * Add the "modification-date" parameter.
- *
- * @param modificationDate the "modification-date" parameter. If null the value
- * is removed
- * @return this builder.
- */
- public T modificationDate(Date modificationDate) {
- this.modificationDate = modificationDate;
- return (T)this;
- }
-
- /**
- * Add the "read-date" parameter.
- *
- * @param readDate the "read-date" parameter. If null the value
- * is removed
- * @return this builder.
- */
- public T readDate(Date readDate) {
- this.readDate = readDate;
- return (T)this;
- }
-
- /**
- * Add the "size" parameter.
- *
- * @param size the "size" parameter. If -1 the value is removed.
- * @return this builder.
- */
- public T size(long size) {
- this.size = size;
- return (T)this;
- }
-
- /**
- * Build the content disposition.
- *
- * @return the content disposition.
- */
- public V build() {
- ContentDisposition cd = new ContentDisposition(type, fileName, creationDate, modificationDate, readDate, size);
- return (V)cd;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/FormDataContentDisposition.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/FormDataContentDisposition.java
deleted file mode 100644
index df542abcb13..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/FormDataContentDisposition.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-import java.util.Date;
-
-/**
- * A form-data content disposition header.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author imran@smartitengineering.com
- */
-public class FormDataContentDisposition extends ContentDisposition {
- private String name;
-
- /**
- * Constructor for the builder.
- *
- * @param type the disposition type. will be "form-data".
- * @param name the control name.
- * @param fileName the file name.
- * @param creationDate the creation date.
- * @param modificationDate the modification date.
- * @param readDate the read date.
- * @param size the size.
- * @throws IllegalArgumentException if the type is not equal to "form-data"
- * or the name is <code>null</code>
- */
- protected FormDataContentDisposition(String type, String name, String fileName,
- Date creationDate, Date modificationDate, Date readDate,
- long size) {
- super(type, fileName, creationDate, modificationDate, readDate, size);
- this.name = name;
-
- if (!getType().equalsIgnoreCase("form-data")) {
- throw new IllegalArgumentException("The content dispostion type is not equal to form-data");
- }
-
- if (name == null) {
- throw new IllegalArgumentException("The name parameter is not present");
- }
- }
-
- public FormDataContentDisposition(String header) throws ParseException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public FormDataContentDisposition(HttpHeaderReader reader) throws ParseException {
- super(reader);
- if (!getType().equalsIgnoreCase("form-data")) {
- throw new IllegalArgumentException("The content dispostion type is not equal to form-data");
- }
-
- name = getParameters().get("name");
- if (name == null) {
- throw new IllegalArgumentException("The name parameter is not present");
- }
- }
-
- /**
- * Get the name parameter.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- @Override
- protected StringBuilder toStringBuffer() {
- StringBuilder sb = super.toStringBuffer();
-
- addStringParameter(sb, "name", name);
-
- return sb;
- }
-
- /**
- * Start building a form data content disposition.
- *
- * @param name the control name.
- * @return the form data content disposition builder.
- */
- public static FormDataContentDispositionBuilder name(String name) {
- return new FormDataContentDispositionBuilder(name);
- }
-
- /**
- * Builder to build form data content disposition.
- *
- */
- public static class FormDataContentDispositionBuilder extends ContentDispositionBuilder<FormDataContentDispositionBuilder, FormDataContentDisposition> {
- private String name;
-
- FormDataContentDispositionBuilder(String name) {
- super("form-data");
- this.name = name;
- }
-
- @Override
- public FormDataContentDisposition build() {
- FormDataContentDisposition cd = new FormDataContentDisposition(type, name, fileName, creationDate, modificationDate, readDate, size);
- return cd;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/HttpDateFormat.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/HttpDateFormat.java
deleted file mode 100644
index b35b70d4a21..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/HttpDateFormat.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.TimeZone;
-
-/**
- * Helper class for HTTP specified date formats.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class HttpDateFormat {
-
- private HttpDateFormat() {
- }
-
- /**
- * The date format pattern for RFC 1123.
- */
- private static final String RFC1123_DATE_FORMAT_PATTERN = "EEE, dd MMM yyyy HH:mm:ss zzz";
-
- /**
- * The date format pattern for RFC 1036.
- */
- private static final String RFC1036_DATE_FORMAT_PATTERN = "EEEE, dd-MMM-yy HH:mm:ss zzz";
-
- /**
- * The date format pattern for ANSI C asctime().
- */
- private static final String ANSI_C_ASCTIME_DATE_FORMAT_PATTERN = "EEE MMM d HH:mm:ss yyyy";
-
- private static ThreadLocal<List<SimpleDateFormat>> dateFormats = new ThreadLocal<List<SimpleDateFormat>>() {
- @Override
- protected synchronized List<SimpleDateFormat> initialValue() {
- return createDateFormats();
- }
- };
-
- private static List<SimpleDateFormat> createDateFormats() {
- SimpleDateFormat[] dateFormats = new SimpleDateFormat[] {
- new SimpleDateFormat(RFC1123_DATE_FORMAT_PATTERN, Locale.US),
- new SimpleDateFormat(RFC1036_DATE_FORMAT_PATTERN, Locale.US),
- new SimpleDateFormat(ANSI_C_ASCTIME_DATE_FORMAT_PATTERN, Locale.US)
- };
-
- TimeZone tz = TimeZone.getTimeZone("GMT");
- dateFormats[0].setTimeZone(tz);
- dateFormats[1].setTimeZone(tz);
- dateFormats[2].setTimeZone(tz);
-
- return Collections.unmodifiableList(Arrays.asList(dateFormats));
- }
-
- /**
- * Return an unmodifiable list of HTTP specified date formats to use for
- * parsing or formating {@link Date}.
- * <p>
- * The list of date formats are scoped to the current thread and may be
- * used without requiring to synchronize access to the instances when
- * parsing or formatting.
- *
- * @return the list of data formats.
- */
- public static List<SimpleDateFormat> getDateFormats() {
- return dateFormats.get();
- }
-
- /**
- * Get the preferred HTTP specified date format (RFC 1123).
- * <p>
- * The date format is scoped to the current thread and may be
- * used without requiring to synchronize access to the instance when
- * parsing or formatting.
- *
- * @return the preferred of data format.
- */
- public static SimpleDateFormat getPreferedDateFormat() {
- return dateFormats.get().get(0);
- }
-
- /**
- * Read a date.
- *
- * @param date the date as a string.
- *
- * @return the date
- * @throws java.text.ParseException
- */
- public static Date readDate(String date) throws ParseException {
- ParseException pe = null;
- for (SimpleDateFormat f : HttpDateFormat.getDateFormats()) {
- try {
- return f.parse(date);
- } catch (ParseException e) {
- pe = (pe == null) ? e : pe;
- }
- }
-
- throw pe;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/InBoundHeaders.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/InBoundHeaders.java
deleted file mode 100644
index 063ed5f2a4f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/InBoundHeaders.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.util.StringKeyStringValueIgnoreCaseMultivaluedMap;
-
-/**
- * In-bound HTTP headers.
- * <p>
- * Such HTTP headers will be associated with the in-bound HTTP request on the
- * server-side and the in-bound HTTP response on the client-side.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class InBoundHeaders
- extends StringKeyStringValueIgnoreCaseMultivaluedMap {
-
- public InBoundHeaders() {
- super();
- }
-
- public InBoundHeaders(InBoundHeaders that) {
- super(that);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LanguageTag.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LanguageTag.java
deleted file mode 100644
index f56b3bb6d13..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LanguageTag.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-import java.util.Locale;
-
-/**
- * A language tag.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class LanguageTag {
-
- protected String tag;
-
- protected String primaryTag;
-
- protected String subTags;
-
- protected LanguageTag() {
- }
-
- public static LanguageTag valueOf(String s) throws IllegalArgumentException {
- LanguageTag lt = new LanguageTag();
-
- try {
- lt.parse(s);
- } catch (ParseException pe) {
- throw new IllegalArgumentException(pe);
- }
-
- return lt;
- }
-
- public LanguageTag(String primaryTag, String subTags) {
- if (subTags != null && subTags.length() > 0)
- this.tag = primaryTag + "-" + subTags;
- else
- this.tag = primaryTag;
-
- this.primaryTag = primaryTag;
-
- this.subTags = subTags;
- }
-
- public LanguageTag(String header) throws ParseException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public LanguageTag(HttpHeaderReader reader) throws ParseException {
- // Skip any white space
- reader.hasNext();
-
- tag = reader.nextToken();
-
- if (reader.hasNext())
- throw new ParseException("Invalid Language tag", reader.getIndex());
-
- parse(tag);
- }
-
- public final boolean isCompatible(Locale tag) {
- if (this.tag.equals("*"))
- return true;
-
- if (subTags == null) {
- return primaryTag.equalsIgnoreCase(tag.getLanguage());
- } else {
- return primaryTag.equalsIgnoreCase(tag.getLanguage()) &&
- subTags.equalsIgnoreCase(tag.getCountry());
- }
- }
-
- public final Locale getAsLocale() {
- return (subTags == null)
- ? new Locale(primaryTag)
- : new Locale(primaryTag, subTags);
- }
-
- protected final void parse(String languageTag) throws ParseException {
- if (!isValid(languageTag)) {
- throw new ParseException("String, " + languageTag + ", is not a valid language tag", 0);
- }
-
- int index = languageTag.indexOf('-');
- if (index == -1) {
- primaryTag = languageTag;
- subTags = null;
- } else {
- primaryTag = languageTag.substring(0, index);
- subTags = languageTag.substring(index + 1, languageTag.length());
- }
- }
-
- private boolean isValid(String tag) {
- int alphaCount = 0;
- for (int i = 0; i < tag.length(); i++) {
- final char c = tag.charAt(i);
- if (c == '-') {
- if (alphaCount == 0)
- return false;
- alphaCount = 0;
- } else if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) {
- alphaCount++;
- if (alphaCount > 8)
- return false;
- } else {
- return false;
- }
- }
- return (alphaCount != 0);
- }
-
- public final String getTag() {
- return tag;
- }
-
- public final String getPrimaryTag() {
- return primaryTag;
- }
-
- public final String getSubTags() {
- return subTags;
- }
-
- @Override
- public boolean equals(Object object) {
- if(object instanceof LanguageTag) {
- LanguageTag lt = (LanguageTag)object;
-
- if(this.tag != null)
- if(!this.tag.equals(lt.getTag()))
- return false;
- else
- if(lt.getTag() != null)
- return false;
-
- if(this.primaryTag != null)
- if(!this.primaryTag.equals(lt.getPrimaryTag()))
- return false;
- else
- if(lt.getPrimaryTag() != null)
- return false;
-
- if(this.subTags != null)
- if(!this.subTags.equals(lt.getSubTags()))
- return false;
- else
- if(lt.getSubTags() != null)
- return false;
-
- return true;
- } else {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return (tag == null ? 0 : tag.hashCode()) +
- (primaryTag == null ? 0 : primaryTag.hashCode()) +
- (subTags == null ? 0 : primaryTag.hashCode());
- }
-
- @Override
- public String toString() {
- return primaryTag + (subTags == null ? "" : subTags);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeader.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeader.java
deleted file mode 100644
index 164ee152b7d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeader.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.core.header.reader.HttpHeaderReader.Event;
-import com.sun.jersey.core.impl.provider.header.WriterUtil;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import java.net.URI;
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Set;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * A Link header.
- *
- * @author Santiago.PericasGeertsen@sun.com
- * @author Paul.Sandoz@sun.com
- */
-public class LinkHeader {
-
- private URI uri;
-
- private Set<String> rels;
-
- private MediaType type;
-
- private MultivaluedMap<String, String> parameters;
-
- public LinkHeader(String header) throws ParseException, IllegalArgumentException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public LinkHeader(HttpHeaderReader reader) throws ParseException, IllegalArgumentException {
- uri = URI.create(reader.nextSeparatedString('<', '>'));
-
- if (reader.hasNext())
- parseParameters(reader);
- }
-
- protected LinkHeader(LinkHeaderBuilder builder) {
- this.uri = builder.uri;
-
- if (builder.rels != null) {
- if (builder.rels.size() == 1) {
- this.rels = builder.rels;
- } else {
- this.rels = Collections.unmodifiableSet(new HashSet<String>(builder.rels));
- }
- }
-
- this.type = builder.type;
-
- if (builder.parameters != null) {
- this.parameters = new MultivaluedMapImpl(builder.parameters);
- }
- }
-
- public static LinkHeader valueOf(String header) throws IllegalArgumentException {
- try {
- return new LinkHeader(HttpHeaderReader.newInstance(header));
- } catch (ParseException ex) {
- throw new IllegalArgumentException(ex);
- }
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
-
- sb.append('<').append(uri.toASCIIString()).append('>');
-
- if (rels != null) {
- sb.append(';').append("rel=");
- if (rels.size() == 1) {
- sb.append(rels.iterator().next());
- } else {
- sb.append('\"');
- boolean first = true;
- for (String rel : rels) {
- if (!first)
- sb.append(' ');
- sb.append(rel);
- first = false;
- }
- sb.append('\"');
- }
- }
-
- if (type != null) {
- sb.append(';').append("type=").
- append(type.getType()).append('/').append(type.getSubtype());
- }
-
- if (parameters != null) {
- for (Entry<String, List<String>> e : parameters.entrySet()) {
- String key = e.getKey();
- List<String> values = e.getValue();
-
- if (key.equals("anchor") || key.equals("title")) {
- sb.append(";").append(key).append("=");
- WriterUtil.appendQuoted(sb, values.get(0));
- } else if (key.equals("hreflang")) {
- for (String value : e.getValue()) {
- sb.append(";").append(e.getKey()).append("=").
- append(value);
- }
- } else {
- for (String value : e.getValue()) {
- sb.append(";").append(e.getKey()).append("=");
- WriterUtil.appendQuoted(sb, value);
- }
- }
- }
- }
-
- return sb.toString();
- }
-
- public MultivaluedMap<String, String> getParams() {
- checkNull();
- return parameters;
- }
-
- public URI getUri() {
- return uri;
- }
-
- public Set<String> getRel() {
- if (rels == null) {
- rels = Collections.emptySet();
- }
- return rels;
- }
-
- public MediaType getType() {
- return type;
- }
-
- public String getOp() {
- if (parameters != null) {
- return parameters.getFirst("op");
- } else {
- return null;
- }
- }
-
- private void parseParameters(HttpHeaderReader reader) throws ParseException {
- while (reader.hasNext()) {
- reader.nextSeparator(';');
- while(reader.hasNextSeparator(';', true))
- reader.next();
-
- // Ignore a ';' with no parameters
- if (!reader.hasNext())
- break;
-
- // Get the parameter name
- String name = reader.nextToken().toLowerCase();
- reader.nextSeparator('=');
-
- if (name.equals("rel")) {
- String value = reader.nextTokenOrQuotedString();
- if (reader.getEvent() == Event.Token) {
- rels = Collections.singleton(value);
- } else {
- String[] values = value.split(" ");
- rels = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(values)));
- }
- } else if (name.equals("hreflang")) {
- add(name, reader.nextTokenOrQuotedString());
- } else if (name.equals("media")) {
- if (!containsKey("media")) {
- add(name, reader.nextTokenOrQuotedString());
- }
- } else if (name.equals("title")) {
- if (!containsKey("title")) {
- add(name, reader.nextQuotedString());
- }
- } else if (name.equals("title*")) {
- add(name, reader.nextQuotedString());
- } else if (name.equals("type")) {
- String typeName = reader.nextToken();
- reader.nextSeparator('/');
- String subTypeName = reader.nextToken();
- type = new MediaType(typeName, subTypeName);
- } else {
- add(name, reader.nextTokenOrQuotedString());
- }
-
- // Get the parameter value
- }
- }
-
- private void checkNull() {
- if (parameters == null)
- parameters = new MultivaluedMapImpl();
- }
-
- private boolean containsKey(String key) {
- checkNull();
- return parameters.containsKey(key);
- }
-
- private void add(String key, String value) {
- checkNull();
- parameters.add(key, value);
- }
-
- public static LinkHeaderBuilder uri(URI uri) {
- return new LinkHeaderBuilder(uri);
- }
-
- /**
- * A Link header builder.
- *
- */
- public static class LinkHeaderBuilder<T extends LinkHeaderBuilder, V extends LinkHeader> {
- protected URI uri;
-
- protected Set<String> rels;
-
- protected MediaType type;
-
- protected MultivaluedMap<String, String> parameters;
-
- LinkHeaderBuilder(URI uri) {
- this.uri = uri;
- }
-
- public T rel(String rel) {
- if (rel == null)
- throw new IllegalArgumentException("rel parameter cannot be null");
-
- rel = rel.trim();
- if (rel.length() == 0)
- throw new IllegalArgumentException("rel parameter cannot an empty string or just white space");
-
- if (rels == null) {
- rels = Collections.singleton(rel);
- } else if (rels.size() == 1 && !rels.contains(rel)) {
- rels = new HashSet<String>(rels);
- rels.add(rel);
- } else {
- rels.add(rel);
- }
-
- return (T)this;
- }
-
- public T type(MediaType type) {
- this.type = type;
- return (T)this;
- }
-
- public T op(String op) {
- parameter("op", op);
- return (T)this;
- }
-
- public T parameter(String key, String value) {
- if (key.equals("rel")) {
- return rel(value);
- } else if (key.equals("type")) {
- return type(MediaType.valueOf(value));
- }
-
- if (parameters == null)
- parameters = new MultivaluedMapImpl();
- parameters.add(key, value);
- return (T)this;
- }
-
- public V build() {
- LinkHeader lh = new LinkHeader(this);
- return (V)lh;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeaders.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeaders.java
deleted file mode 100644
index aca76edcdda..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/LinkHeaders.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.header;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * A map of Link headers where each header can be retrieved using the
- * relationship type as the key.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class LinkHeaders {
- private final Map<String, LinkHeader> map;
-
- public LinkHeaders(MultivaluedMap<String, String> headers) throws IllegalArgumentException {
- List<String> ls = headers.get("Link");
- if (ls != null) {
- map = new HashMap<String, LinkHeader>();
- for (String l : ls) {
- LinkHeader lh = LinkHeader.valueOf(l);
- for (String rel : lh.getRel()) {
- map.put(rel, lh);
- }
- }
- } else {
- map = Collections.emptyMap();
- }
- }
-
- public LinkHeader getLink(String rel) throws IllegalArgumentException {
- return map.get(rel);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/MatchingEntityTag.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/MatchingEntityTag.java
deleted file mode 100644
index c44d3539dfc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/MatchingEntityTag.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.core.header.reader.HttpHeaderReader.Event;
-import java.text.ParseException;
-import java.util.Collections;
-import java.util.Set;
-import javax.ws.rs.core.EntityTag;
-
-/**
- * A matching entity tag.
- * <p>
- * Note that this type and it's super type cannot be used to create request
- * header values for <code>If-Match</code> and <code>If-None-Match</code>
- * of the form <code>If-Match: *</code> or <code>If-None-Match: *</code> as
- * <code>*</code> is not a valid entity tag.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class MatchingEntityTag extends EntityTag {
-
- /**
- * An empty set that corresponds to <code>If-Match: *</code> or
- * <code>If-None-Match: *</code>.
- */
- public static final Set<MatchingEntityTag> ANY_MATCH = Collections.emptySet();
-
- public MatchingEntityTag(String value) {
- super(value, false);
- }
-
- public MatchingEntityTag(String value, boolean weak) {
- super(value, weak);
- }
-
- public static MatchingEntityTag valueOf(HttpHeaderReader reader) throws ParseException {
- Event e = reader.next(false);
- if (e == Event.QuotedString) {
- return new MatchingEntityTag(reader.getEventValue());
- } else if (e == Event.Token) {
- String v = reader.getEventValue();
- if (v.equals("W")) {
- reader.nextSeparator('/');
- return new MatchingEntityTag(reader.nextQuotedString(), true);
- }
- }
-
- throw new ParseException("Error parsing entity tag", reader.getIndex());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/MediaTypes.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/MediaTypes.java
deleted file mode 100644
index 75dc60df207..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/MediaTypes.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Common media types and functonality.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class MediaTypes {
- private MediaTypes() { }
-
- public final static MediaType WADL =
- MediaType.valueOf("application/vnd.sun.wadl+xml");
-
- public final static MediaType FAST_INFOSET =
- MediaType.valueOf("application/fastinfoset");
-
- public final static boolean typeEquals(MediaType m1, MediaType m2) {
- if (m1 == null || m2 == null)
- return false;
-
- return m1.getSubtype().equalsIgnoreCase(m2.getSubtype()) && m1.getType().equalsIgnoreCase(m2.getType());
- }
-
- public final static boolean intersects(List<? extends MediaType> ml1, List<? extends MediaType> ml2) {
- for (MediaType m1: ml1) {
- for (MediaType m2 : ml2) {
- if (MediaTypes.typeEquals(m1, m2))
- return true;
- }
- }
- return false;
- }
-
- /**
- * Comparator for media types.
- * <p>
- * x/y < x/* < *\\/*
- */
- public static final Comparator<MediaType> MEDIA_TYPE_COMPARATOR = new Comparator<MediaType>() {
- public int compare(MediaType o1, MediaType o2) {
- if (o1.getType().equals("*") && !o2.getType().equals("*")) {
- return 1;
- }
-
- if (o2.getType().equals("*") && !o1.getType().equals("*")) {
- return -1;
- }
-
- if (o1.getSubtype().equals("*") && !o2.getSubtype().equals("*")) {
- return 1;
- }
-
- if (o2.getSubtype().equals("*") && !o1.getSubtype().equals("*")) {
- return -1;
- }
-
- return 0;
- }
- };
-
- /**
- * Get the most specific media type from a pair of media types. The most
- * specific media type is the media type from the pair that has least
- * wild cards present.
- *
- * @param m1 the first media type
- * @param m2 the second media type
- * @return the most specific media type. If the media types are equally
- * specific then the first media type is returned.
- */
- public static final MediaType mostSpecific(MediaType m1, MediaType m2) {
- if (m1.isWildcardSubtype() && !m2.isWildcardSubtype())
- return m2;
- if (m1.isWildcardType() && !m2.isWildcardType())
- return m2;
- return m1;
- }
-
- /**
- * Comparator for lists of media types.
- * <p>
- * The least specific content type of each list is obtained and then compared
- * using {@link #MEDIA_TYPE_COMPARATOR}.
- * <p>
- * Assumes each list is already ordered according to {@link #MEDIA_TYPE_COMPARATOR}
- * and therefore the least specific media type is at the end of the list.
- */
- public static final Comparator<List<? extends MediaType>> MEDIA_TYPE_LIST_COMPARATOR =
- new Comparator<List<? extends MediaType>>() {
- public int compare(List<? extends MediaType> o1, List<? extends MediaType> o2) {
- return MEDIA_TYPE_COMPARATOR.compare(getLeastSpecific(o1), getLeastSpecific(o2));
- }
-
- public MediaType getLeastSpecific(List<? extends MediaType> l) {
- return l.get(l.size() - 1);
- }
- };
-
- /**
- * The general media type corresponding to *\\/*.
- *
- */
- public static final MediaType GENERAL_MEDIA_TYPE = new MediaType("*", "*");
-
- /**
- * A singleton list containing the general media type.
- */
- public static final List<MediaType> GENERAL_MEDIA_TYPE_LIST =
- createMediaTypeList();
-
- private static List<MediaType> createMediaTypeList() {
- return Collections.singletonList(GENERAL_MEDIA_TYPE);
- }
-
-
- /**
- * The general acceptable media type corresponding to *\\/*.
- *
- */
- public static final AcceptableMediaType GENERAL_ACCEPT_MEDIA_TYPE =
- new AcceptableMediaType("*", "*");
-
- /**
- * A singleton list containing the general acceptable media type.
- */
- public static final List<AcceptableMediaType> GENERAL_ACCEPT_MEDIA_TYPE_LIST =
- createAcceptMediaTypeList();
-
- private static List<AcceptableMediaType> createAcceptMediaTypeList() {
- return Collections.singletonList(GENERAL_ACCEPT_MEDIA_TYPE);
- }
-
- /**
- * Create a list of media type from the {@link Consumes} annotation.
- * <p>
- * @param mime the Consumes annotation.
- * @return the list of {@link MediaType}, ordered according to {@link #MEDIA_TYPE_COMPARATOR}.
- */
- public static List<MediaType> createMediaTypes(Consumes mime) {
- if (mime == null) {
- return GENERAL_MEDIA_TYPE_LIST;
- }
-
- return createMediaTypes(mime.value());
- }
-
- /**
- * Create a list of media type from the Produces annotation.
- * <p>
- * @param mime the Produces annotation.
- * @return the list of {@link MediaType}, ordered according to {@link #MEDIA_TYPE_COMPARATOR}.
- */
- public static List<MediaType> createMediaTypes(Produces mime) {
- if (mime == null) {
- return GENERAL_MEDIA_TYPE_LIST;
- }
-
- return createMediaTypes(mime.value());
- }
-
- /**
- * Create a list of media type from an array of media types.
- * <p>
- * @param mediaTypes the array of meda types.
- * @return the list of {@link MediaType}, ordered according to {@link #MEDIA_TYPE_COMPARATOR}.
- */
- public static List<MediaType> createMediaTypes(String[] mediaTypes) {
- List<MediaType> l = new ArrayList<MediaType>();
- try {
- for (String mediaType : mediaTypes) {
- HttpHeaderReader.readMediaTypes(l, mediaType);
- }
-
- Collections.sort(l, MEDIA_TYPE_COMPARATOR);
- return l;
- } catch (ParseException ex) {
- throw new IllegalArgumentException(ex);
- }
- }
-
- /**
- * Comparator for lists of quality source media types.
- */
- public static final Comparator<QualitySourceMediaType> QUALITY_SOURCE_MEDIA_TYPE_COMPARATOR
- = new Comparator<QualitySourceMediaType>() {
- public int compare(QualitySourceMediaType o1, QualitySourceMediaType o2) {
- int i = o2.getQualitySource() - o1.getQualitySource();
- if (i != 0)
- return i;
-
- return MediaTypes.MEDIA_TYPE_COMPARATOR.compare(o1, o2);
- }
- };
-
- /**
- * A singleton list containing the general media type.
- */
- public static final List<MediaType> GENERAL_QUALITY_SOURCE_MEDIA_TYPE_LIST =
- createQualitySourceMediaTypeList();
-
- private static List<MediaType> createQualitySourceMediaTypeList() {
- return Collections.<MediaType>singletonList(new QualitySourceMediaType("*", "*"));
- }
-
- /**
- * Create a list of quality source media type from the Produces annotation.
- * <p>
- * @param mime the Produces annotation.
- * @return the list of {@link QualitySourceMediaType}, ordered according to
- * {@link #QUALITY_SOURCE_MEDIA_TYPE_COMPARATOR}.
- */
- public static List<MediaType> createQualitySourceMediaTypes(Produces mime) {
- if (mime == null) {
- return GENERAL_QUALITY_SOURCE_MEDIA_TYPE_LIST;
- }
-
- return new ArrayList<MediaType>(createQualitySourceMediaTypes(mime.value()));
- }
-
- /**
- * Create a list of quality source media type from an array of media types.
- * <p>
- * @param mediaTypes the array of meda types.
- * @return the list of {@link QualitySourceMediaType}, ordered according to
- * the quality source as the primary key and {@link #MEDIA_TYPE_COMPARATOR}
- * as the secondary key.
- */
- public static List<QualitySourceMediaType> createQualitySourceMediaTypes(String[] mediaTypes) {
- try {
- return HttpHeaderReader.readQualitySourceMediaType(mediaTypes);
- } catch (ParseException ex) {
- throw new IllegalArgumentException(ex);
- }
- }
-
- private static Map<String, MediaType> mediaTypeCache = new HashMap<String, MediaType>() {
- {
- put("application", new MediaType("application", MediaType.MEDIA_TYPE_WILDCARD));
- put("multipart", new MediaType("multipart", MediaType.MEDIA_TYPE_WILDCARD));
- put("text", new MediaType("text", MediaType.MEDIA_TYPE_WILDCARD));
- }
- };
-
- /**
- * Returns MediaType with wildcard in subtype.
- *
- * @param mediaType original MediaType.
- * @return MediaType with wildcard in subtype.
- */
- public static MediaType getTypeWildCart(MediaType mediaType) {
- MediaType mt = mediaTypeCache.get(mediaType.getType());
-
- if(mt == null) {
- mt = new MediaType(mediaType.getType(), MediaType.MEDIA_TYPE_WILDCARD);
- }
-
- return mt;
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/OutBoundHeaders.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/OutBoundHeaders.java
deleted file mode 100644
index 64050702eb1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/OutBoundHeaders.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.util.StringKeyObjectValueIgnoreCaseMultivaluedMap;
-
-/**
- * Out-bound HTTP headers.
- * <p>
- * Such HTTP headers will be associated with the out-bound HTTP request on the
- * client-side and the out-bound HTTP response on the server-side.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class OutBoundHeaders
- extends StringKeyObjectValueIgnoreCaseMultivaluedMap {
- public OutBoundHeaders() {
- super();
- }
-
- public OutBoundHeaders(OutBoundHeaders that) {
- super(that);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/ParameterizedHeader.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/ParameterizedHeader.java
deleted file mode 100644
index 79f40394473..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/ParameterizedHeader.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * A general parameterized header.
- * <p>
- * The header consists of a value and zero or more parameters. A value consists
- * of zero or more tokens and separators up to but not including a ';' separator
- * if present. The tokens and seaprators of a value may be separated by zero or
- * more white space, which is ignored and is not considered part of the value.
- * The value is separated from the parameters with a ';'. Each parameter is
- * separated with a ';'.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ParameterizedHeader {
- private String value;
-
- private Map<String, String> parameters;
-
- public ParameterizedHeader(String header) throws ParseException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public ParameterizedHeader(HttpHeaderReader reader) throws ParseException {
- reader.hasNext();
-
- value = "";
- while (reader.hasNext() && !reader.hasNextSeparator(';', false)) {
- reader.next();
- value += reader.getEventValue();
- }
-
- if (reader.hasNext())
- parameters = HttpHeaderReader.readParameters(reader);
- if (parameters == null)
- parameters = Collections.emptyMap();
- else
- parameters = Collections.unmodifiableMap(parameters);
- }
-
- /**
- * Get the value.
- *
- * @return the value.
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Get the parameters.
- *
- * @return the parameters
- */
- public Map<String, String> getParameters() {
- return parameters;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualityFactor.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualityFactor.java
deleted file mode 100644
index 4137a156120..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualityFactor.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-/**
- * Quality factor for acceptable header types.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface QualityFactor {
- static final String QUALITY_FACTOR = "q";
-
- static final int MINUMUM_QUALITY = 0;
-
- static final int MAXIMUM_QUALITY = 1000;
-
- static final int DEFAULT_QUALITY_FACTOR = MAXIMUM_QUALITY;
-
- int getQuality();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualitySourceMediaType.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualitySourceMediaType.java
deleted file mode 100644
index afbee2d5a9f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/QualitySourceMediaType.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-import javax.ws.rs.core.MediaType;
-import java.util.Map;
-
-/**
- * An quality source media type.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class QualitySourceMediaType extends MediaType {
-
- public static final String QUALITY_SOURCE_FACTOR = "qs";
-
- public static final int DEFAULT_QUALITY_SOURCE_FACTOR = 1000;
-
- private final int qs;
-
- public QualitySourceMediaType(String p, String s) {
- super(p, s);
- qs = DEFAULT_QUALITY_SOURCE_FACTOR;
- }
-
- public QualitySourceMediaType(String p, String s, int qs, Map<String, String> parameters) {
- super(p, s, parameters);
- this.qs = qs;
- }
-
- public QualitySourceMediaType(MediaType mt) {
- this(mt.getType(), mt.getSubtype(), getQs(mt), mt.getParameters());
- }
-
- public int getQualitySource() {
- return qs;
- }
-
- public static QualitySourceMediaType valueOf(HttpHeaderReader reader) throws ParseException {
- // Skip any white space
- reader.hasNext();
-
- // Get the type
- String type = reader.nextToken();
- reader.nextSeparator('/');
- // Get the subtype
- String subType = reader.nextToken();
-
- int qs = DEFAULT_QUALITY_SOURCE_FACTOR;
- Map<String, String> parameters = null;
- if (reader.hasNext()) {
- parameters = HttpHeaderReader.readParameters(reader);
- if (parameters != null) {
- qs = getQs(parameters.get(QUALITY_SOURCE_FACTOR));
- }
- }
-
- return new QualitySourceMediaType(type, subType, qs, parameters);
- }
-
- public static int getQualitySource(MediaType mt) {
- if (mt instanceof QualitySourceMediaType) {
- QualitySourceMediaType qsmt = (QualitySourceMediaType)mt;
- return qsmt.getQualitySource();
- } else {
- return getQs(mt);
- }
- }
-
- private static int getQs(MediaType mt) {
- try {
- return getQs(mt.getParameters().get(QUALITY_SOURCE_FACTOR));
- } catch (ParseException ex) {
- throw new IllegalArgumentException(ex);
- }
- }
-
- private static int getQs(String v) throws ParseException {
- if (v == null)
- return DEFAULT_QUALITY_SOURCE_FACTOR;
-
- try {
- final int qs = (int)(Float.valueOf(v) * 1000.0);
- if (qs < 0)
- throw new ParseException("The quality source (qs) value, " + v + ", must be non-negative number", 0);
- return qs;
- } catch (NumberFormatException ex) {
- ParseException pe = new ParseException("The quality source (qs) value, " + v + ", is not a valid value", 0);
- pe.initCause(ex);
- throw pe;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/Token.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/Token.java
deleted file mode 100644
index 50e4bad6a1c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/Token.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.text.ParseException;
-
-/**
- * A token.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class Token {
- protected String token;
-
- protected Token() {
- }
-
- public Token(String header) throws ParseException {
- this(HttpHeaderReader.newInstance(header));
- }
-
- public Token(HttpHeaderReader reader) throws ParseException {
- // Skip any white space
- reader.hasNext();
-
- token = reader.nextToken();
-
- if (reader.hasNext())
- throw new ParseException("Invalid token", reader.getIndex());
- }
-
- public String getToken() {
- return token;
- }
-
- public final boolean isCompatible(String token) {
- if (this.token.equals("*"))
- return true;
-
- return this.token.equals(token);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/package-info.java
deleted file mode 100644
index e95e0e61158..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for HTTP headers.
- */
-package com.sun.jersey.core.header;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/CookiesParser.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/CookiesParser.java
deleted file mode 100644
index 20ed8f34fcc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/CookiesParser.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header.reader;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.NewCookie;
-
-/**
- * TODO use the HttpHeaderReader
- *
- * @author Marc.Hadley@Sun.Com
- */
-/* package */ class CookiesParser {
- private static class MutableCookie {
- String name;
- String value;
- int version = Cookie.DEFAULT_VERSION;
- String path = null;
- String domain = null;
-
- public MutableCookie(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public Cookie getImmutableCookie() {
- return new Cookie(name, value, path, domain, version);
- }
- }
-
- public static Map<String, Cookie> parseCookies(String header) {
- String bites[] = header.split("[;,]");
- Map<String, Cookie> cookies = new LinkedHashMap<String, Cookie>();
- int version = 0;
- MutableCookie cookie = null;
- for (String bite: bites) {
- String crumbs[] = bite.split("=", 2);
- String name = crumbs.length>0 ? crumbs[0].trim() : "";
- String value = crumbs.length>1 ? crumbs[1].trim() : "";
- if (value.startsWith("\"") && value.endsWith("\"") && value.length()>1)
- value = value.substring(1,value.length()-1);
- if (!name.startsWith("$")) {
- if (cookie != null)
- cookies.put(cookie.name, cookie.getImmutableCookie());
-
- cookie = new MutableCookie(name, value);
- cookie.version = version;
- }
- else if (name.startsWith("$Version"))
- version = Integer.parseInt(value);
- else if (name.startsWith("$Path") && cookie!=null)
- cookie.path = value;
- else if (name.startsWith("$Domain") && cookie!=null)
- cookie.domain = value;
- }
- if (cookie != null)
- cookies.put(cookie.name, cookie.getImmutableCookie());
- return cookies;
- }
-
- public static Cookie parseCookie(String header) {
- Map<String, Cookie> cookies = parseCookies(header);
- return cookies.entrySet().iterator().next().getValue();
- }
-
- private static class MutableNewCookie {
- String name = null;
- String value = null;
- String path = null;
- String domain = null;
- int version = Cookie.DEFAULT_VERSION;
- String comment = null;
- int maxAge = NewCookie.DEFAULT_MAX_AGE;
- boolean secure = false;
-
- public MutableNewCookie(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public NewCookie getImmutableNewCookie() {
- return new NewCookie(name, value, path, domain, version, comment, maxAge, secure);
- }
- }
-
- public static NewCookie parseNewCookie(String header) {
- String bites[] = header.split("[;,]");
-
- MutableNewCookie cookie = null;
- for (String bite: bites) {
- String crumbs[] = bite.split("=", 2);
- String name = crumbs.length>0 ? crumbs[0].trim() : "";
- String value = crumbs.length>1 ? crumbs[1].trim() : "";
- if (value.startsWith("\"") && value.endsWith("\"") && value.length()>1)
- value = value.substring(1,value.length()-1);
-
- if (cookie == null)
- cookie = new MutableNewCookie(name, value);
- else if (name.startsWith("Comment"))
- cookie.comment = value;
- else if (name.startsWith("Domain"))
- cookie.domain = value;
- else if (name.startsWith("Max-Age"))
- cookie.maxAge = Integer.parseInt(value);
- else if (name.startsWith("Path"))
- cookie.path = value;
- else if (name.startsWith("Secure"))
- cookie.secure = true;
- else if (name.startsWith("Version"))
- cookie.version = Integer.parseInt(value);
- else if (name.startsWith("Domain"))
- cookie.domain = value;
- }
-
- return cookie.getImmutableNewCookie();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.java
deleted file mode 100644
index 4945d687591..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header.reader;
-
-import java.text.ParseException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-/* package */ class HttpHeaderListAdapter extends HttpHeaderReader {
- private HttpHeaderReader reader;
-
- boolean isTerminated;
-
- public HttpHeaderListAdapter(HttpHeaderReader reader) {
- this.reader = reader;
- }
-
- public void reset() {
- isTerminated = false;
- }
-
-
- public boolean hasNext() {
- if (isTerminated)
- return false;
-
- if (reader.hasNext()) {
- if (reader.hasNextSeparator(',', true)) {
- isTerminated = true;
- return false;
- } else
- return true;
- }
-
- return false;
- }
-
- public boolean hasNextSeparator(char separator, boolean skipWhiteSpace) {
- if (isTerminated)
- return false;
-
- if (reader.hasNextSeparator(',', skipWhiteSpace)) {
- isTerminated = true;
- return false;
- } else
- return reader.hasNextSeparator(separator, skipWhiteSpace);
- }
-
- public Event next() throws ParseException {
- return next(true);
- }
-
- public HttpHeaderReader.Event next(boolean skipWhiteSpace) throws ParseException {
- if (isTerminated)
- throw new ParseException("End of header", getIndex());
-
- if (reader.hasNextSeparator(',', skipWhiteSpace)) {
- isTerminated = true;
- throw new ParseException("End of header", getIndex());
- }
-
- return reader.next(skipWhiteSpace);
- }
-
- public String nextSeparatedString(char startSeparator, char endSeparator) throws ParseException {
- if (isTerminated)
- throw new ParseException("End of header", getIndex());
-
- if (reader.hasNextSeparator(',', true)) {
- isTerminated = true;
- throw new ParseException("End of header", getIndex());
- }
-
- return reader.nextSeparatedString(startSeparator, endSeparator);
- }
-
- public HttpHeaderReader.Event getEvent() {
- return reader.getEvent();
- }
-
- public String getEventValue() {
- return reader.getEventValue();
- }
-
- public String getRemainder() {
- return reader.getRemainder();
- }
-
- public int getIndex() {
- return reader.getIndex();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReader.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReader.java
deleted file mode 100644
index ffefee07705..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReader.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.header.reader;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.header.AcceptableLanguageTag;
-import com.sun.jersey.core.header.AcceptableMediaType;
-import com.sun.jersey.core.header.AcceptableToken;
-import com.sun.jersey.core.header.HttpDateFormat;
-import com.sun.jersey.core.header.MatchingEntityTag;
-import com.sun.jersey.core.header.QualityFactor;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.core.impl.provider.header.MediaTypeProvider;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.NewCookie;
-
-/**
- * A pull-based reader of HTTP headers.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class HttpHeaderReader {
-
- public enum Event {
- Token, QuotedString, Comment, Separator, Control
- }
-
- public abstract boolean hasNext();
-
- public abstract boolean hasNextSeparator(char separator, boolean skipWhiteSpace);
-
- public abstract Event next() throws ParseException;
-
- public abstract Event next(boolean skipWhiteSpace) throws ParseException;
-
- public abstract String nextSeparatedString(char startSeparator, char endSeparator) throws ParseException;
-
- public abstract Event getEvent();
-
- public abstract String getEventValue();
-
- public abstract String getRemainder();
-
- public abstract int getIndex();
-
- public String nextToken() throws ParseException {
- Event e = next(false);
- if (e != Event.Token)
- throw new ParseException("Next event is not a Token", getIndex());
-
- return getEventValue();
- }
-
- public char nextSeparator() throws ParseException {
- Event e = next(false);
- if (e != Event.Separator)
- throw new ParseException("Next event is not a Separator", getIndex());
-
- return getEventValue().charAt(0);
- }
-
- public void nextSeparator(char c) throws ParseException {
- Event e = next(false);
- if (e != Event.Separator)
- throw new ParseException("Next event is not a Separator", getIndex());
-
- if (c != getEventValue().charAt(0)) {
- throw new ParseException("Expected separator '" + c + "' instead of '"
- + getEventValue().charAt(0) + "'", getIndex());
- }
- }
-
- public String nextQuotedString() throws ParseException {
- Event e = next(false);
- if (e != Event.QuotedString)
- throw new ParseException("Next event is not a Quoted String", getIndex());
-
- return getEventValue();
- }
-
- public String nextTokenOrQuotedString() throws ParseException {
- Event e = next(false);
- if (e != Event.Token && e != Event.QuotedString)
- throw new ParseException("Next event is not a Token or a Quoted String, " +
- getEventValue(), getIndex());
-
- return getEventValue();
- }
-
-
-
-
- public static HttpHeaderReader newInstance(String header) {
- return new HttpHeaderReaderImpl(header);
- }
-
- public static HttpHeaderReader newInstance(String header, boolean processComments) {
- return new HttpHeaderReaderImpl(header, processComments);
- }
-
-
- public static Date readDate(String date) throws ParseException {
- return HttpDateFormat.readDate(date);
- }
-
-
- public static int readQualityFactor(String q) throws ParseException {
- if (q == null || q.length() == 0)
- throw new ParseException("Quality value cannot be null or an empty String", 0);
-
- int index = 0;
- final int length = q.length();
- if (length > 5) {
- throw new ParseException("Quality value is greater than the maximum length, 5", 0);
- }
-
- // Parse the whole number and decimal point
- final char wholeNumber;
- char c = wholeNumber = q.charAt(index++);
- if (c == '0' || c == '1') {
- if (index == length)
- return (c - '0') * 1000;
- c = q.charAt(index++);
- if (c != '.') {
- throw new ParseException("Error parsing Quality value: a decimal place is expected rather than '" +
- c + "'", index);
- }
- if (index == length)
- return (c - '0') * 1000;
- } else if (c == '.') {
- // This is not conformant to the HTTP specification but some implementations
- // do this, for example HttpURLConnection.
- if (index == length)
- throw new ParseException("Error parsing Quality value: a decimal numeral is expected after the decimal point", index);
-
- } else {
- throw new ParseException("Error parsing Quality value: a decimal numeral '0' or '1' is expected rather than '" +
- c + "'", index);
- }
-
- // Parse the fraction
- int value = 0;
- int exponent = 100;
- while (index < length) {
- c = q.charAt(index++);
- if (c >= '0' && c <= '9') {
- value += (c - '0') * exponent;
- exponent /= 10;
- } else {
- throw new ParseException("Error parsing Quality value: a decimal numeral is expected rather than '" +
- c + "'", index);
- }
- }
-
- if (wholeNumber == '1') {
- if (value > 0)
- throw new ParseException("The Quality value, " + q + ", is greater than 1", index);
- return QualityFactor.DEFAULT_QUALITY_FACTOR;
- } else
- return value;
- }
-
- public static int readQualityFactorParameter(HttpHeaderReader reader) throws ParseException {
- int q = -1;
- while (reader.hasNext()) {
- reader.nextSeparator(';');
-
- // Ignore a ';' with no parameters
- if (!reader.hasNext())
- return QualityFactor.DEFAULT_QUALITY_FACTOR;
-
- // Get the parameter name
- String name = reader.nextToken();
- reader.nextSeparator('=');
- // Get the parameter value
- String value = reader.nextTokenOrQuotedString();
-
- if (q == -1 && name.equalsIgnoreCase(QualityFactor.QUALITY_FACTOR)) {
- q = readQualityFactor(value);
- }
- }
-
- return (q == -1) ? QualityFactor.DEFAULT_QUALITY_FACTOR : q;
- }
-
- public static Map<String, String> readParameters(HttpHeaderReader reader) throws ParseException {
- Map<String, String> m = null;
-
- while (reader.hasNext()) {
- reader.nextSeparator(';');
- while(reader.hasNextSeparator(';', true))
- reader.next();
-
- // Ignore a ';' with no parameters
- if (!reader.hasNext())
- break;
-
- // Get the parameter name
- String name = reader.nextToken();
- reader.nextSeparator('=');
- // Get the parameter value
- String value = reader.nextTokenOrQuotedString();
-
- if (m == null)
- m = new LinkedHashMap<String, String>();
-
- // Lower case the parameter name
- m.put(name.toLowerCase(), value);
- }
-
- return m;
- }
-
- public static Map<String, Cookie> readCookies(String header) {
- return CookiesParser.parseCookies(header);
- }
-
- public static Cookie readCookie(String header) {
- return CookiesParser.parseCookie(header);
- }
-
- public static NewCookie readNewCookie(String header) {
- return CookiesParser.parseNewCookie(header);
- }
-
-
- private static final ListElementCreator<MatchingEntityTag> MATCHING_ENTITY_TAG_CREATOR =
- new ListElementCreator<MatchingEntityTag>() {
- public MatchingEntityTag create(HttpHeaderReader reader) throws ParseException {
- return MatchingEntityTag.valueOf(reader);
- }
- };
-
- public static Set<MatchingEntityTag> readMatchingEntityTag(String header) throws ParseException {
- if (header.equals("*"))
- return MatchingEntityTag.ANY_MATCH;
-
- HttpHeaderReader reader = new HttpHeaderReaderImpl(header);
- Set<MatchingEntityTag> l = new HashSet<MatchingEntityTag>(1);
- HttpHeaderListAdapter adapter = new HttpHeaderListAdapter(reader);
- while(reader.hasNext()) {
- l.add(MATCHING_ENTITY_TAG_CREATOR.create(adapter));
- adapter.reset();
- if (reader.hasNext())
- reader.next();
- }
-
- return l;
- }
-
-
- private static final ListElementCreator<MediaType> MEDIA_TYPE_CREATOR =
- new ListElementCreator<MediaType>() {
- public MediaType create(HttpHeaderReader reader) throws ParseException {
- return MediaTypeProvider.valueOf(reader);
- }
- };
-
- public static List<MediaType> readMediaTypes(List<MediaType> l, String header) throws ParseException {
- return HttpHeaderReader.readList(
- l,
- MEDIA_TYPE_CREATOR,
- header);
- }
-
- private static final ListElementCreator<AcceptableMediaType> ACCEPTABLE_MEDIA_TYPE_CREATOR =
- new ListElementCreator<AcceptableMediaType>() {
- public AcceptableMediaType create(HttpHeaderReader reader) throws ParseException {
- return AcceptableMediaType.valueOf(reader);
- }
- };
-
- private static final Comparator<AcceptableMediaType> ACCEPTABLE_MEDIA_TYPE_COMPARATOR
- = new Comparator<AcceptableMediaType>() {
- public int compare(AcceptableMediaType o1, AcceptableMediaType o2) {
- int i = o2.getQuality() - o1.getQuality();
- if (i != 0)
- return i;
-
- return MediaTypes.MEDIA_TYPE_COMPARATOR.compare(o1, o2);
- }
- };
-
- public static List<AcceptableMediaType> readAcceptMediaType(String header) throws ParseException {
- return HttpHeaderReader.readAcceptableList(
- ACCEPTABLE_MEDIA_TYPE_COMPARATOR,
- ACCEPTABLE_MEDIA_TYPE_CREATOR,
- header);
- }
-
-
- private static final ListElementCreator<QualitySourceMediaType> QUALITY_SOURCE_MEDIA_TYPE_CREATOR =
- new ListElementCreator<QualitySourceMediaType>() {
- public QualitySourceMediaType create(HttpHeaderReader reader) throws ParseException {
- return QualitySourceMediaType.valueOf(reader);
- }
- };
-
- public static List<QualitySourceMediaType> readQualitySourceMediaType(String header) throws ParseException {
- return HttpHeaderReader.readAcceptableList(
- MediaTypes.QUALITY_SOURCE_MEDIA_TYPE_COMPARATOR,
- QUALITY_SOURCE_MEDIA_TYPE_CREATOR,
- header);
- }
-
- public static List<QualitySourceMediaType> readQualitySourceMediaType(String[] header) throws ParseException {
- if (header.length < 2)
- return readQualitySourceMediaType(header[0]);
-
- StringBuffer sb = new StringBuffer();
- for (String h : header) {
- if (sb.length() > 0)
- sb.append(",");
-
- sb.append(h);
- }
-
- return readQualitySourceMediaType(sb.toString());
- }
-
- public static List<AcceptableMediaType> readAcceptMediaType(String header,
- final List<QualitySourceMediaType> priorityMediaTypes) throws ParseException {
- return HttpHeaderReader.readAcceptableList(
- new Comparator<AcceptableMediaType>() {
- public int compare(AcceptableMediaType o1, AcceptableMediaType o2) {
- boolean q_o1_set = false;
- int q_o1 = QualitySourceMediaType.DEFAULT_QUALITY_SOURCE_FACTOR * QualitySourceMediaType.DEFAULT_QUALITY_SOURCE_FACTOR;
- boolean q_o2_set = false;
- int q_o2 = QualitySourceMediaType.DEFAULT_QUALITY_SOURCE_FACTOR * QualitySourceMediaType.DEFAULT_QUALITY_SOURCE_FACTOR;
- for (QualitySourceMediaType m : priorityMediaTypes) {
- if (!q_o1_set && MediaTypes.typeEquals(o1, m)) {
- q_o1 = o1.getQuality() * m.getQualitySource();
- q_o1_set = true;
- } else if (!q_o2_set && MediaTypes.typeEquals(o2, m)) {
- q_o2 = o2.getQuality() * m.getQualitySource();
- q_o2_set = true;
- }
- }
- int i = q_o2 - q_o1;
- if (i != 0)
- return i;
-
- i = o2.getQuality() - o1.getQuality();
- if (i != 0)
- return i;
-
- return MediaTypes.MEDIA_TYPE_COMPARATOR.compare(o1, o2);
- }
- },
- ACCEPTABLE_MEDIA_TYPE_CREATOR,
- header);
- }
-
- private static final ListElementCreator<AcceptableToken> ACCEPTABLE_TOKEN_CREATOR =
- new ListElementCreator<AcceptableToken>() {
- public AcceptableToken create(HttpHeaderReader reader) throws ParseException {
- return new AcceptableToken(reader);
- }
- };
-
- public static List<AcceptableToken> readAcceptToken(String header) throws ParseException {
- return HttpHeaderReader.readAcceptableList(ACCEPTABLE_TOKEN_CREATOR, header);
- }
-
-
- private static final ListElementCreator<AcceptableLanguageTag> LANGUAGE_CREATOR =
- new ListElementCreator<AcceptableLanguageTag>() {
- public AcceptableLanguageTag create(HttpHeaderReader reader) throws ParseException {
- return new AcceptableLanguageTag(reader);
- }
- };
-
- public static List<AcceptableLanguageTag> readAcceptLanguage(String header) throws ParseException {
- return HttpHeaderReader.readAcceptableList(LANGUAGE_CREATOR, header);
- }
-
-
- private static final Comparator<QualityFactor> QUALITY_COMPARATOR = new Comparator<QualityFactor>() {
- public int compare(QualityFactor o1, QualityFactor o2) {
- return o2.getQuality() - o1.getQuality();
- }
- };
-
- public static <T extends QualityFactor> List<T> readAcceptableList(
- ListElementCreator<T> c,
- String header) throws ParseException {
- List<T> l = readList(c, header);
- Collections.sort(l, QUALITY_COMPARATOR);
- return l;
- }
-
- public static <T> List<T> readAcceptableList(
- Comparator<T> comparator,
- ListElementCreator<T> c,
- String header) throws ParseException {
- List<T> l = readList(c, header);
- Collections.sort(l, comparator);
- return l;
- }
-
-
- public static interface ListElementCreator<T> {
- T create(HttpHeaderReader reader) throws ParseException;
- }
-
- public static <T> List<T> readList(ListElementCreator<T> c,
- String header) throws ParseException {
- return readList(new ArrayList<T>(), c, header);
- }
-
- public static <T> List<T> readList(List<T> l, ListElementCreator<T> c,
- String header) throws ParseException {
- HttpHeaderReader reader = new HttpHeaderReaderImpl(header);
- HttpHeaderListAdapter adapter = new HttpHeaderListAdapter(reader);
- while(reader.hasNext()) {
- l.add(c.create(adapter));
- adapter.reset();
- if (reader.hasNext())
- reader.next();
- }
-
- return l;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.java
deleted file mode 100644
index c831feaa109..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.header.reader;
-
-import java.text.ParseException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-/* package */ final class HttpHeaderReaderImpl extends HttpHeaderReader {
-
- private static final int TOKEN = 0;
- private static final int QUOTED_STRING = 1;
- private static final int COMMENT = 2;
- private static final int SEPARATOR = 3;
- private static final int CONTROL = 4;
- private static final char[] WHITE_SPACE = {'\t', '\r', '\n', ' '};
- private static final char[] SEPARATORS = {'(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}', ' ', '\t'};
- private static final int[] EVENT_TABLE = createEventTable();
-
- private static int[] createEventTable() {
- int[] table = new int[128];
-
- // Token
- for (int i = 0; i < 127; i++) {
- table[i] = TOKEN;
- }
-
- // Separator
- for (char c : SEPARATORS) {
- table[c] = SEPARATOR;
- }
-
- // Comment
- table['('] = COMMENT;
-
- // QuotedString
- table['"'] = QUOTED_STRING;
-
- // Control
- for (int i = 0; i < 32; i++) {
- table[i] = CONTROL;
- }
- table[127] = CONTROL;
-
- // White space
- for (char c : WHITE_SPACE) {
- table[c] = -1;
- }
-
- return table;
- }
-
- private static final boolean[] IS_WHITE_SPACE = createWhiteSpaceTable();
-
- private static boolean[] createWhiteSpaceTable() {
- boolean[] table = new boolean[128];
-
- for (char c : WHITE_SPACE) {
- table[c] = true;
- }
-
- return table;
- }
-
- private static final boolean[] IS_TOKEN = createTokenTable();
-
- private static boolean[] createTokenTable() {
- boolean[] table = new boolean[128];
-
- for (int i = 0; i < 128; i++) {
- table[i] = (EVENT_TABLE[i] == TOKEN);
- }
-
- return table;
- }
-
- private String header;
-
- private boolean processComments;
-
- private int index;
-
- private int length;
-
- private Event event;
-
- private String value;
-
- public HttpHeaderReaderImpl(String header, boolean processComments) {
- this.header = (header == null) ? "" : header;
- this.processComments = processComments;
- this.index = 0;
- this.length = this.header.length();
- }
-
- public HttpHeaderReaderImpl(String header) {
- this(header, false);
- }
-
- public boolean hasNext() {
- return skipWhiteSpace();
- }
-
- public boolean hasNextSeparator(char separator, boolean skipWhiteSpace) {
- if (skipWhiteSpace) {
- skipWhiteSpace();
- }
-
- if (index >= length) {
- return false;
- }
-
- char c = header.charAt(index);
- return (EVENT_TABLE[c] == SEPARATOR)
- ? c == separator : false;
- }
-
- public String nextSeparatedString(char startSeparator, char endSeparator) throws ParseException {
- nextSeparator(startSeparator);
- final int start = index;
- for (; index < length; index++) {
- if (header.charAt(index) == endSeparator) {
- break;
- }
- }
-
- if (start == index) {
- // no token between separators
- throw new ParseException("No characters between the separators " +
- "'" + startSeparator + "' and '" + endSeparator + "'", index);
- } else if (index == length) {
- // no end separator
- throw new ParseException("No end separator '" + endSeparator + "'", index);
- }
-
- event = Event.Token;
- return value = header.substring(start, index++);
- }
-
- public Event next() throws ParseException {
- return event = process(getNextCharacter(true));
- }
-
- public Event next(boolean skipWhiteSpace) throws ParseException {
- return event = process(getNextCharacter(skipWhiteSpace));
- }
-
- public Event getEvent() {
- return event;
- }
-
- public String getEventValue() {
- return value;
- }
-
- public String getRemainder() {
- return (index < length) ? header.substring(index) : null;
- }
-
- public int getIndex() {
- return index;
- }
-
- private boolean skipWhiteSpace() {
- for (; index < length; index++) {
- if (!isWhiteSpace(header.charAt(index))) {
- return true;
- }
- }
-
- return false;
- }
-
- private char getNextCharacter(boolean skipWhiteSpace) throws ParseException {
- if (skipWhiteSpace) {
- skipWhiteSpace();
- }
-
- if (index >= length) {
- throw new ParseException("End of header", index);
- }
-
- return header.charAt(index);
- }
-
- private Event process(char c) throws ParseException {
- if (c > 127) {
- index++;
- return Event.Control;
- }
-
- switch (EVENT_TABLE[c]) {
- case TOKEN: {
- final int start = index;
- for (index++; index < length; index++) {
- if (!isToken(header.charAt(index))) {
- break;
- }
- }
- value = header.substring(start, index);
- return Event.Token;
- }
- case QUOTED_STRING:
- processQuotedString();
- return Event.QuotedString;
- case COMMENT:
- if (!processComments) {
- throw new ParseException("Comments are not allowed", index);
- }
-
- processComment();
- return Event.Comment;
- case SEPARATOR:
- index++;
- value = String.valueOf(c);
- return Event.Separator;
- case CONTROL:
- index++;
- value = String.valueOf(c);
- return Event.Control;
- default:
- // White space
- throw new ParseException("White space not allowed", index);
- }
- }
-
- private void processComment() throws ParseException {
- boolean filter = false;
- int nesting;
- int start;
- for (start = ++index , nesting = 1;
- nesting > 0 && index < length;
- index++) {
- char c = header.charAt(index);
- if (c == '\\') {
- index++;
- filter = true;
- } else if (c == '\r') {
- filter = true;
- } else if (c == '(') {
- nesting++;
- } else if (c == ')') {
- nesting--;
- }
- }
- if (nesting != 0) {
- throw new ParseException("Unbalanced comments", index);
- }
-
- value = (filter)
- ? filterToken(header, start, index - 1)
- : header.substring(start, index - 1);
- }
-
- private void processQuotedString() throws ParseException {
- boolean filter = false;
- for (int start = ++index; index < length; index++) {
- char c = this.header.charAt(index);
- if (c == '\\') {
- index++;
- filter = true;
- } else if (c == '\r') {
- filter = true;
- } else if (c == '"') {
- value = (filter)
- ? filterToken(header, start, index)
- : header.substring(start, index);
-
- index++;
- return;
- }
- }
-
- throw new ParseException("Unbalanced quoted string", index);
- }
-
- private boolean isWhiteSpace(char c) {
- return (c < 128 && IS_WHITE_SPACE[c]);
- }
-
- private boolean isToken(char c) {
- return (c < 128 && IS_TOKEN[c]);
- }
-
- private static String filterToken(String s, int start, int end) {
- StringBuffer sb = new StringBuffer();
- char c;
- boolean gotEscape = false;
- boolean gotCR = false;
-
- for (int i = start; i < end; i++) {
- c = s.charAt(i);
- if (c == '\n' && gotCR) {
- // This LF is part of an unescaped
- // CRLF sequence (i.e, LWSP). Skip it.
- gotCR = false;
- continue;
- }
-
- gotCR = false;
- if (!gotEscape) {
- // Previous character was NOT '\'
- if (c == '\\') { // skip this character
- gotEscape = true;
- } else if (c == '\r') { // skip this character
- gotCR = true;
- } else { // append this character
- sb.append(c);
- }
- } else {
- // Previous character was '\'. So no need to
- // bother with any special processing, just
- // append this character
- sb.append(c);
- gotEscape = false;
- }
- }
- return sb.toString();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/package-info.java
deleted file mode 100644
index dbccb840eef..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/header/reader/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for reading HTTP headers.
- */
-package com.sun.jersey.core.header.reader;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.java
deleted file mode 100644
index 89097663db4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.jersey.core.util.ReaderWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class BaseFormProvider<T extends MultivaluedMap<String, String>> extends AbstractMessageReaderWriterProvider<T> {
-
- public T readFrom(T map,
- MediaType mediaType,
- InputStream entityStream) throws IOException {
- final String encoded = readFromAsString(entityStream, mediaType);
-
- final String charsetName = ReaderWriter.getCharset(mediaType).name();
-
- final StringTokenizer tokenizer = new StringTokenizer(encoded, "&");
- String token;
- try {
- while (tokenizer.hasMoreTokens()) {
- token = tokenizer.nextToken();
- int idx = token.indexOf('=');
- if (idx < 0) {
- map.add(URLDecoder.decode(token, charsetName), null);
- } else if (idx > 0) {
- map.add(URLDecoder.decode(token.substring(0, idx), charsetName),
- URLDecoder.decode(token.substring(idx+1), charsetName));
- }
- }
- return map;
- } catch (IllegalArgumentException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- }
- }
-
- public void writeTo(
- T t,
- MediaType mediaType,
- OutputStream entityStream) throws IOException {
- final String charsetName = ReaderWriter.getCharset(mediaType).name();
-
- final StringBuilder sb = new StringBuilder();
- for (Map.Entry<String, List<String>> e : t.entrySet()) {
- for (String value : e.getValue()) {
- if (sb.length() > 0)
- sb.append('&');
- sb.append(URLEncoder.encode(e.getKey(), charsetName));
- if (value != null) {
- sb.append('=');
- sb.append(URLEncoder.encode(value, charsetName));
- }
- }
- }
-
- writeToAsString(sb.toString(), entityStream, mediaType);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.java
deleted file mode 100644
index cd7cd2ce507..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/octet-stream", "*/*"})
-@Consumes({"application/octet-stream", "*/*"})
-public final class ByteArrayProvider extends AbstractMessageReaderWriterProvider<byte[]> {
-
- public boolean supports(Class type) {
- return type == byte[].class;
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return type == byte[].class;
- }
-
- public byte[] readFrom(
- Class<byte[]> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- writeTo(entityStream, out);
- return out.toByteArray();
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return type == byte[].class;
- }
-
- public void writeTo(
- byte[] t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- entityStream.write(t);
- }
-
- @Override
- public long getSize(byte[] t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return t.length;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.java
deleted file mode 100644
index 8c4b8cbea3c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.jersey.core.util.ReaderWriter;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.activation.DataSource;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/octet-stream", "*/*"})
-@Consumes({"application/octet-stream", "*/*"})
-public class DataSourceProvider extends AbstractMessageReaderWriterProvider<DataSource> {
-
- /**
- * Modified from javax.mail.util.ByteArrayDataSource
- *
- * A DataSource backed by a byte array. The byte array may be
- * passed in directly, or may be initialized from an InputStream
- * or a String.
- *
- * @since JavaMail 1.4
- * @author John Mani
- * @author Bill Shannon
- * @author Max Spivak
- */
- public static class ByteArrayDataSource implements DataSource {
- private byte[] data;
- private int len = -1;
- private String type;
- private String name = "";
-
- static class DSByteArrayOutputStream extends ByteArrayOutputStream {
- public byte[] getBuf() {
- return buf;
- }
-
- public int getCount() {
- return count;
- }
- }
-
- public ByteArrayDataSource(InputStream is, String type) throws IOException {
- DSByteArrayOutputStream os = new DSByteArrayOutputStream();
- ReaderWriter.writeTo(is, os);
- this.data = os.getBuf();
- this.len = os.getCount();
-
- /*
- * ByteArrayOutputStream doubles the size of the buffer every time
- * it needs to expand, which can waste a lot of memory in the worst
- * case with large buffers. Check how much is wasted here and if
- * it's too much, copy the data into a new buffer and allow the
- * old buffer to be garbage collected.
- */
- if (this.data.length - this.len > 256*1024) {
- this.data = os.toByteArray();
- this.len = this.data.length; // should be the same
- }
- this.type = type;
- }
-
- public InputStream getInputStream() throws IOException {
- if (data == null)
- throw new IOException("no data");
- if (len < 0)
- len = data.length;
- return new ByteArrayInputStream(data, 0, len);
- }
-
- public OutputStream getOutputStream() throws IOException {
- throw new IOException("cannot do this");
- }
-
- public String getContentType() {
- return type;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
- }
-
- public DataSourceProvider() {
- Class<?> c = DataSource.class;
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return DataSource.class == type;
- }
-
- public DataSource readFrom(
- Class<DataSource> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- ByteArrayDataSource ds = new ByteArrayDataSource(entityStream,
- (mediaType == null) ? null : mediaType.toString());
- return ds;
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return DataSource.class.isAssignableFrom(type);
- }
-
- public void writeTo(
- DataSource t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- InputStream in = t.getInputStream();
- try {
- writeTo(in, entityStream);
- } finally {
- in.close();
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DocumentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DocumentProvider.java
deleted file mode 100644
index e6de80d4073..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/DocumentProvider.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/xml", "text/xml", "*/*"})
-@Consumes({"application/xml", "text/xml", "*/*"})
-public final class DocumentProvider extends AbstractMessageReaderWriterProvider<Document> {
-
- // Delay construction of factory
- private final Injectable<DocumentBuilderFactory> dbf;
-
- // Delay construction of factory
- private final Injectable<TransformerFactory> tf;
-
- public DocumentProvider(@Context Injectable<DocumentBuilderFactory> dbf,
- @Context Injectable<TransformerFactory> tf) {
- this.dbf = dbf;
- this.tf = tf;
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return Document.class == type;
- }
-
- public Document readFrom(
- Class<Document> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- return dbf.getValue().newDocumentBuilder().parse(entityStream);
- } catch (SAXException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (ParserConfigurationException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return Document.class.isAssignableFrom(type);
- }
-
- public void writeTo(
- Document t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- StreamResult sr = new StreamResult(entityStream);
- tf.getValue().newTransformer().transform(new DOMSource(t), sr);
- } catch (TransformerException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.java
deleted file mode 100644
index 29b4f450ffc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.EntityHolder;
-import com.sun.jersey.core.util.ReaderWriter;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.logging.Logger;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class EntityHolderReader implements MessageBodyReader<Object> {
-
- private static final Logger LOGGER = Logger.getLogger(EntityHolderReader.class.getName());
-
- private final MessageBodyWorkers bodyWorker;
-
- public EntityHolderReader(@Context MessageBodyWorkers bodyWorker) {
- this.bodyWorker = bodyWorker;
- }
-
- public boolean isReadable(
- Class<?> type,
- Type genericType,
- Annotation[] annotations,
- MediaType mediaType) {
- if (type != EntityHolder.class) return false;
-
- if (!(genericType instanceof ParameterizedType)) return false;
-
- final ParameterizedType pt = (ParameterizedType)genericType;
-
- final Type t = pt.getActualTypeArguments()[0];
-
- if (t instanceof Class || t instanceof ParameterizedType)
- return true;
- else
- return false;
- }
-
- public Object readFrom(
- Class<Object> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
-
- if (!entityStream.markSupported()) {
- entityStream = new BufferedInputStream(entityStream, ReaderWriter.BUFFER_SIZE);
- }
- entityStream.mark(1);
- if (entityStream.read() == -1) {
- return new EntityHolder();
- }
-
- entityStream.reset();
-
- final ParameterizedType pt = (ParameterizedType)genericType;
- final Type t = pt.getActualTypeArguments()[0];
- final Class entityClass = (t instanceof Class) ? (Class)t : (Class)((ParameterizedType)t).getRawType();
- final Type entityGenericType = (t instanceof Class) ? entityClass : t;
-
- MessageBodyReader br = bodyWorker.getMessageBodyReader(entityClass, entityGenericType, annotations, mediaType);
- if (br == null) {
- LOGGER.severe("A message body reader for the type, " + type + ", could not be found");
- throw new WebApplicationException();
- }
- Object o = br.readFrom(entityClass, entityGenericType, annotations, mediaType, httpHeaders, entityStream);
- return new EntityHolder(o);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FileProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FileProvider.java
deleted file mode 100644
index 86ab13bdbba..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FileProvider.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.jersey.core.util.ReaderWriter;
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/octet-stream", "*/*"})
-@Consumes({"application/octet-stream", "*/*"})
-public final class FileProvider extends AbstractMessageReaderWriterProvider<File> {
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return File.class == type;
- }
-
- public File readFrom(
- Class<File> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- File f = File.createTempFile("rep","tmp");
- OutputStream out = new BufferedOutputStream(new FileOutputStream(f));
- try {
- writeTo(entityStream, out);
- } finally {
- out.close();
- }
- return f;
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return File.class.isAssignableFrom(type);
- }
-
- public void writeTo(
- File t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- InputStream in = new BufferedInputStream(new FileInputStream(t), ReaderWriter.BUFFER_SIZE);
- try {
- writeTo(in, entityStream);
- } finally {
- in.close();
- }
- }
-
- @Override
- public long getSize(File t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return t.length();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.java
deleted file mode 100644
index ec1eeceeba2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces("application/x-www-form-urlencoded")
-@Consumes("application/x-www-form-urlencoded")
-public final class FormMultivaluedMapProvider extends
- BaseFormProvider<MultivaluedMap<String, String>> {
-
- private final Type mapType;
-
- public FormMultivaluedMapProvider() {
- ParameterizedType iface = (ParameterizedType)this.getClass().getGenericSuperclass();
- mapType = iface.getActualTypeArguments()[0];
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- // Only allow types MultivaluedMap<String, String> and MultivaluedMap.
- return type == MultivaluedMap.class &&
- (type == genericType || mapType.equals(genericType));
- }
-
- public MultivaluedMap<String, String> readFrom(
- Class<MultivaluedMap<String, String>> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- return readFrom(new MultivaluedMapImpl(), mediaType, entityStream);
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return MultivaluedMap.class.isAssignableFrom(type);
- }
-
- public void writeTo(
- MultivaluedMap<String, String> t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- writeTo(t, mediaType, entityStream);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormProvider.java
deleted file mode 100644
index 5ed8525269d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/FormProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.api.representation.Form;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/x-www-form-urlencoded", "*/*"})
-@Consumes({"application/x-www-form-urlencoded", "*/*"})
-public final class FormProvider extends BaseFormProvider<Form> {
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return type == Form.class;
- }
-
- public Form readFrom(
- Class<Form> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- return readFrom(new Form(), mediaType, entityStream);
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return type == Form.class;
- }
-
- public void writeTo(
- Form t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- writeTo(t, mediaType, entityStream);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/Inflector.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/Inflector.java
deleted file mode 100644
index bde2211426b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/Inflector.java
+++ /dev/null
@@ -1,847 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.impl.provider.entity;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * <p>API for performing inflections (pluralization, singularization, and so on)
- * on various strings. These inflections will be useful in code generators that
- * convert things like database table names into Java class names.</p>
- *
- * <p>The <code>getInstance()</code> method returns a singleton instance of
- * this class with a default set of rules, which can then be customized.
- * Rules added during customization will take precedence over the standard ones.
- * Use the <code>addIrregular()</code>, <code>addPlural()</code>, <code>addSingular()</code>,
- * and <code>addUncountable()</code> methods to add additional rules ot the default
- * ones.</p>
- *
- * <p><strong>IMPLEMENTATION NOTE</strong> - The default implementation is
- * intended to be functionally compatible with the <code>Inflector::inflections</code>
- * class in Ruby on Rails. The <code>gsub()</code> method on Ruby strings
- * matches regular expressions anywhere in the input. However, nearly all of
- * the actual patterns used in this module use <code>$</code> at the end to
- * match the end of the input string (so that only the last word in a multiple
- * word phrase will be singularized or pluralized). Therefore, the Java versions
- * of the regular expressions have been modified to capture all text before the
- * interesting characters at the end, and emit them as part of the result, so
- * that the entire string can be matched against a pattern once.</p>
- *
- * @author Florian Rosenberg
- */
-public class Inflector {
-
-
- // ------------------------------------------------------------ Constructors
- /**
- * <p>Private constructor to avoid instantiation.</p>
- */
- private Inflector() {
-
- addPlural("$", "s", false);
- addPlural("(.*)$", "\\1s");
- addPlural("(.*)(ax|test)is$", "\\1\\2es");
- addPlural("(.*)(octop|vir)us$", "\\1\\2i");
- addPlural("(.*)(alias|status)$", "\\1\\2es");
- addPlural("(.*)(bu)s$", "\\1\\2ses");
- addPlural("(.*)(buffal|tomat)o$", "\\1\\2oes");
- addPlural("(.*)([ti])um$", "\\1\\2a");
- addPlural("(.*)sis$", "\\1ses");
- addPlural("(.*)(?:([^f])fe|([lr])f)$", "\\1\\3ves");
- addPlural("(.*)(hive)$", "\\1\\2s");
- addPlural("(.*)(tive)$", "\\1\\2s"); // Added for consistency with singular rules
- addPlural("(.*)([^aeiouy]|qu)y$", "\\1\\2ies");
- addPlural("(.*)(series)$", "\\1\\2"); // Added for consistency with singular rules
- addPlural("(.*)(movie)$", "\\1\\2s"); // Added for consistency with singular rules
- addPlural("(.*)(x|ch|ss|sh)$", "\\1\\2es");
- addPlural("(.*)(matr|vert|ind)ix|ex$", "\\1\\2ices");
- addPlural("(.*)(o)$", "\\1\\2es"); // Added for consistency with singular rules
- addPlural("(.*)(shoe)$", "\\1\\2s"); // Added for consistency with singular rules
- addPlural("(.*)([m|l])ouse$", "\\1\\2ice");
- addPlural("^(ox)$", "\\1en");
- addPlural("(.*)(vert|ind)ex$", "\\1\\2ices"); // Added for consistency with singular rules
- addPlural("(.*)(matr)ix$", "\\1\\2ices"); // Added for consistency with singular rules
- addPlural("(.*)(quiz)$", "\\1\\2zes");
-
- addSingular("(.*)s$", "\\1");
- addSingular("(.*)(n)ews$", "\\1\\2ews");
- addSingular("(.*)([ti])a$", "\\1\\2um");
- addSingular("(.*)((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$", "\\1\\2sis");
- addSingular("(.*)(^analy)ses$", "\\1\\2sis");
- addSingular("(.*)([^f])ves$", "\\1\\2fe");
- addSingular("(.*)(hive)s$", "\\1\\2");
- addSingular("(.*)(tive)s$", "\\1\\2");
- addSingular("(.*)([lr])ves$", "\\1\\2f");
- addSingular("(.*)([^aeiouy]|qu)ies$", "\\1\\2y");
- addSingular("(.*)(s)eries$", "\\1\\2eries");
- addSingular("(.*)(m)ovies$", "\\1\\2ovie");
- addSingular("(.*)(x|ch|ss|sh)es$", "\\1\\2");
- addSingular("(.*)([m|l])ice$", "\\1\\2ouse");
- addSingular("(.*)(bus)es$", "\\1\\2");
- addSingular("(.*)(o)es$", "\\1\\2");
- addSingular("(.*)(shoe)s$", "\\1\\2");
- addSingular("(.*)(cris|ax|test)es$", "\\1\\2is");
- addSingular("(.*)(octop|vir)i$", "\\1\\2us");
- addSingular("(.*)(alias|status)es$", "\\1\\2");
- addSingular("^(ox)en", "\\1");
- addSingular("(.*)(vert|ind)ices$", "\\1\\2ex");
- addSingular("(.*)(matr)ices$", "\\1\\2ix");
- addSingular("(.*)(quiz)zes$", "\\1\\2");
-
- addIrregular("child", "children");
- addIrregular("man", "men");
- addIrregular("move", "moves");
- addIrregular("person", "people");
- addIrregular("sex", "sexes");
-
- addUncountable("equipment");
- addUncountable("fish");
- addUncountable("information");
- addUncountable("money");
- addUncountable("rice");
- addUncountable("series");
- addUncountable("sheep");
- addUncountable("species");
-
- }
- // -------------------------------------------------------- Static Variables
- /**
- * <p>The singleton instance returned by the default <code>getInstance()</code>
- * method.</p>
- */
- private transient static Inflector instance = null;
- /**
- * <p>List of <code>Replacer</code>s for performing replacement operations
- * on matches for plural words.</p>
- */
- private List<Replacer> plurals = new LinkedList<Replacer>();
- /**
- * <p>List of <code>Replacer</code>s for performing replacement operations
- * on matches for addSingular words.</p>
- */
- private List<Replacer> singulars = new ArrayList<Replacer>();
- /**
- * <p>List of words that represent addUncountable concepts that cannot be
- * pluralized or singularized.</p>
- */
- private List uncountables = new LinkedList();
-
-
- // ------------------------------------------------------ Instance Variables
- // ---------------------------------------------------------- Static Methods
- /**
- * <p>Return a fully configured {@link Inflector} instance that can be used
- * for performing transformations.</p>
- */
- public static Inflector getInstance() {
-
- if (instance == null) {
- instance = new Inflector();
- }
- return instance;
-
- }
-
-
- // ---------------------------------------------------------- Public Methods
- /**
- * <p>Convert strings to <code>EmbeddedCamelCase</code>. Embedded
- * underscores will be removed.</p>
- *
- * @param word Word to be converted
- */
- public String camelize(String word) {
-
- return camelize(word, false);
-
- }
-
- /**
- * <p>Convert word strings consisting of lower case letters and
- * underscore characters between words into <code>embeddedCamelCase</code>
- * or <code>EmbeddedCamelCase</code>, depending on the <code>lower</code>
- * flag. Embedded underscores will be removed. Embedded '/'
- * characters will be replaced by '.', making this method useful
- * in converting path-like names into fully qualified classnames.</p>
- *
- * <p><strong>IMPLEMENTATION DIFFERENCE</strong> - The Rails version of this
- * method also converts '/' characters to '::' because that reflects
- * the normal syntax for fully qualified names in Ruby.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"foo_bar", false</td>
- * <td>"FooBar"</td>
- * </tr>
- * <tr>
- * <td>"foo_bar", true</td>
- * <td>"fooBar"</td>
- * </tr>
- * <tr>
- * <td>"foo_bar/baz", false</td>
- * <td>"FooBar.Baz"</td>
- * </tr>
- * <tr>
- * <td>"foo_bar/baz", true</td>
- * <td>"fooBar.Baz"</td>
- * </tr>
- * </table>
- *
- * @param word Word to be converted
- * @param flag Flag indicating that the initial character should
- * be lower cased instead of upper cased
- */
- public String camelize(String word, boolean flag) {
- if (word.length() == 0) {
- return word;
- }
-
- StringBuffer sb = new StringBuffer(word.length());
- if (flag) {
- sb.append(Character.toLowerCase(word.charAt(0)));
- } else {
- sb.append(Character.toUpperCase(word.charAt(0)));
- }
- boolean capitalize = false;
- for (int i = 1; i < word.length(); i++) {
- char ch = word.charAt(i);
- if (capitalize) {
- sb.append(Character.toUpperCase(ch));
- capitalize = false;
- } else if (ch == '_') {
- capitalize = true;
- } else if (ch == '/') {
- capitalize = true;
- sb.append('.');
- } else {
- sb.append(ch);
- }
- }
- return sb.toString();
-
- }
-
- /**
- * <p>Create and return a simple class name that corresponds to a
- * addPlural table name. Any leading schema name will be trimmed.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"foo_bars"</td>
- * <td>"FooBar"</td>
- * </tr>
- * <tr>
- * <td>"baz"</td>
- * <td>"Baz"</td>
- * </tr>
- * </table>
- *
- * @param tableName Table name to be converted
- */
- public String classify(String tableName) {
-
- int period = tableName.lastIndexOf('.');
- if (period >= 0) {
- tableName = tableName.substring(period + 1);
- }
- return camelize(singularize(tableName));
-
- }
-
- /**
- * <p>Replace underscores in the specified word with dashes.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"foo_bar"</td>
- * <td>"foo-bar"</td>
- * </tr>
- * <tr>
- * <td>"baz"</td>
- * <td>"baz"</td>
- * </tr>
- * </table>
- *
- * @param word Word to be converted
- */
- public String dasherize(String word) {
-
- return word.replace('_', '-');
-
- }
-
- /**
- * <p>Remove any package name from a fully qualified class name,
- * returning only the simple classname.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"java.util.Map"</td>
- * <td>"Map"</td>
- * </tr>
- * <tr>
- * <td>"String"</td>
- * <td>"String"</td>
- * </tr>
- * </table>
- *
- * @param className Fully qualified class name to be converted
- */
- public String demodulize(String className) {
-
- int period = className.lastIndexOf('.');
- if (period >= 0) {
- return className.substring(period + 1);
- } else {
- return className;
- }
-
- }
-
- /**
- * <p>Create and return a foreign key name from a class name,
- * separating the "id" suffix with an underscore.</p>
- */
- public String foreignKey(String className) {
-
- return foreignKey(className, true);
-
- }
-
- /**
- * <p>Create and return a foreign key name from a class name,
- * optionally inserting an underscore before the "id" portion.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"com.mymodel.Order", false</td>
- * <td>"orderid"</td>
- * </tr>
- * <tr>
- * <td>"com.mymodel.Order", true</td>
- * <td>"order_id"</td>
- * </tr>
- * <tr>
- * <td>"Message", false</td>
- * <td>"messageid"</td>
- * </tr>
- * <tr>
- * <td>"Message", true</td>
- * <td>"message_id"</td>
- * </tr>
- * </table>
- *
- * @param className Class name for which to create a foreign key
- * @param underscore Flag indicating whether an underscore should
- * be emitted between the class name and the "id" suffix
- */
- public String foreignKey(String className, boolean underscore) {
-
- return underscore(demodulize(className) + (underscore ? "_id" : "id"));
-
- }
-
- /**
- * <p>Capitalize the first word in a lower cased and underscored string,
- * turn underscores into spaces, and string any trailing "_id". Like
- * <code>titleize()</code>, this is meant for creating pretty output,
- * and is not intended for code generation.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"employee_salary"</td>
- * <td>"Employee salary"</td>
- * </tr>
- * <tr>
- * <td>"author_id"</td>
- * <td>"Author"</td>
- * </tr>
- * </table>
- *
- * @param words Word string to be converted
- */
- public String humanize(String words) {
-
- if (words.endsWith("_id")) {
- words = words.substring(0, words.length() - 3);
- }
- StringBuffer sb = new StringBuffer(words.length());
- sb.append(Character.toUpperCase(words.charAt(0)));
- for (int i = 1; i < words.length(); i++) {
- char ch = words.charAt(i);
- if (ch == '_') {
- sb.append(' ');
- } else {
- sb.append(ch);
- }
- }
- return sb.toString();
-
- }
-
- /**
- * <p>Turn a number into a corresponding ordinal string used to
- * denote the position in an ordered sequence.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>1</td>
- * <td>"1st"</td>
- * </tr>
- * <tr>
- * <td>2</td>
- * <td>"2nd"</td>
- * </tr>
- * <tr>
- * <td>3</td>
- * <td>"3rd"</td>
- * </tr>
- * <tr>
- * <td>4</td>
- * <td>"rth"</td>
- * </tr>
- * <tr>
- * <td>1002</td>
- * <td>"1002nd"</td>
- * </tr>
- * <tr>
- * <td>2012</td>
- * <td>"2012th"</td>
- * </tr>
- * </table>
- *
- * @param number Number to be converted
- */
- public String ordinalize(int number) {
-
- int modulo = number % 100;
- if ((modulo >= 11) && (modulo <= 13)) {
- return "" + number + "th";
- }
- switch (number % 10) {
- case 1:
- return "" + number + "st";
- case 2:
- return "" + number + "nd";
- case 3:
- return "" + number + "rd";
- default:
- return "" + number + "th";
- }
-
- }
-
- /**
- * <p>Return a addPlural version of the specified (addSingular) word.</p>
- *
- *
- * @param word Singular word to be converted
- */
- public String pluralize(String word) {
-
- // Scan uncountables and leave alone
- for (int i = 0; i < uncountables.size(); i++) {
- if (uncountables.get(i).equals(word)) {
- return word;
- }
- }
-
- // Scan our patterns for a match and return the correct replacement
- for (int i = 0; i < plurals.size(); i++) {
- String replacement = plurals.get(i).replacement(word);
- if (replacement != null) {
- return replacement;
- }
- }
-
- // Return the original string unchanged
- return word;
-
- }
-
- /**
- * <p>Return a addSingular version of the specified (addPlural) word.</p>
- *
- *
- * @param word Plural word to be converted
- */
- public String singularize(String word) {
-
- // Scan uncountables and leave alone
- for (int i = 0; i < uncountables.size(); i++) {
- if (uncountables.get(i).equals(word)) {
- return word;
- }
- }
-
- // Scan our patterns for a match and return the correct replacement
- for (int i = 0; i < singulars.size(); i++) {
- String replacement = singulars.get(i).replacement(word);
- if (replacement != null) {
- return replacement;
- }
- }
-
- // Return the original string unchanged
- return word;
-
- }
-
- /**
- * <p>Convert the simple name of a model class into the corresponding
- * name of a database table, by uncamelizing, inserting underscores,
- * and pluralizing the last word.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"RawScaledScorer"</td>
- * <td>"raw_scaled_scorers"</td>
- * </tr>
- * <tr>
- * <td>"fancyCategory"</td>
- * <td>"fancy_categories"</td>
- * </tr>
- * </table>
- *
- * @param className Class name to be converted
- */
- public String tableize(String className) {
-
- return pluralize(underscore(className));
-
- }
-
- /**
- * <p>Capitalize all the words, and replace some characters in the string
- * to create a nicer looking title. This is meant for creating pretty
- * output, and is not intended for code generation.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"the honeymooners"</td>
- * <td>"The Honeymooners"</td>
- * </tr>
- * <tr>
- * <td>"x-men: the last stand"</td>
- * <td>"X Men: The Last Stand"</td>
- * </tr>
- * </table>
- *
- * @param words Word string to be converted
- */
- public String titleize(String words) {
-
- StringBuffer sb = new StringBuffer(words.length());
- boolean capitalize = true; // To get the first character right
- for (int i = 0; i < words.length(); i++) {
- char ch = words.charAt(i);
- if (Character.isWhitespace(ch)) {
- sb.append(' ');
- capitalize = true;
- } else if (ch == '-') {
- sb.append(' ');
- capitalize = true;
- } else if (capitalize) {
- sb.append(Character.toUpperCase(ch));
- capitalize = false;
- } else {
- sb.append(ch);
- }
- }
- return sb.toString();
-
- }
-
- public String decapitalize(String word) {
- // do nothing if null or empty
- if ((word == null) || (word.length() < 1)) {
- return word;
- }
- // or if already decapitalized
- char first = word.charAt(0);
- if (Character.isLowerCase(first)) {
- return word;
- }
- // otherwise turn the first character to lower case and attach the rest
- StringBuilder sb = new StringBuilder(word.length());
- sb.append(Character.toLowerCase(first));
- sb.append(word.substring(1));
- return sb.toString();
- }
-
- /**
- * <p>The reverse of <code>camelize()</code>, makes an underscored form
- * from the expression in the string. Changes "." to "/" to convert
- * fully qualified class names into paths.</p>
- *
- * <table border="1" width="100%">
- * <tr>
- * <th>Input</th>
- * <th>Output</th>
- * </tr>
- * <tr>
- * <td>"FooBar"</td>
- * <td>"foo_bar"</td>
- * </tr>
- * <tr>
- * <td>"fooBar"</td>
- * <td>"foo_bar"</td>
- * </tr>
- * <tr>
- * <td>"FooBar.Baz"</td>
- * <td>"foo_bar/baz"</td>
- * </tr>
- * <tr>
- * <td>"FooBar.Baz"</td>
- * <td>"foo_bar/baz"</td>
- * </tr>
- * </table>
- *
- * @param word Camel cased word to be converted
- */
- public String underscore(String word) {
-
- StringBuffer sb = new StringBuffer(word.length() + 5);
- boolean uncapitalize = false;
- for (int i = 0; i < word.length(); i++) {
- char ch = word.charAt(i);
- if (uncapitalize) {
- sb.append(Character.toLowerCase(ch));
- uncapitalize = false;
- } else if (ch == '.') {
- sb.append('/');
- uncapitalize = true;
- } else if (Character.isUpperCase(ch)) {
- if (i > 0) {
- sb.append('_');
- }
- sb.append(Character.toLowerCase(ch));
- } else {
- sb.append(ch);
- }
- }
- return sb.toString();
-
- }
-
-
- // --------------------------------------------------- Customization Methods
- /**
- * <p>Add the addSingular and addPlural forms of words that cannot be
- * converted using the normal rules.</p>
- *
- *
- * @param singular Singular form of the word
- * @param plural Plural form of the word
- */
- public void addIrregular(String singular, String plural) {
-
- addPlural("(.*)(" + singular.substring(0, 1) + ")" + singular.substring(1) + "$",
- "\\1\\2" + plural.substring(1));
- addSingular("(.*)(" + plural.substring(0, 1) + ")" + plural.substring(1) + "$",
- "\\1\\2" + singular.substring(1));
-
- }
-
- /**
- * <p>Add a match pattern and replacement rule for converting addPlural
- * forms to addSingular forms. By default, matches will be case
- * insensitive.</p>
- *
- *
- * @param match Match pattern regular expression
- * @param rule Replacement rule
- */
- public void addPlural(String match, String rule) {
-
- addPlural(match, rule, true);
-
- }
-
- /**
- * <p>Add a match pattern and replacement rule for converting addPlural
- * forms to addSingular forms.</p>
- *
- *
- * @param match Match pattern regular expression
- * @param rule Replacement rule
- * @param insensitive Flag indicating this match should be case insensitive
- */
- public void addPlural(String match, String rule, boolean insensitive) {
-
- plurals.add(0, new Replacer(match, rule, insensitive));
-
- }
-
- /**
- * <p>Add a match pattern and replacement rule for converting addSingular
- * forms to addPlural forms. By default, matches will be case insensitive.</p>
- *
- *
- * @param match Match pattern regular expression
- * @param rule Replacement rule
- */
- public void addSingular(String match, String rule) {
-
- addSingular(match, rule, true);
-
- }
-
- /**
- * <p>Add a match pattern and replacement rule for converting addSingular
- * forms to addPlural forms.</p>
- *
- *
- * @param match Match pattern regular expression
- * @param rule Replacement rule
- * @param insensitive Flag indicating this match should be case insensitive
- */
- public void addSingular(String match, String rule, boolean insensitive) {
-
- singulars.add(0, new Replacer(match, rule, insensitive));
-
- }
-
- /**
- * <p>Add a word that cannot be converted between addSingular and addPlural.</p>
- *
- *
- * @param word Word to be added
- */
- public void addUncountable(String word) {
-
- uncountables.add(0, word.toLowerCase());
-
- }
-
-
- // --------------------------------------------------------- Private Classes
- /**
- * <p>Internal class that uses a regular expression matcher to both
- * match the specified regular expression to a specified word, and
- * (if successful) perform the appropriate substitutions.</p>
- */
- private class Replacer {
-
- // --------------------------------------------------------- Constructor
- public Replacer(String match, String rule, boolean insensitive) {
-
- pattern = Pattern.compile(match,
- insensitive ? Pattern.CASE_INSENSITIVE : 0);
- this.rule = rule;
-
- }
-
- // -------------------------------------------------- Instance Variables
- private Pattern pattern = null;
- private String rule = null;
-
-
- // ------------------------------------------------------ Public Methods
-
- /**
- * Replace the input if it matches the pattern.
- *
- * @param input the input string.
- * @return the replacement, if the input matches, otherwise null.
- */
- public String replacement(String input) {
- Matcher matcher = pattern.matcher(input);
- if (matcher.matches()) {
- StringBuffer sb = new StringBuffer();
- boolean group = false;
- for (int i = 0; i < rule.length(); i++) {
- char ch = rule.charAt(i);
- if (group) {
- sb.append(matcher.group(Character.digit(ch, 10)));
- group = false;
- } else if (ch == '\\') {
- group = true;
- } else {
- sb.append(ch);
- }
- }
- return sb.toString();
- } else {
- return null;
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.java
deleted file mode 100644
index f8e2934f5d0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/octet-stream", "*/*"})
-@Consumes({"application/octet-stream", "*/*"})
-public final class InputStreamProvider extends AbstractMessageReaderWriterProvider<InputStream> {
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return InputStream.class == type;
- }
-
- public InputStream readFrom(
- Class<InputStream> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- return entityStream;
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return InputStream.class.isAssignableFrom(type);
- }
-
- @Override
- public long getSize(InputStream t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- if (t instanceof ByteArrayInputStream)
- return ((ByteArrayInputStream)t).available();
- else
- return -1;
- }
-
- public void writeTo(
- InputStream t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- writeTo(t, entityStream);
- } finally {
- t.close();
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.java
deleted file mode 100644
index 71bd4101acf..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMultipart;
-import javax.mail.internet.ParseException;
-import javax.mail.util.ByteArrayDataSource;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class MimeMultipartProvider extends AbstractMessageReaderWriterProvider<MimeMultipart> {
-
- public MimeMultipartProvider() {
- Class<?> c = MimeMultipart.class;
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == MimeMultipart.class;
- }
-
- public MimeMultipart readFrom(
- Class<MimeMultipart> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- if (mediaType == null)
- mediaType = new MediaType("multipart", "form-data");
- ByteArrayDataSource ds = new ByteArrayDataSource(entityStream, mediaType.toString());
- try {
- return new MimeMultipart(ds);
- } catch (ParseException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (MessagingException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == MimeMultipart.class;
- }
-
-
- public void writeTo(
- MimeMultipart t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- // TODO put boundary string as parameter of media type?
- t.writeTo(entityStream);
- } catch (MessagingException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ReaderProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ReaderProvider.java
deleted file mode 100644
index d429f187a5e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/ReaderProvider.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"text/plain", "*/*"})
-@Consumes({"text/plain", "*/*"})
-public final class ReaderProvider extends AbstractMessageReaderWriterProvider<Reader> {
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return Reader.class == type;
- }
-
- public Reader readFrom(
- Class<Reader> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- return new BufferedReader(new InputStreamReader(entityStream, getCharset(mediaType)));
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return Reader.class.isAssignableFrom(type);
- }
-
- public void writeTo(
- Reader t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- writeTo(t, new OutputStreamWriter(entityStream,
- getCharset(mediaType)));
- } finally {
- t.close();
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.java
deleted file mode 100644
index 3bb2af3a589..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import java.awt.Image;
-import java.awt.image.BufferedImage;
-import java.awt.image.RenderedImage;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Iterator;
-import javax.imageio.ImageIO;
-import javax.imageio.ImageReader;
-import javax.imageio.ImageWriter;
-import javax.imageio.stream.ImageInputStream;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces("image/*")
-@Consumes({"image/*", "application/octet-stream"})
-public final class RenderedImageProvider extends AbstractMessageReaderWriterProvider<RenderedImage> {
- private static final MediaType IMAGE_MEDIA_TYPE = new MediaType("image", "*");
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return RenderedImage.class == type || BufferedImage.class == type;
- }
-
- public RenderedImage readFrom(
- Class<RenderedImage> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- if (IMAGE_MEDIA_TYPE.isCompatible(mediaType)) {
- Iterator<ImageReader> readers = ImageIO.getImageReadersByMIMEType(mediaType.toString());
- if (!readers.hasNext())
- throw new IOException("The image-based media type " + mediaType + "is not supported for reading");
- ImageReader reader = readers.next();
-
- ImageInputStream in = ImageIO.createImageInputStream(entityStream);
- reader.setInput(in, true, true);
- BufferedImage bi = reader.read(0, reader.getDefaultReadParam());
- in.close();
- reader.dispose();
- return bi;
- } else {
- return ImageIO.read(entityStream);
- }
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return RenderedImage.class.isAssignableFrom(type);
- }
-
- public void writeTo(
- RenderedImage t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- String formatName = getWriterFormatName(mediaType);
- if (formatName == null)
- throw new IOException("The image-based media type " + mediaType + " is not supported for writing");
- ImageIO.write(t, formatName, entityStream);
- }
-
- private String getWriterFormatName(MediaType t) {
- return getWriterFormatName(t.toString());
- }
-
- private String getWriterFormatName(String t) {
- Iterator<ImageWriter> i = ImageIO.getImageWritersByMIMEType(t);
- if (!i.hasNext()) return null;
-
- return i.next().getOriginatingProvider().getFormatNames()[0];
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/SourceProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/SourceProvider.java
deleted file mode 100644
index 245449d7680..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/SourceProvider.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.spi.inject.Injectable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.Source;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class SourceProvider {
-
- @Produces({"application/xml", "text/xml", "*/*"})
- @Consumes({"application/xml", "text/xml", "*/*"})
- public static final class StreamSourceReader implements
- MessageBodyReader<StreamSource> {
- public boolean isReadable(Class<?> t, Type gt, Annotation[] as, MediaType mediaType) {
- return StreamSource.class == t;
- }
-
- public StreamSource readFrom(
- Class<StreamSource> t,
- Type gt,
- Annotation[] as,
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- return new StreamSource(entityStream);
- }
- }
-
- @Produces({"application/xml", "text/xml", "*/*"})
- @Consumes({"application/xml", "text/xml", "*/*"})
- public static final class SAXSourceReader implements
- MessageBodyReader<SAXSource> {
- // Delay construction of factory
- private final Injectable<SAXParserFactory> spf;
-
- public SAXSourceReader(@Context Injectable<SAXParserFactory> spf) {
- this.spf = spf;
- }
-
- public boolean isReadable(Class<?> t, Type gt, Annotation[] as, MediaType mediaType) {
- return SAXSource.class == t;
- }
-
- public SAXSource readFrom(
- Class<SAXSource> t,
- Type gt,
- Annotation[] as,
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- return new SAXSource(spf.getValue().newSAXParser().getXMLReader(),
- new InputSource(entityStream));
- } catch (SAXParseException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (SAXException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- } catch (ParserConfigurationException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
- }
-
- @Produces({"application/xml", "text/xml", "*/*"})
- @Consumes({"application/xml", "text/xml", "*/*"})
- public static final class DOMSourceReader implements
- MessageBodyReader<DOMSource> {
- // Delay construction of factory
- private final Injectable<DocumentBuilderFactory> dbf;
-
- public DOMSourceReader(@Context Injectable<DocumentBuilderFactory> dbf) {
- this.dbf = dbf;
- }
-
- public boolean isReadable(Class<?> t, Type gt, Annotation[] as, MediaType mediaType) {
- return DOMSource.class == t;
- }
-
- public DOMSource readFrom(
- Class<DOMSource> t,
- Type gt,
- Annotation[] as,
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- Document d = dbf.getValue().newDocumentBuilder().parse(entityStream);
- return new DOMSource(d);
- } catch (SAXParseException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (SAXException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- } catch (ParserConfigurationException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
- }
-
- @Produces({"application/xml", "text/xml", "*/*"})
- @Consumes({"application/xml", "text/xml", "*/*"})
- public static final class SourceWriter implements
- MessageBodyWriter<Source> {
-
- // Delay construction of factory
- private final Injectable<SAXParserFactory> spf;
-
- // Delay construction of factory
- private final Injectable<TransformerFactory> tf;
-
- public SourceWriter(@Context Injectable<SAXParserFactory> spf,
- @Context Injectable<TransformerFactory> tf) {
- this.spf = spf;
- this.tf = tf;
- }
-
- public boolean isWriteable(Class<?> t, Type gt, Annotation[] as, MediaType mediaType) {
- return Source.class.isAssignableFrom(t);
- }
-
- public long getSize(Source o, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- public void writeTo(Source o, Class<?> t, Type gt, Annotation[] as,
- MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
-
- try {
- if (o instanceof StreamSource) {
- StreamSource s = (StreamSource)o;
- InputSource is = new InputSource(s.getInputStream());
- o = new SAXSource(spf.getValue().newSAXParser().getXMLReader(), is);
- }
- StreamResult sr = new StreamResult(entityStream);
- tf.getValue().newTransformer().transform(o, sr);
- } catch (SAXException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- } catch (ParserConfigurationException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- } catch (TransformerException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.java
deleted file mode 100644
index 8f4682c4d8f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.StreamingOutput;
-import javax.ws.rs.ext.MessageBodyWriter;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/octet-stream", "*/*"})
-public final class StreamingOutputProvider implements MessageBodyWriter<StreamingOutput> {
-
- public boolean isWriteable(Class<?> t, Type gt, Annotation[] as, MediaType mediaType) {
- return StreamingOutput.class.isAssignableFrom(t);
- }
-
- public long getSize(StreamingOutput o, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- public void writeTo(StreamingOutput o, Class<?> t, Type gt, Annotation[] as,
- MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entity) throws IOException {
- o.write(entity);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StringProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StringProvider.java
deleted file mode 100644
index 4b3098a7deb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/StringProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"text/plain", "*/*"})
-@Consumes({"text/plain", "*/*"})
-public final class StringProvider extends AbstractMessageReaderWriterProvider<String> {
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == String.class;
- }
-
- public String readFrom(
- Class<String> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- return readFromAsString(entityStream, mediaType);
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == String.class;
- }
-
- public void writeTo(
- String t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- writeToAsString(t, entityStream, mediaType);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.java
deleted file mode 100644
index d1c5e1dff2b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class XMLJAXBElementProvider extends AbstractJAXBElementProvider {
-
- // Delay construction of factory
- private final Injectable<SAXParserFactory> spf;
-
- public XMLJAXBElementProvider(Injectable<SAXParserFactory> spf, Providers ps) {
- super(ps);
-
- this.spf = spf;
- }
-
- public XMLJAXBElementProvider(Injectable<SAXParserFactory> spf, Providers ps, MediaType mt) {
- super(ps, mt);
-
- this.spf = spf;
- }
-
- @Produces("application/xml")
- @Consumes("application/xml")
- public static final class App extends XMLJAXBElementProvider {
- public App(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps , MediaType.APPLICATION_XML_TYPE);
- }
- }
-
- @Produces("text/xml")
- @Consumes("text/xml")
- public static final class Text extends XMLJAXBElementProvider {
- public Text(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps , MediaType.TEXT_XML_TYPE);
- }
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends XMLJAXBElementProvider {
- public General(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps);
- }
-
- @Override
- protected boolean isSupported(MediaType m) {
- return m.getSubtype().endsWith("+xml");
- }
- }
-
- protected final JAXBElement<?> readFrom(Class<?> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException {
- return u.unmarshal(getSAXSource(spf.getValue(), entityStream), type);
- }
-
- protected final void writeTo(JAXBElement<?> t, MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException {
- m.marshal(t, entityStream);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.java
deleted file mode 100644
index 66e89a513eb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.jaxb.AbstractListElementProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-import java.util.Collection;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class XMLListElementProvider extends AbstractListElementProvider {
-
- // Delay construction of factory
- private final Injectable<XMLInputFactory> xif;
-
- XMLListElementProvider(Injectable<XMLInputFactory> xif, Providers ps) {
- super(ps);
-
- this.xif = xif;
- }
-
- XMLListElementProvider(Injectable<XMLInputFactory> xif, Providers ps, MediaType mt) {
- super(ps, mt);
-
- this.xif = xif;
- }
-
- @Produces("application/xml")
- @Consumes("application/xml")
- public static final class App extends XMLListElementProvider {
- public App(@Context Injectable<XMLInputFactory> xif, @Context Providers ps) {
- super(xif, ps , MediaType.APPLICATION_XML_TYPE);
- }
- }
-
- @Produces("text/xml")
- @Consumes("text/xml")
- public static final class Text extends XMLListElementProvider {
- public Text(@Context Injectable<XMLInputFactory> xif, @Context Providers ps) {
- super(xif, ps , MediaType.TEXT_XML_TYPE);
- }
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends XMLListElementProvider {
- public General(@Context Injectable<XMLInputFactory> xif, @Context Providers ps) {
- super(xif, ps);
- }
-
- @Override
- protected boolean isSupported(MediaType m) {
- return m.getSubtype().endsWith("+xml");
- }
- }
-
- @Override
- protected final XMLStreamReader getXMLStreamReader(Class<?> elementType,
- MediaType mediaType,
- Unmarshaller u,
- InputStream entityStream)
- throws XMLStreamException {
- return xif.getValue().createXMLStreamReader(entityStream);
- }
-
- public final void writeList(Class<?> elementType, Collection<?> t,
- MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException, IOException {
- final String rootElement = getRootElementName(elementType);
- final String cName = c.name();
-
- entityStream.write(
- String.format("<?xml version=\"1.0\" encoding=\"%s\" standalone=\"yes\"?>", cName).getBytes(cName));
- String property = "com.sun.xml.bind.xmlHeaders";
- String header;
- try {
- header = (String) m.getProperty(property);
- } catch (PropertyException e) {
- property = "com.sun.xml.internal.bind.xmlHeaders";
- header = (String) m.getProperty(property);
- }
- if (header != null) {
- m.setProperty(property, "");
- entityStream.write(header.getBytes(cName));
- }
- entityStream.write(String.format("<%s>", rootElement).getBytes(cName));
- for (Object o : t)
- m.marshal(o, entityStream);
-
- entityStream.write(String.format("</%s>", rootElement).getBytes(cName));
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.java
deleted file mode 100644
index 04cf22bfa03..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import java.io.InputStream;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.sax.SAXSource;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class XMLRootElementProvider extends AbstractRootElementProvider {
-
- // Delay construction of factory
- private final Injectable<SAXParserFactory> spf;
-
- XMLRootElementProvider(Injectable<SAXParserFactory> spf, Providers ps) {
- super(ps);
-
- this.spf = spf;
- }
-
- XMLRootElementProvider(Injectable<SAXParserFactory> spf, Providers ps, MediaType mt) {
- super(ps, mt);
-
- this.spf = spf;
- }
-
- @Produces("application/xml")
- @Consumes("application/xml")
- public static final class App extends XMLRootElementProvider {
-
- public App(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps, MediaType.APPLICATION_XML_TYPE);
- }
- }
-
- @Produces("text/xml")
- @Consumes("text/xml")
- public static final class Text extends XMLRootElementProvider {
-
- public Text(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps, MediaType.TEXT_XML_TYPE);
- }
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends XMLRootElementProvider {
-
- public General(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps);
- }
-
- @Override
- protected boolean isSupported(MediaType m) {
- return m.getSubtype().endsWith("+xml");
- }
- }
-
- @Override
- protected Object readFrom(Class<Object> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException {
- final SAXSource s = getSAXSource(spf.getValue(), entityStream);
- if (type.isAnnotationPresent(XmlRootElement.class)) {
- return u.unmarshal(s);
- } else {
- return u.unmarshal(s, type).getValue();
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.java
deleted file mode 100644
index cdfb6d77245..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.entity;
-
-import com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.spi.inject.Injectable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class XMLRootObjectProvider extends AbstractJAXBProvider<Object> {
-
- // Delay construction of factory
- private final Injectable<SAXParserFactory> spf;
-
- XMLRootObjectProvider(Injectable<SAXParserFactory> spf, Providers ps) {
- super(ps);
-
- this.spf = spf;
- }
-
- XMLRootObjectProvider(Injectable<SAXParserFactory> spf, Providers ps, MediaType mt) {
- super(ps, mt);
-
- this.spf = spf;
- }
-
- @Override
- protected JAXBContext getStoredJAXBContext(Class type) throws JAXBException {
- return null;
- }
-
- @Produces("application/xml")
- @Consumes("application/xml")
- public static final class App extends XMLRootObjectProvider {
- public App(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps , MediaType.APPLICATION_XML_TYPE);
- }
- }
-
- @Produces("text/xml")
- @Consumes("text/xml")
- public static final class Text extends XMLRootObjectProvider {
- public Text(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps , MediaType.TEXT_XML_TYPE);
- }
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends XMLRootObjectProvider {
- public General(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(spf, ps);
- }
-
- @Override
- protected boolean isSupported(MediaType m) {
- return m.getSubtype().endsWith("+xml");
- }
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- try {
- return Object.class == type && isSupported(mediaType) && getUnmarshaller(type, mediaType) != null;
- } catch (JAXBException cause) {
- throw new RuntimeException(ImplMessages.ERROR_UNMARSHALLING_JAXB(type), cause);
- }
- }
-
- public Object readFrom(
- Class<Object> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- return getUnmarshaller(type, mediaType).
- unmarshal(getSAXSource(spf.getValue(), entityStream));
- } catch (UnmarshalException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (JAXBException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- public boolean isWriteable(Class<?> arg0, Type arg1, Annotation[] arg2, MediaType mediaType) {
- return false;
- }
-
- public void writeTo(Object arg0, Class<?> arg1, Type arg2, Annotation[] arg3,
- MediaType arg4, MultivaluedMap<String, Object> arg5, OutputStream arg6)
- throws IOException, WebApplicationException {
- throw new IllegalArgumentException();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CacheControlProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CacheControlProvider.java
deleted file mode 100644
index 399a85824ad..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CacheControlProvider.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import java.text.ParseException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import javax.ws.rs.core.CacheControl;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- * @author hubick@dev.java.net
- */
-public final class CacheControlProvider implements HeaderDelegateProvider<CacheControl> {
- private static final Pattern WHITESPACE = Pattern.compile("\\s");
-
- private static final Pattern COMMA_SEPARATED_LIST = Pattern.compile("[\\s]*,[\\s]*");
-
- public boolean supports(Class<?> type) {
- return type == CacheControl.class;
- }
-
- public String toString(CacheControl header) {
- StringBuffer b = new StringBuffer();
- if (header.isPrivate())
- appendQuotedWithSeparator(b, "private", buildListValue(header.getPrivateFields()));
- if (header.isNoCache())
- appendQuotedWithSeparator(b, "no-cache", buildListValue(header.getNoCacheFields()));
- if (header.isNoStore())
- appendWithSeparator(b, "no-store");
- if (header.isNoTransform())
- appendWithSeparator(b, "no-transform");
- if (header.isMustRevalidate())
- appendWithSeparator(b, "must-revalidate");
- if (header.isProxyRevalidate())
- appendWithSeparator(b, "proxy-revalidate");
- if (header.getMaxAge() != -1)
- appendWithSeparator(b, "max-age", header.getMaxAge());
- if (header.getSMaxAge() != -1)
- appendWithSeparator(b, "s-maxage", header.getSMaxAge());
-
- for (Map.Entry<String, String> e : header.getCacheExtension().entrySet()) {
- appendWithSeparator(b, e.getKey(), quoteIfWhitespace(e.getValue()));
- }
-
- return b.toString();
- }
-
- private void readFieldNames(List<String> fieldNames, HttpHeaderReader reader, String directiveName)
- throws ParseException {
- if (!reader.hasNextSeparator('=', false))
- return;
- reader.nextSeparator('=');
- fieldNames.addAll(Arrays.asList(COMMA_SEPARATED_LIST.split(reader.nextQuotedString())));
- return;
- }
-
- private int readIntValue(HttpHeaderReader reader, String directiveName)
- throws ParseException {
- reader.nextSeparator('=');
- int index = reader.getIndex();
- try {
- return Integer.parseInt(reader.nextToken());
- } catch (NumberFormatException nfe) {
- ParseException pe = new ParseException(
- "Error parsing integer value for " + directiveName + " directive", index);
- pe.initCause(nfe);
- throw pe;
- }
- }
-
- private void readDirective(CacheControl cacheControl,
- HttpHeaderReader reader) throws ParseException {
- String directiveName = reader.nextToken();
- if (directiveName.equalsIgnoreCase("private")) {
- cacheControl.setPrivate(true);
- readFieldNames(cacheControl.getPrivateFields(), reader, directiveName);
- } else if (directiveName.equalsIgnoreCase("public")) {
- // CacheControl API doesn't support 'public' for some reason.
- cacheControl.getCacheExtension().put(directiveName, null);
- } else if (directiveName.equalsIgnoreCase("no-cache")) {
- cacheControl.setNoCache(true);
- readFieldNames(cacheControl.getNoCacheFields(), reader, directiveName);
- } else if (directiveName.equalsIgnoreCase("no-store")) {
- cacheControl.setNoStore(true);
- } else if (directiveName.equalsIgnoreCase("no-transform")) {
- cacheControl.setNoTransform(true);
- } else if (directiveName.equalsIgnoreCase("must-revalidate")) {
- cacheControl.setMustRevalidate(true);
- } else if (directiveName.equalsIgnoreCase("proxy-revalidate")) {
- cacheControl.setProxyRevalidate(true);
- } else if (directiveName.equalsIgnoreCase("max-age")) {
- cacheControl.setMaxAge(readIntValue(reader, directiveName));
- } else if (directiveName.equalsIgnoreCase("s-maxage")) {
- cacheControl.setSMaxAge(readIntValue(reader, directiveName));
- } else {
- String value = null;
- if (reader.hasNextSeparator('=', false)) {
- reader.nextSeparator('=');
- value = reader.nextTokenOrQuotedString();
- }
- cacheControl.getCacheExtension().put(directiveName, value);
- }
- return;
- }
-
- public CacheControl fromString(String header) {
- if (header == null)
- throw new IllegalArgumentException("Cache control is null");
- try {
- HttpHeaderReader reader = HttpHeaderReader.newInstance(header);
- CacheControl cacheControl = new CacheControl();
- cacheControl.setNoTransform(false); // defaults to true
- while (reader.hasNext()) {
- readDirective(cacheControl, reader);
- if (reader.hasNextSeparator(',', true))
- reader.nextSeparator(',');
- }
- return cacheControl;
- } catch (ParseException pe) {
- throw new IllegalArgumentException(
- "Error parsing cache control '" + header + "'", pe);
- }
- }
-
- private void appendWithSeparator(StringBuffer b, String field) {
- if (b.length()>0)
- b.append(", ");
- b.append(field);
- }
-
- private void appendQuotedWithSeparator(StringBuffer b, String field, String value) {
- appendWithSeparator(b, field);
- if (value != null && value.length() > 0) {
- b.append("=\"");
- b.append(value);
- b.append("\"");
- }
- }
-
- private void appendWithSeparator(StringBuffer b, String field, String value) {
- appendWithSeparator(b, field);
- if (value != null && value.length() > 0) {
- b.append("=");
- b.append(value);
- }
- }
-
- private void appendWithSeparator(StringBuffer b, String field, int value) {
- appendWithSeparator(b, field);
- b.append("=");
- b.append(value);
- }
-
- private String buildListValue(List<String> values) {
- StringBuffer b = new StringBuffer();
- for (String value: values)
- appendWithSeparator(b, value);
- return b.toString();
- }
-
- private String quoteIfWhitespace(String value) {
- if (value==null)
- return null;
- Matcher m = WHITESPACE.matcher(value);
- if (m.find()) {
- return "\""+value+"\"";
- }
- return value;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CookieProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CookieProvider.java
deleted file mode 100644
index 0c89a5a54b8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/CookieProvider.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import javax.ws.rs.core.Cookie;
-
-public class CookieProvider implements HeaderDelegateProvider<Cookie> {
-
- public boolean supports(Class<?> type) {
- return type == Cookie.class;
- }
-
- public String toString(Cookie cookie) {
- StringBuilder b = new StringBuilder();
-
- b.append("$Version=").append(cookie.getVersion()).append(';');
-
- b.append(cookie.getName()).append('=');
- WriterUtil.appendQuotedIfWhitespace(b, cookie.getValue());
-
- if (cookie.getDomain() != null) {
- b.append(";$Domain=");
- WriterUtil.appendQuotedIfWhitespace(b, cookie.getDomain());
- }
- if (cookie.getPath() != null) {
- b.append(";$Path=");
- WriterUtil.appendQuotedIfWhitespace(b, cookie.getPath());
- }
- return b.toString();
- }
-
- public Cookie fromString(String header) {
- if (header == null)
- throw new IllegalArgumentException();
-
- return HttpHeaderReader.readCookie(header);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/DateProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/DateProvider.java
deleted file mode 100644
index 427f4281a1d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/DateProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.HttpDateFormat;
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import java.text.ParseException;
-import java.util.Date;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class DateProvider implements HeaderDelegateProvider<Date> {
-
- public boolean supports(Class<?> type) {
- return Date.class.isAssignableFrom(type);
- }
-
- public String toString(Date header) {
- return HttpDateFormat.getPreferedDateFormat().format(header);
- }
-
- public Date fromString(String header) {
- try {
- return HttpHeaderReader.readDate(header);
- } catch (ParseException ex) {
- throw new IllegalArgumentException(
- "Error parsing date '" + header + "'", ex);
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/EntityTagProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/EntityTagProvider.java
deleted file mode 100644
index 0dc38529390..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/EntityTagProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.core.header.reader.HttpHeaderReader.Event;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import java.text.ParseException;
-import javax.ws.rs.core.EntityTag;
-
-/**
- *
- * @author Marc.Hadley@Sun.Com
- */
-public class EntityTagProvider implements HeaderDelegateProvider<EntityTag> {
-
- public boolean supports(Class<?> type) {
- return type == EntityTag.class;
- }
-
- public String toString(EntityTag header) {
- StringBuilder b = new StringBuilder();
- if (header.isWeak())
- b.append("W/");
- WriterUtil.appendQuoted(b,header.getValue());
- return b.toString();
- }
-
- public EntityTag fromString(String header) {
- if (header == null)
- throw new IllegalArgumentException("Entity tag is null");
-
- try {
- HttpHeaderReader reader = HttpHeaderReader.newInstance(header);
- Event e = reader.next(false);
- if (e == Event.QuotedString) {
- return new EntityTag(reader.getEventValue());
- } else if (e == Event.Token) {
- if (reader.getEventValue().equals("W")) {
- reader.nextSeparator('/');
- return new EntityTag(reader.nextQuotedString(), true);
- }
- }
- } catch (ParseException ex) {
- throw new IllegalArgumentException(
- "Error parsing entity tag '" + header + "'", ex);
- }
-
- throw new IllegalArgumentException(
- "Error parsing entity tag '" + header + "'");
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.java
deleted file mode 100644
index 2f75cbe8d3e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.LinkHeader;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-
-/**
- * Provider for Link Headers.
- *
- * @author Santiago.PericasGeertsen@Sun.Com
- */
-public class LinkHeaderProvider implements HeaderDelegateProvider<LinkHeader> {
-
- public boolean supports(Class<?> type) {
- return LinkHeader.class.isAssignableFrom(type);
- }
-
- public LinkHeader fromString(String value) throws IllegalArgumentException {
- return LinkHeader.valueOf(value);
- }
-
- public String toString(LinkHeader value) {
- return value.toString();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LocaleProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LocaleProvider.java
deleted file mode 100644
index 793162a8f6c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/LocaleProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.LanguageTag;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import java.text.ParseException;
-import java.util.Locale;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class LocaleProvider implements HeaderDelegateProvider<Locale> {
-
- public boolean supports(Class<?> type) {
- return Locale.class.isAssignableFrom(type);
- }
-
- public String toString(Locale header) {
- if (header.getCountry().length() == 0) {
- return header.getLanguage();
- } else {
- StringBuilder sb = new StringBuilder(header.getLanguage());
- return sb.append('-').append(header.getCountry()).toString();
- }
- }
-
- public Locale fromString(String header) {
- try {
- LanguageTag lt = new LanguageTag(header);
- return lt.getAsLocale();
- } catch (ParseException ex) {
- throw new IllegalArgumentException(
- "Error parsing date '" + header + "'", ex);
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.java
deleted file mode 100644
index 142350c0a39..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import java.text.ParseException;
-import java.util.Map;
-import javax.ws.rs.core.MediaType;
-
-/**
- *
- * @author Marc.Hadley@Sun.Com
- */
-public class MediaTypeProvider implements HeaderDelegateProvider<MediaType> {
-
- @Override
- public boolean supports(Class<?> type) {
- return MediaType.class.isAssignableFrom(type);
- }
-
- @Override
- public String toString(MediaType header) {
- StringBuilder b = new StringBuilder();
- b.append(header.getType()).append('/').append(header.getSubtype());
- for (Map.Entry<String, String> e : header.getParameters().entrySet()) {
- b.append("; ").append(e.getKey()).append('=');
- WriterUtil.appendQuotedIfWhiteSpaceOrQuote(b, e.getValue());
- }
- return b.toString();
- }
-
- @Override
- public MediaType fromString(String header) {
- if (header == null)
- throw new IllegalArgumentException("Media type is null");
-
- try {
- return valueOf(HttpHeaderReader.newInstance(header));
- } catch (ParseException ex) {
- throw new IllegalArgumentException(
- "Error parsing media type '" + header + "'", ex);
- }
- }
-
- public static MediaType valueOf(HttpHeaderReader reader) throws ParseException {
- // Skip any white space
- reader.hasNext();
-
- // Get the type
- String type = reader.nextToken();
- reader.nextSeparator('/');
- // Get the subtype
- String subType = reader.nextToken();
-
- Map<String, String> params = null;
-
- if (reader.hasNext())
- params = HttpHeaderReader.readParameters(reader);
-
- return new MediaType(type, subType, params);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/NewCookieProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/NewCookieProvider.java
deleted file mode 100644
index 553a990e27e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/NewCookieProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import javax.ws.rs.core.NewCookie;
-
-public class NewCookieProvider implements HeaderDelegateProvider<NewCookie> {
-
- public boolean supports(Class<?> type) {
- return type == NewCookie.class;
- }
-
- public String toString(NewCookie cookie) {
- StringBuilder b = new StringBuilder();
-
- b.append(cookie.getName()).append('=');
- WriterUtil.appendQuotedIfWhitespace(b, cookie.getValue());
-
- b.append(";").append("Version=").append(cookie.getVersion());
-
- if (cookie.getComment() != null) {
- b.append(";Comment=");
- WriterUtil.appendQuotedIfWhitespace(b, cookie.getComment());
- }
- if (cookie.getDomain() != null) {
- b.append(";Domain=");
- WriterUtil.appendQuotedIfWhitespace(b, cookie.getDomain());
- }
- if (cookie.getPath() != null) {
- b.append(";Path=");
- WriterUtil.appendQuotedIfWhitespace(b, cookie.getPath());
- }
- if (cookie.getMaxAge()!=-1) {
- b.append(";Max-Age=");
- b.append(cookie.getMaxAge());
- }
- if (cookie.isSecure())
- b.append(";Secure");
- return b.toString();
- }
-
- public NewCookie fromString(String header) {
- if (header == null)
- throw new IllegalArgumentException("NewCookie is null");
-
- return HttpHeaderReader.readNewCookie(header);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/StringProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/StringProvider.java
deleted file mode 100644
index 0df820aead4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/StringProvider.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.spi.HeaderDelegateProvider;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class StringProvider implements HeaderDelegateProvider<String> {
-
- public boolean supports(Class<?> type) {
- return type == String.class;
- }
-
- public String toString(String header) {
- return header;
- }
-
- public String fromString(String header) {
- return header;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/URIProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/URIProvider.java
deleted file mode 100644
index b2ca87ffdcf..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/URIProvider.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class URIProvider implements HeaderDelegateProvider<URI> {
-
- public boolean supports(Class<?> type) {
- return type == URI.class;
- }
-
- public String toString(URI header) {
- return header.toASCIIString();
- }
-
- public URI fromString(String header) {
- try {
- return new URI(header);
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException(
- "Error parsing uri '" + header + "'", e);
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/WriterUtil.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/WriterUtil.java
deleted file mode 100644
index 66ffc3b8d94..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/header/WriterUtil.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.header;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- *
- * @author Marc.Hadley@Sun.Com
- */
-public class WriterUtil {
-
- private static Pattern whitespace = Pattern.compile("\\s");
-
- private static Pattern whitespaceOrQuote = Pattern.compile("[\\s\"]");
-
- public static void appendQuotedIfWhiteSpaceOrQuote(StringBuilder b, String value) {
- if (value==null)
- return;
- Matcher m = whitespaceOrQuote.matcher(value);
- boolean quote = m.find();
- if (quote)
- b.append('"');
- appendEscapingQuotes(b, value);
- if (quote)
- b.append('"');
- }
-
- public static void appendQuotedIfWhitespace(StringBuilder b, String value) {
- if (value==null)
- return;
- Matcher m = whitespace.matcher(value);
- boolean quote = m.find();
- if (quote)
- b.append('"');
- appendEscapingQuotes(b, value);
- if (quote)
- b.append('"');
- }
-
- public static void appendQuoted(StringBuilder b, String value) {
- b.append('"');
- appendEscapingQuotes(b, value);
- b.append('"');
- }
-
- public static void appendEscapingQuotes(StringBuilder b, String value) {
- for (int i = 0; i < value.length(); i++) {
- char c = value.charAt(i);
- if (c == '"')
- b.append('\\');
- b.append(c);
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.java
deleted file mode 100644
index be5f1aebc4b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.xml;
-
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import java.util.logging.Logger;
-import javax.ws.rs.core.Context;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class DocumentBuilderFactoryProvider extends ThreadLocalSingletonContextProvider<DocumentBuilderFactory> {
- private static final Logger LOGGER = Logger.getLogger(
- DocumentBuilderFactoryProvider.class.getName());
-
- private final boolean disableXmlSecurity;
-
- public DocumentBuilderFactoryProvider(@Context FeaturesAndProperties fps) {
- super(DocumentBuilderFactory.class);
-
- disableXmlSecurity = fps.getFeature(FeaturesAndProperties.FEATURE_DISABLE_XML_SECURITY);
- }
-
- @Override
- protected DocumentBuilderFactory getInstance() {
- DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
-
- f.setNamespaceAware(true);
-
- if (!disableXmlSecurity) {
- f.setExpandEntityReferences(false);
- }
-
- return f;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.java
deleted file mode 100644
index 93f825360b6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.xml;
-
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import java.lang.reflect.Type;
-import java.util.concurrent.atomic.AtomicReference;
-import javax.ws.rs.core.Context;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class LazySingletonContextProvider<T> implements InjectableProvider<Context, Type> {
- private final Class<T> t;
-
- private final AtomicReference<T> rf = new AtomicReference<T>();
-
- protected LazySingletonContextProvider(Class<T> t) {
- this.t = t;
- }
-
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public Injectable<T> getInjectable(ComponentContext ic, Context a, Type c) {
- if (c == t) {
- return new Injectable<T>() {
- public T getValue() {
- return get();
- }
- };
- } else {
- return null;
- }
- }
-
- private T get() {
- T f = rf.get();
- if (f == null) {
- T nf = getInstance();
- // configure
- rf.compareAndSet(null, nf);
- f = rf.get();
- }
- return f;
- }
-
- protected abstract T getInstance();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.java
deleted file mode 100644
index 307bc002dfc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.xml;
-
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.core.Context;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class SAXParserContextProvider extends ThreadLocalSingletonContextProvider<SAXParserFactory> {
- private static final Logger LOGGER = Logger.getLogger(
- SAXParserContextProvider.class.getName());
-
- private final boolean disableXmlSecurity;
-
- public SAXParserContextProvider(@Context FeaturesAndProperties fps) {
- super(SAXParserFactory.class);
-
- disableXmlSecurity = fps.getFeature(FeaturesAndProperties.FEATURE_DISABLE_XML_SECURITY);
- }
-
- @Override
- protected SAXParserFactory getInstance() {
- SAXParserFactory f = SAXParserFactory.newInstance();
-
- f.setNamespaceAware(true);
-
- if (!disableXmlSecurity) {
- try {
- f.setFeature("http://xml.org/sax/features/external-general-entities", Boolean.FALSE);
- } catch (Exception ex) {
- throw new RuntimeException("Security features for the SAX parser could not be enabled", ex);
- }
-
- try {
- f.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
- } catch (Exception ex) {
- LOGGER.log(Level.WARNING,
- "JAXP feature XMLConstants.FEATURE_SECURE_PROCESSING cannot be set on a SAXParserFactory. " +
- "External general entity processing is disabled but other potential security related" +
- " features will not be enabled.",
- ex);
- }
- }
-
- return f;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.java
deleted file mode 100644
index ae642cbc25e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.impl.provider.xml;
-
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.Context;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class ThreadLocalSingletonContextProvider<T> implements InjectableProvider<Context, Type> {
-
- private final Class<T> t;
-
- private final ThreadLocal<T> rf;
-
- protected ThreadLocalSingletonContextProvider(Class<T> t) {
- this.t = t;
- this.rf = new ThreadLocal<T>() {
- @Override
- protected synchronized T initialValue() {
- return getInstance();
- }
- };
- }
-
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public Injectable<T> getInjectable(ComponentContext ic, Context a, Type c) {
- if (c == t) {
- return new Injectable<T>() {
- public T getValue() {
- return rf.get();
- }
- };
- } else {
- return null;
- }
- }
-
- protected abstract T getInstance();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.java
deleted file mode 100644
index d327783a14e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.xml;
-
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import javax.ws.rs.core.Context;
-import javax.xml.transform.TransformerFactory;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class TransformerFactoryProvider extends ThreadLocalSingletonContextProvider<TransformerFactory> {
- private final boolean disableXmlSecurity;
-
- public TransformerFactoryProvider(@Context FeaturesAndProperties fps) {
- super(TransformerFactory.class);
-
- disableXmlSecurity = fps.getFeature(FeaturesAndProperties.FEATURE_DISABLE_XML_SECURITY);
- }
-
- @Override
- protected TransformerFactory getInstance() {
- TransformerFactory f = TransformerFactory.newInstance();
-
- if (!disableXmlSecurity) {
- // TODO ?
- }
-
- return f;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.java
deleted file mode 100644
index 0b7869dbdad..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.impl.provider.xml;
-
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import javax.ws.rs.core.Context;
-import javax.xml.stream.XMLInputFactory;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class XMLStreamReaderContextProvider extends ThreadLocalSingletonContextProvider<XMLInputFactory> {
- private final boolean disableXmlSecurity;
-
-
- public XMLStreamReaderContextProvider(@Context FeaturesAndProperties fps) {
- super(XMLInputFactory.class);
-
- disableXmlSecurity = fps.getFeature(FeaturesAndProperties.FEATURE_DISABLE_XML_SECURITY);
- }
-
- @Override
- protected XMLInputFactory getInstance() {
- XMLInputFactory f = XMLInputFactory.newInstance();
-
- if (!disableXmlSecurity) {
- f.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES,
- Boolean.FALSE);
- }
-
- return f;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/Activator.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/Activator.java
deleted file mode 100644
index aaaec69970c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/Activator.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/**
- * 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 com.sun.jersey.core.osgi;
-
-import com.sun.jersey.core.spi.scanning.PackageNamesScanner;
-import com.sun.jersey.core.spi.scanning.uri.BundleSchemeScanner;
-import com.sun.jersey.core.spi.scanning.uri.UriSchemeScanner;
-import com.sun.jersey.impl.SpiMessages;
-import com.sun.jersey.spi.service.ServiceConfigurationError;
-import com.sun.jersey.spi.service.ServiceFinder;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.SynchronousBundleListener;
-
-public class Activator implements BundleActivator, SynchronousBundleListener {
-
- private static final Logger LOGGER = Logger.getLogger(Activator.class.getName());
-
- private BundleContext bundleContext;
-
- private ConcurrentMap<Long, Map<String, Callable<List<Class>>>> factories = new ConcurrentHashMap<Long, Map<String, Callable<List<Class>>>>();
-
- private static final class OsgiServiceFinder<T> extends ServiceFinder.ServiceIteratorProvider<T> {
-
- static final ServiceFinder.ServiceIteratorProvider defaultIterator = new ServiceFinder.DefaultServiceIteratorProvider();
-
- @Override
- public Iterator<T> createIterator(final Class<T> serviceClass, final String serviceName, ClassLoader loader, boolean ignoreOnClassNotFound) {
- final List<Class> providerClasses = OsgiLocator.locateAll(serviceName);
- if (!providerClasses.isEmpty()) {
- return new Iterator<T>() {
-
- Iterator<Class> it = providerClasses.iterator();
-
- @Override
- public boolean hasNext() {
- return it.hasNext();
- }
-
- @Override
- public T next() {
- Class<T> nextClass = it.next();
- try {
- return serviceClass.cast(nextClass.newInstance());
- } catch (Exception ex) {
- ServiceConfigurationError sce = new ServiceConfigurationError(serviceName + ": "
- + SpiMessages.PROVIDER_COULD_NOT_BE_CREATED(nextClass.getName(), serviceClass, ex.getLocalizedMessage()));
- sce.initCause(ex);
- throw sce;
- }
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }
- return defaultIterator.createIterator(serviceClass, serviceName, loader, ignoreOnClassNotFound);
- }
-
- @Override
- public Iterator<Class<T>> createClassIterator(Class<T> service, String serviceName, ClassLoader loader, boolean ignoreOnClassNotFound) {
- final List<Class> providerClasses = OsgiLocator.locateAll(serviceName);
- if (!providerClasses.isEmpty()) {
- return new Iterator<Class<T>>() {
-
- Iterator<Class> it = providerClasses.iterator();
-
- @Override
- public boolean hasNext() {
- return it.hasNext();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<T> next() {
- return it.next();
- }
-
- @Override
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }
- return defaultIterator.createClassIterator(service, serviceName, loader, ignoreOnClassNotFound);
- }
- }
-
-
- @Override
- public synchronized void start(final BundleContext bundleContext) throws Exception {
- LOGGER.log(Level.FINE, "Activating Jersey core bundle...");
-
- this.bundleContext = bundleContext;
-
- setOSGiPackageScannerResourceProvider();
- registerBundleSchemeScanner();
- setOSGiServiceFinderIteratorProvider();
-
- bundleContext.addBundleListener(this);
- registerExistingBundles();
-
- LOGGER.log(Level.FINE, "Jersey core bundle activated");
- }
-
-
- private void registerExistingBundles() {
- for (Bundle bundle : bundleContext.getBundles()) {
- if (bundle.getState() == Bundle.RESOLVED || bundle.getState() == Bundle.STARTING
- || bundle.getState() == Bundle.ACTIVE || bundle.getState() == Bundle.STOPPING) {
- register(bundle);
- }
- }
- }
-
- private void setOSGiPackageScannerResourceProvider() {
- PackageNamesScanner.setResourcesProvider(new PackageNamesScanner.ResourcesProvider() {
-
- @Override
- public Enumeration<URL> getResources(String name, ClassLoader cl) throws IOException {
- List<URL> result = new LinkedList<URL>();
- for (Bundle b : bundleContext.getBundles()) {
- Enumeration<URL> e = (Enumeration<URL>)b.findEntries(name, "*", false);
- if (e != null) {
- result.addAll(Collections.list(e));
- }
- }
- return Collections.enumeration(result);
- }
- });
- }
-
- private void setOSGiServiceFinderIteratorProvider() {
- ServiceFinder.setIteratorProvider(new OsgiServiceFinder());
- }
-
- private void registerBundleSchemeScanner() {
- OsgiLocator.register(UriSchemeScanner.class.getName(), new Callable<List<Class>>(){
- @Override
- public List<Class> call() throws Exception {
- List<Class> result = new LinkedList<Class>();
- result.add(BundleSchemeScanner.class);
- return result;
- }
- });
- }
-
- @Override
- public synchronized void stop(BundleContext bundleContext) throws Exception {
- LOGGER.log(Level.FINE, "Deactivating Jersey core bundle...");
-
- bundleContext.removeBundleListener(this);
- while (!factories.isEmpty()) {
- unregister(factories.keySet().iterator().next());
- }
- LOGGER.log(Level.FINE, "Jersey core bundle deactivated");
- this.bundleContext = null;
- }
-
- @Override
- public void bundleChanged(BundleEvent event) {
- if (event.getType() == BundleEvent.RESOLVED) {
- register(event.getBundle());
- } else if (event.getType() == BundleEvent.UNRESOLVED || event.getType() == BundleEvent.UNINSTALLED) {
- unregister(event.getBundle().getBundleId());
- }
- }
-
- protected void register(final Bundle bundle) {
- if (LOGGER.isLoggable(Level.FINEST)) {
- LOGGER.log(Level.FINEST, "checking bundle " + bundle.getBundleId());
- }
- Map<String, Callable<List<Class>>> map = factories.get(bundle.getBundleId());
- Enumeration e = bundle.findEntries("META-INF/services/", "*", false);
- if (e != null) {
- while (e.hasMoreElements()) {
- final URL u = (URL) e.nextElement();
- final String url = u.toString();
- if (url.endsWith("/")) {
- continue;
- }
- final String factoryId = url.substring(url.lastIndexOf("/") + 1);
- if (map == null) {
- map = new HashMap<String, Callable<List<Class>>>();
- factories.put(bundle.getBundleId(), map);
- }
- map.put(factoryId, new BundleFactoryLoader(factoryId, u, bundle));
- }
- }
- if (map != null) {
- for (Map.Entry<String, Callable<List<Class>>> entry : map.entrySet()) {
- if (LOGGER.isLoggable(Level.FINEST)) {
- LOGGER.log(Level.FINEST, "registering service for key " + entry.getKey() + "with value " + entry.getValue());
- }
- OsgiLocator.register(entry.getKey(), entry.getValue());
- }
- }
- }
-
- protected void unregister(long bundleId) {
- Map<String, Callable<List<Class>>> map = factories.remove(bundleId);
- if (map != null) {
- for (Map.Entry<String, Callable<List<Class>>> entry : map.entrySet()) {
- if (LOGGER.isLoggable(Level.FINEST)) {
- LOGGER.log(Level.FINEST, "unregistering service for key " + entry.getKey() + "with value " + entry.getValue());
- }
- OsgiLocator.unregister(entry.getKey(), entry.getValue());
- }
- }
- }
-
- private class BundleFactoryLoader implements Callable<List<Class>> {
-
- private final String factoryId;
- private final URL u;
- private final Bundle bundle;
-
- public BundleFactoryLoader(String factoryId, URL u, Bundle bundle) {
- this.factoryId = factoryId;
- this.u = u;
- this.bundle = bundle;
- }
-
- @Override
- public List<Class> call() throws Exception {
- try {
- if (LOGGER.isLoggable(Level.FINEST)) {
- LOGGER.log(Level.FINEST, "creating factories for key: " + factoryId);
- }
- BufferedReader br = new BufferedReader(new InputStreamReader(u.openStream(), "UTF-8"));
- String factoryClassName;
- List<Class> factoryClasses = new ArrayList<Class>();
- while ((factoryClassName = br.readLine()) != null) {
- if (factoryClassName.trim().length() == 0) {
- continue;
- }
- if (LOGGER.isLoggable(Level.FINEST)) {
- LOGGER.log(Level.FINEST, "factory implementation: " + factoryClassName);
- }
- factoryClasses.add(bundle.loadClass(factoryClassName));
- }
- br.close();
- return factoryClasses;
- } catch (Exception e) {
- LOGGER.log(Level.WARNING, "exception caught while creating factories: " + e);
- throw e;
- } catch (Error e) {
- LOGGER.log(Level.WARNING, "error caught while creating factories: " + e);
- throw e;
- }
- }
-
- @Override
- public String toString() {
- return u.toString();
- }
-
- @Override
- public int hashCode() {
- return u.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof BundleFactoryLoader) {
- return u.equals(((BundleFactoryLoader) obj).u);
- } else {
- return false;
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/OsgiLocator.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/OsgiLocator.java
deleted file mode 100644
index c128bab008f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/osgi/OsgiLocator.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * 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 com.sun.jersey.core.osgi;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
-
-public class OsgiLocator {
-
- private static Map<String, List<Callable<List<Class>>>> factories = new HashMap<String, List<Callable<List<Class>>>>();
- private static ReadWriteLock lock = new ReentrantReadWriteLock();
-
- private OsgiLocator() {
- }
-
- public static void unregister(String id, Callable<List<Class>> factory) {
- lock.writeLock().lock();
- try {
- List<Callable<List<Class>>> l = factories.get(id);
- if (l != null) {
- l.remove(factory);
- }
- } finally {
- lock.writeLock().unlock();
- }
- }
-
- public static void register(String id, Callable<List<Class>> factory) {
- lock.writeLock().lock();
- try {
- List<Callable<List<Class>>> l = factories.get(id);
- if (l == null) {
- l = new ArrayList<Callable<List<Class>>>();
- factories.put(id, l);
- }
- l.add(factory);
- } finally {
- lock.writeLock().unlock();
- }
- }
-
- public static synchronized Class locate(String factoryId) {
- lock.readLock().lock();
- try {
- List<Callable<List<Class>>> l = factories.get(factoryId);
- if (l == null || l.isEmpty()) {
- return null;
- }
-
- Callable<List<Class>> c = l.get(l.size() - 1);
- List<Class> classes;
- try {
- classes = c.call();
- } catch (Exception e) {
- return null;
- }
-
- return classes.get(0);
- } finally {
- lock.readLock().unlock();
- }
- }
-
- public static synchronized List<Class> locateAll(String factoryId) {
- List<Class> classes = new ArrayList<Class>();
- List<Callable<List<Class>>> l = factories.get(factoryId);
- if (l == null) {
- return classes;
- }
-
- for (Callable<List<Class>> c : l) {
- try {
- classes.addAll(c.call());
- } catch (Exception e) {
- }
- }
- return classes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.java
deleted file mode 100644
index a9adf7deca9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.provider;
-
-import com.sun.jersey.core.util.ReaderWriter;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.io.Writer;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.nio.charset.Charset;
-import javax.ws.rs.core.MediaType;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractMessageReaderWriterProvider<T> implements
- MessageBodyReader<T>, MessageBodyWriter<T> {
-
- /**
- * The UTF-8 Charset.
- */
- public static final Charset UTF8 = ReaderWriter.UTF8;
-
- /**
- * Reader bytes from an input stream and write then to an output stream.
- *
- * @param in the input stream to read from.
- * @param out the output stream to write to.
- * @throws IOException if there is an error reading or writing bytes.
- */
- public static final void writeTo(InputStream in, OutputStream out) throws IOException {
- ReaderWriter.writeTo(in, out);
- }
-
- /**
- * Reader characters from an input stream and write then to an output stream.
- *
- * @param in the reader to read from.
- * @param out the writer to write to.
- * @throws IOException if there is an error reading or writing characters.
- */
- public static final void writeTo(Reader in, Writer out) throws IOException {
- ReaderWriter.writeTo(in, out);
- }
-
- /**
- * Get the character set from a media type.
- * <p>
- * The character set is obtained from the media type parameter "charset".
- * If the parameter is not present the {@link #UTF8} charset is utilized.
- *
- * @param m the media type.
- * @return the character set.
- */
- public static final Charset getCharset(MediaType m) {
- return ReaderWriter.getCharset(m);
- }
-
- /**
- * Read the bytes of an input stream and convert to a string.
- *
- * @param in the input stream to read from.
- * @param type the media type that determines the character set defining
- * how to decode bytes to charaters.
- * @return the string.
- * @throws IOException if there is an error reading from the input stream.
- */
- public static final String readFromAsString(InputStream in,
- MediaType type) throws IOException {
- return ReaderWriter.readFromAsString(in, type);
- }
-
- /**
- * Convert a string to bytes and write those bytes to an output stream.
- *
- * @param s the string to convert to bytes.
- * @param out the output stream to write to.
- * @param type the media type that determines the character set defining
- * how to decode bytes to characters.
- * @throws IOException
- */
- public static final void writeToAsString(String s, OutputStream out,
- MediaType type) throws IOException {
- ReaderWriter.writeToAsString(s, out, type);
- }
-
- // MessageBodyWriter
-
- public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/CompletableReader.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/CompletableReader.java
deleted file mode 100644
index 25e3321e8f1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/CompletableReader.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.provider;
-
-import javax.ws.rs.ext.MessageBodyReader;
-
-/**
- * A {@link MessageBodyReader} may implement this interface to signal that
- * reading from the underlying input stream can be fully completed.
- * <p>
- * This is useful in scenarios where an instance of the type will be processed
- * after the input stream, from which it was read, has been closed.
- *
- * @param <T> the type returned from a {@link MessageBodyReader}.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see MessageBodyReader
- */
-public interface CompletableReader<T> {
-
- /**
- * Complete the reading.
- *
- * @param t an instance of the Type <code>T</code>.
- * @return the complete instance of <code>T</code>.
- */
- T complete(T t);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/EntityHolder.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/EntityHolder.java
deleted file mode 100644
index 630e6072664..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/EntityHolder.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.provider;
-
-/**
- * A holder for an entity of a request consumed by the server or a response
- * consumed by a client.
- * <p>
- * Some clients/servers may send requests/responses with no entity or an
- * entity (for example WebDAV clients). To support such request or responses
- * The <code>EntityHolder</code> type may be used where the actual type
- * of the entity is declared as a type parameter.
- * <p>
- * For example a POST method that consumes a specific JAXB object,
- * <code>MyJAXBObject</code>, can determine if the request contained the
- * JAXB object or the request contained no entity, as follows:
- * <blockquote><pre>
- * &#64;POST
- * &#64;Consumes("text/plain")
- * public void post(EntityHolder&lt;MyJAXBObject&gt; s) {
- * if (s.hasEntity()) {
- * MyJAXBObject entity = s.getEntity();
- * } else {
- * ...
- * }
- * }
- * </pre></blockquote>
- * <p>
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class EntityHolder<T> {
- private final T t;
-
- /**
- * Create an entity holder containing no entity.
- */
- public EntityHolder() {
- this.t = null;
- }
-
- /**
- * Create an entity holder containing an entity.
- *
- * @param t the entity.
- */
- public EntityHolder(T t) {
- this.t = t;
- }
-
- /**
- *
- * @return true if there is an entity present, otherwise false.
- */
- public boolean hasEntity() {
- return t != null;
- }
-
- /**
- * Get the entity.
- * @return the entity if present, otherwise null if the entity is not
- * present.
- */
- public T getEntity() {
- return t;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.java
deleted file mode 100644
index 7d5b2db328e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.provider.jaxb;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.nio.charset.Charset;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.Unmarshaller;
-
-/**
- * An abstract provider for {@link JAXBElement}.
- * <p>
- * Implementing classes may extend this class to provide specific marshalling
- * and unmarshalling behaviour.
- * <p>
- * When unmarshalling a {@link UnmarshalException} will result in a
- * {@link WebApplicationException} being thrown with a status of 400
- * (Client error), and a {@link JAXBException} will result in a
- * {@link WebApplicationException} being thrown with a status of 500
- * (Internal Server error).
- * <p>
- * When marshalling a {@link JAXBException} will result in a
- * {@link WebApplicationException} being thrown with a status of 500
- * (Internal Server error).
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractJAXBElementProvider extends AbstractJAXBProvider<JAXBElement<?>> {
- public AbstractJAXBElementProvider(Providers ps) {
- super(ps);
- }
-
- public AbstractJAXBElementProvider(Providers ps, MediaType mt) {
- super(ps, mt);
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type == JAXBElement.class && genericType instanceof ParameterizedType && isSupported(mediaType);
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return JAXBElement.class.isAssignableFrom(type) && isSupported(mediaType);
- }
-
- @Override
- public final JAXBElement<?> readFrom(
- Class<JAXBElement<?>> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- final ParameterizedType pt = (ParameterizedType)genericType;
- final Class ta = (Class)pt.getActualTypeArguments()[0];
-
- try {
- return readFrom(ta, mediaType, getUnmarshaller(ta, mediaType), entityStream);
- } catch (UnmarshalException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (JAXBException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- protected abstract JAXBElement<?> readFrom(Class<?> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException;
-
-
- @Override
- public final void writeTo(
- JAXBElement<?> t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- final Marshaller m = getMarshaller(t.getDeclaredType(), mediaType);
- final Charset c = getCharset(mediaType);
- if (c != UTF8) {
- m.setProperty(Marshaller.JAXB_ENCODING, c.name());
- }
- setHeader(m, annotations);
- writeTo(t, mediaType, c, m, entityStream);
- } catch (JAXBException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- protected abstract void writeTo(JAXBElement<?> t, MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.java
deleted file mode 100644
index 32078a0a7d8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.provider.jaxb;
-
-import com.sun.jersey.api.provider.jaxb.XmlHeader;
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import javax.xml.bind.PropertyException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.sax.SAXSource;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.util.Map;
-import java.util.WeakHashMap;
-import org.xml.sax.InputSource;
-
-/**
- * A base class for implementing JAXB-based readers and writers.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractJAXBProvider<T> extends AbstractMessageReaderWriterProvider<T> {
- private static final Map<Class, JAXBContext> jaxbContexts =
- new WeakHashMap<Class, JAXBContext>();
-
- private final Providers ps;
-
- private final boolean fixedMediaType;
-
- private final ContextResolver<JAXBContext> mtContext;
-
- private final ContextResolver<Unmarshaller> mtUnmarshaller;
-
- private final ContextResolver<Marshaller> mtMarshaller;
-
- private boolean formattedOutput = false;
-
- private boolean xmlRootElementProcessing = false;
-
- public AbstractJAXBProvider(Providers ps) {
- this(ps, null);
- }
-
- public AbstractJAXBProvider(Providers ps, MediaType mt) {
- this.ps = ps;
-
- fixedMediaType = mt != null;
- if (fixedMediaType) {
- this.mtContext = ps.getContextResolver(JAXBContext.class, mt);
- this.mtUnmarshaller = ps.getContextResolver(Unmarshaller.class, mt);
- this.mtMarshaller = ps.getContextResolver(Marshaller.class, mt);
- } else {
- this.mtContext = null;
- this.mtUnmarshaller = null;
- this.mtMarshaller = null;
- }
- }
-
- @Context
- public void setConfiguration(FeaturesAndProperties fp) {
- formattedOutput = fp.getFeature(FeaturesAndProperties.FEATURE_FORMATTED);
- xmlRootElementProcessing = fp.getFeature(FeaturesAndProperties.FEATURE_XMLROOTELEMENT_PROCESSING);
- }
-
- protected boolean isSupported(MediaType m) {
- return true;
- }
-
- protected final Unmarshaller getUnmarshaller(Class type, MediaType mt) throws JAXBException {
- if (fixedMediaType)
- return getUnmarshaller(type);
-
- final ContextResolver<Unmarshaller> uncr = ps.getContextResolver(Unmarshaller.class, mt);
- if (uncr != null) {
- Unmarshaller u = uncr.getContext(type);
- if (u != null) return u;
- }
-
- return getJAXBContext(type, mt).createUnmarshaller();
- }
-
- private Unmarshaller getUnmarshaller(Class type) throws JAXBException {
- if (mtUnmarshaller != null) {
- Unmarshaller u = mtUnmarshaller.getContext(type);
- if (u != null) return u;
- }
-
- return getJAXBContext(type).createUnmarshaller();
- }
-
- protected final Marshaller getMarshaller(Class type, MediaType mt) throws JAXBException {
- if (fixedMediaType)
- return getMarshaller(type);
-
- final ContextResolver<Marshaller> mcr = ps.getContextResolver(Marshaller.class, mt);
- if (mcr != null) {
- Marshaller m = mcr.getContext(type);
- if (m != null) return m;
- }
-
- Marshaller m = getJAXBContext(type, mt).createMarshaller();
- if(formattedOutput)
- m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formattedOutput);
- return m;
-
- }
-
- private Marshaller getMarshaller(Class type) throws JAXBException {
- if (mtMarshaller != null) {
- Marshaller u = mtMarshaller.getContext(type);
- if (u != null) return u;
- }
-
- Marshaller m = getJAXBContext(type).createMarshaller();
- if(formattedOutput)
- m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formattedOutput);
- return m;
- }
-
- private JAXBContext getJAXBContext(Class type, MediaType mt) throws JAXBException {
- final ContextResolver<JAXBContext> cr = ps.getContextResolver(JAXBContext.class, mt);
- if (cr != null) {
- JAXBContext c = cr.getContext(type);
- if (c != null) return c;
- }
-
- return getStoredJAXBContext(type);
- }
-
- private JAXBContext getJAXBContext(Class type) throws JAXBException {
- if (mtContext != null) {
- JAXBContext c = mtContext.getContext(type);
- if (c != null) return c;
- }
-
- return getStoredJAXBContext(type);
- }
-
- protected JAXBContext getStoredJAXBContext(Class type) throws JAXBException {
- synchronized (jaxbContexts) {
- JAXBContext c = jaxbContexts.get(type);
- if (c == null) {
- c = JAXBContext.newInstance(type);
- jaxbContexts.put(type, c);
- }
- return c;
- }
- }
-
- protected static SAXSource getSAXSource(SAXParserFactory spf,
- InputStream entityStream) throws JAXBException {
- try {
- return new SAXSource(
- spf.newSAXParser().getXMLReader(),
- new InputSource(entityStream));
- } catch (Exception ex) {
- throw new JAXBException("Error creating SAXSource", ex);
- }
- }
-
- protected boolean isFormattedOutput() {
- return formattedOutput;
- }
-
- protected boolean isXmlRootElementProcessing() {
- return xmlRootElementProcessing;
- }
-
- protected void setHeader(Marshaller m, Annotation[] annotations) throws PropertyException {
- for (Annotation a : annotations) {
- if (a instanceof XmlHeader) {
- try {
- m.setProperty("com.sun.xml.bind.xmlHeaders", ((XmlHeader) a).value());
- } catch (PropertyException e) {
- m.setProperty("com.sun.xml.internal.bind.xmlHeaders", ((XmlHeader) a).value());
- }
- break;
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.java
deleted file mode 100644
index 786a2bd111e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.provider.jaxb;
-
-import com.sun.jersey.core.impl.provider.entity.Inflector;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import javax.xml.bind.JAXBElement;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-/**
- * An abstract provider for <code>T[]</code>, <code>Collection&lt;T&gt;</code>,
- * or <code>List&lt;T&gt;</code> where <code>T</code> is a JAXB types annotated with
- * {@link XmlRootElement}.
- * <p>
- * Implementing classes may extend this class to provide specific marshalling
- * and unmarshalling behaviour.
- * <p>
- * When unmarshalling a {@link UnmarshalException} will result in a
- * {@link WebApplicationException} being thrown with a status of 400
- * (Client error), and a {@link JAXBException} will result in a
- * {@link WebApplicationException} being thrown with a status of 500
- * (Internal Server error).
- * <p>
- * When marshalling a {@link JAXBException} will result in a
- * {@link WebApplicationException} being thrown with a status of 500
- * (Internal Server error).
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractListElementProvider extends AbstractJAXBProvider<Object> {
-
- public AbstractListElementProvider(Providers ps) {
- super(ps);
- }
-
- public AbstractListElementProvider(Providers ps, MediaType mt) {
- super(ps, mt);
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- if (type == List.class || type == Collection.class) {
- return verifyGenericType(genericType) && isSupported(mediaType);
- } else if (type.isArray()) {
- return verifyArrayType(type) && isSupported(mediaType);
- } else
- return false;
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- if (List.class.isAssignableFrom(type)) {
- return verifyGenericType(genericType) && isSupported(mediaType);
- } else if (type.isArray()) {
- return verifyArrayType(type) && isSupported(mediaType);
- } else
- return false;
- }
-
- private boolean verifyArrayType(Class type) {
- type = type.getComponentType();
-
- return type.isAnnotationPresent(XmlRootElement.class) ||
- type.isAnnotationPresent(XmlType.class) ||
- JAXBElement.class.isAssignableFrom(type);
- }
-
- private boolean verifyGenericType(Type genericType) {
- if (!(genericType instanceof ParameterizedType)) return false;
-
- final ParameterizedType pt = (ParameterizedType)genericType;
-
- if (pt.getActualTypeArguments().length > 1) return false;
-
- final Type ta = pt.getActualTypeArguments()[0];
-
- if (ta instanceof ParameterizedType) {
- ParameterizedType lpt = (ParameterizedType) ta;
- return (lpt.getRawType() instanceof Class) &&
- JAXBElement.class.isAssignableFrom((Class) lpt.getRawType());
- }
-
- if (!(pt.getActualTypeArguments()[0] instanceof Class)) return false;
-
- final Class listClass = (Class)pt.getActualTypeArguments()[0];
-
- return listClass.isAnnotationPresent(XmlRootElement.class) ||
- listClass.isAnnotationPresent(XmlType.class);
- }
-
- @Override
- public final void writeTo(
- Object t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- final Collection c = (type.isArray())
- ? Arrays.asList((Object[])t)
- : (Collection)t;
- final Class elementType = getElementClass(type, genericType);
- final Charset charset = getCharset(mediaType);
- final String charsetName = charset.name();
-
- final Marshaller m = getMarshaller(elementType, mediaType);
- m.setProperty(Marshaller.JAXB_FRAGMENT, true);
- if (charset != UTF8) {
- m.setProperty(Marshaller.JAXB_ENCODING, charsetName);
- }
- setHeader(m, annotations);
- writeList(elementType, c, mediaType, charset, m, entityStream);
- } catch (JAXBException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- /**
- * Write a collection of JAXB objects as child elements of the root element.
- *
- * @param elementType the element type in the collection.
- * @param t the collecton to marshall
- * @param mediaType the media type
- * @param c the charset
- * @param m the marshaller
- * @param entityStream the output stream to marshall the collection
- * @throws javax.xml.bind.JAXBException
- * @throws IOException
- */
- public abstract void writeList(Class<?> elementType, Collection<?> t,
- MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException, IOException;
-
- @Override
- public final Object readFrom(
- Class<Object> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- final Class elementType = getElementClass(type, genericType);
- final Unmarshaller u = getUnmarshaller(elementType, mediaType);
- final XMLStreamReader r = getXMLStreamReader(elementType, mediaType, u, entityStream);
- final List l = new ArrayList();
- boolean jaxbElement = false;
-
- // Move to root element
- int event = r.next();
- while (event != XMLStreamReader.START_ELEMENT)
- event = r.next();
-
- // Move to first child (if any)
- event = r.next();
- while (event != XMLStreamReader.START_ELEMENT &&
- event != XMLStreamReader.END_DOCUMENT)
- event = r.next();
-
- while (event != XMLStreamReader.END_DOCUMENT) {
- if (elementType.isAnnotationPresent(XmlRootElement.class)) {
- l.add(u.unmarshal(r));
- } else if (elementType.isAnnotationPresent(XmlType.class)) {
- l.add(u.unmarshal(r, elementType).getValue());
- } else {
- l.add(u.unmarshal(r, elementType));
- jaxbElement = true;
- }
-
- // Move to next peer (if any)
- event = r.getEventType();
- while (event != XMLStreamReader.START_ELEMENT &&
- event != XMLStreamReader.END_DOCUMENT)
- event = r.next();
- }
-
- return (type.isArray())
- ? createArray(l, jaxbElement ? JAXBElement.class : elementType)
- : l;
- } catch (UnmarshalException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (XMLStreamException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (JAXBException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- private Object createArray(List l, Class componentType) {
- Object array = Array.newInstance(componentType, l.size());
- for (int i = 0; i < l.size(); i++)
- Array.set(array, i, l.get(i));
- return array;
- }
-
- /**
- * Get the XMLStreamReader for unmarshalling.
- *
- * @param elementType the individual element type.
- * @param mediaType the media type.
- * @param unmarshaller the unmarshaller as a carrier of possible config options.
- * @param entityStream the input stream.
- * @return the XMLStreamReader.
- * @throws javax.xml.stream.XMLStreamException
- */
- protected abstract XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller unmarshaller,
- InputStream entityStream)
- throws XMLStreamException;
-
- protected Class getElementClass(Class<?> type, Type genericType) {
- Type ta;
- if (genericType instanceof ParameterizedType) {
- // List case
- ta = ((ParameterizedType) genericType).getActualTypeArguments()[0];
- } else if (genericType instanceof GenericArrayType) {
- // GenericArray case
- ta = ((GenericArrayType) genericType).getGenericComponentType();
- } else {
- // Array case
- ta = type.getComponentType();
- }
- if (ta instanceof ParameterizedType) {
- // JAXBElement case
- ta = ((ParameterizedType) ta).getActualTypeArguments()[0];
- }
- return (Class) ta;
- }
-
- private final Inflector inflector = Inflector.getInstance();
-
- private String convertToXmlName(final String name) {
- return name.replace("$", "_");
- }
-
- protected final String getRootElementName(Class<?> elementType) {
- if(isXmlRootElementProcessing()) {
- return convertToXmlName(inflector.pluralize(inflector.demodulize(getElementName(elementType))));
- } else {
- return convertToXmlName(inflector.decapitalize(inflector.pluralize(inflector.demodulize(elementType.getName()))));
- }
- }
-
- protected final String getElementName(Class<?> elementType) {
- String name = elementType.getName();
- XmlRootElement xre = elementType.getAnnotation(XmlRootElement.class);
- if (xre != null && !xre.name().equals("##default")) {
- name = xre.name();
- }
- return name;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.java
deleted file mode 100644
index 8662d6cd910..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.provider.jaxb;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.nio.charset.Charset;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.transform.stream.StreamSource;
-
-/**
- * An abstract provider for JAXB types that are annotated with
- * {@link XmlRootElement} or {@link XmlType}.
- * <p>
- * Implementing classes may extend this class to provide specific marshalling
- * and unmarshalling behaviour.
- * <p>
- * When unmarshalling a {@link UnmarshalException} will result in a
- * {@link WebApplicationException} being thrown with a status of 400
- * (Client error), and a {@link JAXBException} will result in a
- * {@link WebApplicationException} being thrown with a status of 500
- * (Internal Server error).
- * <p>
- * When marshalling a {@link JAXBException} will result in a
- * {@link WebApplicationException} being thrown with a status of 500
- * (Internal Server error).
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractRootElementProvider extends AbstractJAXBProvider<Object> {
- public AbstractRootElementProvider(Providers ps) {
- super(ps);
- }
-
- public AbstractRootElementProvider(Providers ps, MediaType mt) {
- super(ps, mt);
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return (type.getAnnotation(XmlRootElement.class) != null ||
- type.getAnnotation(XmlType.class) != null) && isSupported(mediaType);
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return type.getAnnotation(XmlRootElement.class) != null && isSupported(mediaType);
- }
-
- @Override
- public final Object readFrom(
- Class<Object> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
-
- try {
- return readFrom(type, mediaType, getUnmarshaller(type, mediaType), entityStream);
- } catch (UnmarshalException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- } catch (JAXBException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- /**
- * Unmarshal a JAXB type.
- * <p>
- * Implementing classes may override this method.
- *
- * @param type the JAXB type
- * @param mediaType the media type
- * @param u the unmarshaller to use for unmarshalling.
- * @param entityStream the input stream to unmarshal from.
- * @return an instance of the JAXB type.
- * @throws javax.xml.bind.JAXBException
- * @throws java.io.IOException
- */
- protected Object readFrom(Class<Object> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException {
- if (type.isAnnotationPresent(XmlRootElement.class))
- return u.unmarshal(entityStream);
- else
- return u.unmarshal(new StreamSource(entityStream), type).getValue();
- }
-
- @Override
- public final void writeTo(
- Object t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- final Marshaller m = getMarshaller(type, mediaType);
- final Charset c = getCharset(mediaType);
- if (c != UTF8) {
- m.setProperty(Marshaller.JAXB_ENCODING, c.name());
- }
- setHeader(m, annotations);
- writeTo(t, mediaType, c, m, entityStream);
- } catch (JAXBException ex) {
- throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR);
- }
- }
-
- /**
- * Marshal an instance of a JAXB type.
- * <p>
- * Implementing classes may override this method.
- *
- * @param t the instance of the JAXB type.
- * @param mediaType the meida type.
- * @param c the character set to serialize characters to.
- * @param m the marshaller to marshaller the instance of the JAXB type.
- * @param entityStream the output stream to marshal to.
- * @throws javax.xml.bind.JAXBException
- * @throws java.io.IOException
- */
- protected void writeTo(Object t, MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException {
- m.marshal(t, entityStream);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/package-info.java
deleted file mode 100644
index 9f228520cc7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/jaxb/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for JAXB-related message body readers and writers.
- */
-package com.sun.jersey.core.provider.jaxb;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/package-info.java
deleted file mode 100644
index 64f8a2e9717..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/provider/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for provider-related classes.
- */
-package com.sun.jersey.core.provider;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/AnnotatedMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/AnnotatedMethod.java
deleted file mode 100644
index f1f7c499bec..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/AnnotatedMethod.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.reflection;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.Encoded;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class AnnotatedMethod implements AnnotatedElement {
- @SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>>
- METHOD_META_ANNOTATIONS = getSet(
- HttpMethod.class);
-
- @SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>>
- METHOD_ANNOTATIONS = getSet(
- Path.class,
- Produces.class,
- Consumes.class);
-
- @SuppressWarnings("unchecked")
- private static final Set<Class<? extends Annotation>>
- PARAMETER_ANNOTATIONS = getSet(
- Context.class,
- Encoded.class,
- DefaultValue.class,
- MatrixParam.class,
- QueryParam.class,
- CookieParam.class,
- HeaderParam.class,
- PathParam.class,
- FormParam.class);
-
- private static Set<Class<? extends Annotation>> getSet(Class<? extends Annotation>... cs) {
- Set<Class<? extends Annotation>> s = new HashSet<Class<? extends Annotation>>();
- for (Class<? extends Annotation> c : cs) s.add(c);
- return s;
- }
-
- private final Method m;
-
- private final Method am;
-
- private final Annotation[] methodAnnotations;
-
- private final Annotation[][] parameterAnnotations;
-
- public AnnotatedMethod(Method m) {
- this.m = m;
- this.am = findAnnotatedMethod(m);
-
- if (m.equals(am)) {
- methodAnnotations = m.getAnnotations();
- parameterAnnotations = m.getParameterAnnotations();
- } else {
- methodAnnotations = mergeMethodAnnotations(m, am);
- parameterAnnotations = mergeParameterAnnotations(m, am);
- }
- }
-
- public Method getMethod() {
- return am;
- }
-
- public Annotation[][] getParameterAnnotations() {
- return parameterAnnotations.clone();
- }
-
- public Class<?>[] getParameterTypes() {
- return am.getParameterTypes();
- }
-
- public TypeVariable<Method>[] getTypeParameters() {
- return am.getTypeParameters();
- }
-
- public Type[] getGenericParameterTypes() {
- return am.getGenericParameterTypes();
- }
-
- public <T extends Annotation> List<T> getMetaMethodAnnotations(
- Class<T> annotation) {
- List <T> ma = new ArrayList<T>();
- for (Annotation a : methodAnnotations) {
- if (a.annotationType().getAnnotation(annotation) != null) {
- ma.add(a.annotationType().getAnnotation(annotation));
- }
- }
-
- return ma;
- }
-
- @Override
- public String toString() {
- return m.toString();
- }
-
- // AnnotatedElement
-
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
- for (Annotation ma : methodAnnotations) {
- if (ma.annotationType() == annotationType)
- return true;
- }
- return false;
- }
-
- public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
- for (Annotation ma : methodAnnotations) {
- if (ma.annotationType() == annotationType)
- return annotationType.cast(ma);
- }
- return am.getAnnotation(annotationType);
- }
-
- public Annotation[] getAnnotations() {
- return methodAnnotations.clone();
- }
-
- public Annotation[] getDeclaredAnnotations() {
- return getAnnotations();
- }
-
-
- //
-
- private static Annotation[] mergeMethodAnnotations(Method m, Method am) {
- List<Annotation> al = asList(m.getAnnotations());
- for (Annotation a : am.getAnnotations()) {
- if (!m.isAnnotationPresent(a.getClass()))
- al.add(a);
- }
-
- return al.toArray(new Annotation[0]);
- }
-
- private static Annotation[][] mergeParameterAnnotations(Method m, Method am) {
- Annotation[][] mp = m.getParameterAnnotations();
- Annotation[][] amp = am.getParameterAnnotations();
-
- List<List<Annotation>> ala = new ArrayList<List<Annotation>>();
- for (int i = 0; i < mp.length; i++) {
- List<Annotation> al = asList(mp[i]);
- for (Annotation a : amp[i])
- if (!isAnnotatonPresent(a.getClass(), al))
- al.add(a);
- ala.add(al);
- }
-
- Annotation[][] paa = new Annotation[mp.length][];
- for (int i = 0; i < mp.length; i++) {
- paa[i] = ala.get(i).toArray(new Annotation[0]);
- }
-
- return paa;
- }
-
- private static boolean isAnnotatonPresent(Class<? extends Annotation> ca, List<Annotation> la) {
- for (Annotation a : la) {
- if (ca == a.getClass())
- return true;
- }
- return false;
- }
-
- private static Method findAnnotatedMethod(Method m) {
- Method am = findAnnotatedMethod(m.getDeclaringClass(), m);
- return (am != null) ? am : m;
- }
-
- private static Method findAnnotatedMethod(Class<?> c, Method m) {
- if (c == Object.class)
- return null;
-
- m = ReflectionHelper.findMethodOnClass(c, m);
- if (m == null)
- return null;
-
- if (hasAnnotations(m)) return m;
-
- // Super classes take precendence over interfaces
- Class<?> sc = c.getSuperclass();
- if (sc != null && sc != Object.class) {
- Method sm = findAnnotatedMethod(sc, m);
- if (sm != null) return sm;
- }
-
- for (Class<?> ic : c.getInterfaces()) {
- Method im = findAnnotatedMethod(ic, m);
- if (im != null) return im;
- }
-
- return null;
- }
-
- private static boolean hasAnnotations(Method m) {
- return hasMetaMethodAnnotations(m) ||
- hasMethodAnnotations(m) ||
- hasParameterAnnotations(m);
- }
-
- private static boolean hasMetaMethodAnnotations(Method m) {
- for (Class<? extends Annotation> ac : METHOD_META_ANNOTATIONS)
- for (Annotation a : m.getAnnotations())
- if (a.annotationType().getAnnotation(ac) != null) return true;
-
- return false;
- }
-
- private static boolean hasMethodAnnotations(Method m) {
- for (Class<? extends Annotation> ac : METHOD_ANNOTATIONS)
- if (m.isAnnotationPresent(ac)) return true;
-
- return false;
- }
-
- private static boolean hasParameterAnnotations(Method m) {
- for (Annotation[] as : m.getParameterAnnotations())
- for (Annotation a : as)
- if (PARAMETER_ANNOTATIONS.contains(a.annotationType())) return true;
-
- return false;
- }
-
- private static <T> List<T> asList(T... ts) {
- List<T> l = new ArrayList<T>();
- for (T t : ts) l.add(t);
- return l;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/MethodList.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/MethodList.java
deleted file mode 100644
index 385b5dd5a54..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/MethodList.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.reflection;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class MethodList implements Iterable<AnnotatedMethod> {
-
- private AnnotatedMethod[] methods;
-
- public MethodList(Class c) {
- this(c, false);
- }
-
- public MethodList(Class c, boolean declaredMethods) {
- this(declaredMethods ? getAllDeclaredMethods(c) : getMethods(c));
- }
-
- private static List<Method> getAllDeclaredMethods(Class c) {
- List<Method> l = new ArrayList<Method>();
- while (c != null && c != Object.class) {
- l.addAll(Arrays.asList(c.getDeclaredMethods()));
- c = c.getSuperclass();
- }
- return l;
- }
-
- private static List<Method> getMethods(Class c) {
- return Arrays.asList(c.getMethods());
- }
-
- public MethodList(List<Method> methods) {
- List<AnnotatedMethod> l = new ArrayList<AnnotatedMethod>();
- for (Method m : methods) {
- if (!m.isBridge() && m.getDeclaringClass() != Object.class)
- l.add(new AnnotatedMethod(m));
- }
-
- this.methods = new AnnotatedMethod[l.size()];
- this.methods = l.toArray(this.methods);
- }
-
- public MethodList(Method... methods) {
- List<AnnotatedMethod> l = new ArrayList<AnnotatedMethod>();
- for (Method m : methods) {
- if (!m.isBridge() && m.getDeclaringClass() != Object.class)
- l.add(new AnnotatedMethod(m));
- }
-
- this.methods = new AnnotatedMethod[l.size()];
- this.methods = l.toArray(this.methods);
- }
-
- public MethodList(AnnotatedMethod... methods) {
- this.methods = methods;
- }
-
- public Iterator<AnnotatedMethod> iterator() {
- return Arrays.asList(methods).iterator();
- }
-
- public <T extends Annotation> MethodList isNotPublic() {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- return !Modifier.isPublic(m.getMethod().getModifiers());
- }
- });
- }
-
- public <T extends Annotation> MethodList hasNumParams(final int i) {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- return m.getParameterTypes().length == i;
- }
- });
- }
-
- public <T extends Annotation> MethodList hasReturnType(final Class<?> r) {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- return m.getMethod().getReturnType() == r;
- }
- });
- }
-
- public <T extends Annotation> MethodList nameStartsWith(final String s) {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- return m.getMethod().getName().startsWith(s);
- }
- });
- }
-
- public <T extends Annotation> MethodList hasAnnotation(final Class<T> annotation) {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- return m.getAnnotation(annotation) != null;
- }
- });
- }
-
- public <T extends Annotation> MethodList hasMetaAnnotation(final Class<T> annotation) {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- for (Annotation a : m.getAnnotations()) {
- if (a.annotationType().getAnnotation(annotation) != null)
- return true;
- }
- return false;
- }
- });
- }
-
- public <T extends Annotation> MethodList hasNotAnnotation(final Class<T> annotation) {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- return m.getAnnotation(annotation) == null;
- }
- });
- }
-
- public <T extends Annotation> MethodList hasNotMetaAnnotation(final Class<T> annotation) {
- return filter(new Filter() {
- public boolean keep(AnnotatedMethod m) {
- for (Annotation a : m.getAnnotations()) {
- if (a.annotationType().getAnnotation(annotation) != null)
- return false;
- }
- return true;
- }
- });
- }
-
- public interface Filter {
- boolean keep(AnnotatedMethod m);
- }
-
- public MethodList filter(Filter f) {
- List<AnnotatedMethod> r = new ArrayList<AnnotatedMethod>();
- for (AnnotatedMethod m : methods)
- if (f.keep(m))
- r.add(m);
- return new MethodList(r.toArray(new AnnotatedMethod[0]));
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/ReflectionHelper.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/ReflectionHelper.java
deleted file mode 100644
index 08f5a4dc804..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/ReflectionHelper.java
+++ /dev/null
@@ -1,735 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.reflection;
-
-import com.sun.jersey.impl.ImplMessages;
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Utility methods for Java reflection.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ReflectionHelper {
-
- /**
- *
- */
- public static Class getDeclaringClass(AccessibleObject ao) {
- if (ao instanceof Method) {
- return ((Method)ao).getDeclaringClass();
- } else if (ao instanceof Field) {
- return ((Field)ao).getDeclaringClass();
- } else if (ao instanceof Constructor) {
- return ((Constructor)ao).getDeclaringClass();
- } else {
- throw new RuntimeException();
- }
- }
-
- /**
- * Create a string representation of an object.
- * <p>
- * Returns a string consisting of the name of the class of which the
- * object is an instance, the at-sign character '<code>@</code>', and
- * the unsigned hexadecimal representation of the hash code of the
- * object. In other words, this method returns a string equal to the
- * value of:
- * <blockquote>
- * <pre>
- * o.getClass().getName() + '@' + Integer.toHexString(o.hashCode())
- * </pre></blockquote>
- *
- * @param o the object.
- * @return the string representation of the object.
- */
- public static String objectToString(Object o) {
- if (o == null)
- return "null";
- StringBuffer sb = new StringBuffer();
- sb.append(o.getClass().getName()).
- append('@').append(Integer.toHexString(o.hashCode()));
- return sb.toString();
- }
-
- /**
- * Create a string representation of a method and an instance whose
- * class implements the method.
- * <p>
- * Returns a string consisting of the name of the class of which the object
- * is an instance, the at-sign character '<code>@</code>',
- * the unsigned hexadecimal representation of the hash code of the
- * object, the character '<code>.</code>', the name of the method,
- * the character '<code>(</code>', the list of method parameters, and
- * the character '<code>)</code>'. In other words, thos method returns a
- * string equal to the value of:
- * <blockquote>
- * <pre>
- * o.getClass().getName() + '@' + Integer.toHexString(o.hashCode()) +
- * '.' + m.getName() + '(' + &lt;parameters&gt; + ')'.
- * </pre></blockquote>
- *
- * @param o the object whose class implements <code>m</code>.
- * @param m the method.
- * @return the string representation of the method and instance.
- */
- public static String methodInstanceToString(Object o, Method m) {
- StringBuffer sb = new StringBuffer();
- sb.append(o.getClass().getName()).
- append('@').append(Integer.toHexString(o.hashCode())).
- append('.').append(m.getName()).append('(');
-
- Class[] params = m.getParameterTypes();
- for (int i = 0; i < params.length; i++) {
- sb.append(getTypeName(params[i]));
- if (i < (params.length - 1))
- sb.append(",");
- }
-
- sb.append(')');
-
- return sb.toString();
- }
-
- /**
- *
- * @param type
- * @return
- */
- private static String getTypeName(Class type) {
- if (type.isArray()) {
- try {
- Class cl = type;
- int dimensions = 0;
- while (cl.isArray()) {
- dimensions++;
- cl = cl.getComponentType();
- }
- StringBuffer sb = new StringBuffer();
- sb.append(cl.getName());
- for (int i = 0; i < dimensions; i++) {
- sb.append("[]");
- }
- return sb.toString();
- } catch (Throwable e) { /*FALLTHRU*/ }
- }
- return type.getName();
- }
-
- /**
- * Get the Class from the class name.
- * <p>
- * The context class loader will be utilized if accessible and non-null.
- * Otherwise the defining class loader of this class will
- * be utilized.
- *
- * @param name the class name.
- * @return the Class, otherwise null if the class cannot be found.
- */
- public static Class classForName(String name) {
- return classForName(name, getContextClassLoader());
- }
-
- /**
- * Get the Class from the class name.
- *
- * @param name the class name.
- * @param cl the class loader to use, if null then the defining class loader
- * of this class will be utilized.
- * @return the Class, otherwise null if the class cannot be found.
- */
- public static Class classForName(String name, ClassLoader cl) {
- if (cl != null) {
- try {
- return Class.forName(name, false, cl);
- } catch (ClassNotFoundException ex) {
- }
- }
- try {
- return Class.forName(name);
- } catch (ClassNotFoundException ex) {
- }
-
- return null;
- }
-
- /**
- * Get the Class from the class name.
- * <p>
- * The context class loader will be utilized if accessible and non-null.
- * Otherwise the defining class loader of this class will
- * be utilized.
- *
- * @param name the class name.
- * @return the Class, otherwise null if the class cannot be found.
- * @throws ClassNotFoundException if the class cannot be found.
- */
- public static Class classForNameWithException(String name)
- throws ClassNotFoundException {
- return classForNameWithException(name, getContextClassLoader());
- }
-
- /**
- * Get the Class from the class name.
- *
- * @param name the class name.
- * @param cl the class loader to use, if null then the defining class loader
- * of this class will be utilized.
- * @return the Class, otherwise null if the class cannot be found.
- * @throws ClassNotFoundException if the class cannot be found.
- */
- public static Class classForNameWithException(String name, ClassLoader cl)
- throws ClassNotFoundException {
- if (cl != null) {
- try {
- return Class.forName(name, false, cl);
- } catch (ClassNotFoundException ex) {
- }
- }
- return Class.forName(name);
- }
-
- /**
- * Get the context class loader.
- *
- * @return the context class loader, otherwise null security privilages
- * are not set.
- */
- public static ClassLoader getContextClassLoader() {
- return AccessController.doPrivileged(
- new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) {
- }
- return cl;
- }
- });
- }
-
- /**
- * Set a method to be accessible.
- *
- * @param m the method to be set as accessible
- */
- public static void setAccessibleMethod(final Method m) {
- if (Modifier.isPublic(m.getModifiers()))
- return;
-
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- if (!m.isAccessible()) {
- m.setAccessible(true);
- }
- return m;
- }
- });
- }
-
- /**
- * Get the class that is the type argument of a parameterized type.
- * <p>
- * @param parameterizedType must be an instance of ParameterizedType
- * and have exactly one type argument.
- * @return the class of the actual type argument. If the type argument
- * is a class then the class is returned. If the type argument
- * is a generic array type and the generic component type is a
- * class then class of the array is returned. if the type argument
- * is a parameterized type and it's raw type is a class then
- * that class is returned.
- * If the parameterizedType is not an instance of ParameterizedType
- * or contains more than one type argument null is returned.
- * @throws IllegalArgumentException if the single type argument is not of
- * a class, or a generic array type, or the generic component type
- * of the generic array type is not class, or not a parameterized
- * type with a raw type that is not a class.
- */
- public static Class getGenericClass(Type parameterizedType) throws IllegalArgumentException {
- final Type t = getTypeArgumentOfParameterizedType(parameterizedType);
- if (t == null)
- return null;
-
- final Class c = getClassOfType(t);
- if (c == null) {
- throw new IllegalArgumentException(ImplMessages.GENERIC_TYPE_NOT_SUPPORTED(
- t, parameterizedType));
- }
- return c;
- }
-
- public static final class TypeClassPair {
- public final Type t;
- public final Class c;
-
- public TypeClassPair(Type t, Class c) {
- this.t = t;
- this.c = c;
- }
- }
-
- public static TypeClassPair getTypeArgumentAndClass(Type parameterizedType) throws IllegalArgumentException {
- final Type t = getTypeArgumentOfParameterizedType(parameterizedType);
- if (t == null)
- return null;
-
- final Class c = getClassOfType(t);
- if (c == null) {
- throw new IllegalArgumentException(ImplMessages.GENERIC_TYPE_NOT_SUPPORTED(
- t, parameterizedType));
- }
-
- return new TypeClassPair(t, c);
- }
-
- private static Type getTypeArgumentOfParameterizedType(Type parameterizedType) {
- if (!(parameterizedType instanceof ParameterizedType)) return null;
-
- ParameterizedType type = (ParameterizedType)parameterizedType;
- Type[] genericTypes = type.getActualTypeArguments();
- if (genericTypes.length != 1) return null;
-
- return genericTypes[0];
- }
-
- private static Class getClassOfType(Type type) {
- if (type instanceof Class) {
- return (Class)type;
- } else if (type instanceof GenericArrayType) {
- GenericArrayType arrayType = (GenericArrayType)type;
- Type t = arrayType.getGenericComponentType();
- if (t instanceof Class) {
- return getArrayClass((Class)t);
- }
- } else if (type instanceof ParameterizedType) {
- ParameterizedType subType = (ParameterizedType)type;
- Type t = subType.getRawType();
- if (t instanceof Class) {
- return (Class)t;
- }
- }
- return null;
- }
-
- /**
- * Get Array class of component class.
- *
- * @param c the component class of the array
- * @return the array class.
- */
- public static Class getArrayClass(Class c) {
- try {
- Object o = Array.newInstance(c, 0);
- return o.getClass();
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- /**
- * Get the static valueOf(String ) method.
- *
- * @param c The class to obtain the method.
- * @return the method, otherwise null if the method is not present.
- */
- @SuppressWarnings("unchecked")
- public static Method getValueOfStringMethod(Class c) {
- try {
- Method m = c.getDeclaredMethod("valueOf", String.class);
- if (!Modifier.isStatic(m.getModifiers()) && m.getReturnType() == c) {
- return null;
- }
- return m;
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Get the static fromString(String ) method.
- *
- * @param c The class to obtain the method.
- * @return the method, otherwise null if the method is not present.
- */
- @SuppressWarnings("unchecked")
- public static Method getFromStringStringMethod(Class c) {
- try {
- Method m = c.getDeclaredMethod("fromString", String.class);
- if (!Modifier.isStatic(m.getModifiers()) && m.getReturnType() == c) {
- return null;
- }
- return m;
- } catch (Exception e) {
- return null;
- }
- }
-
- /**
- * Get the constructor that has a single parameter of String.
- *
- * @param c The class to obtain the constructor.
- * @return the constructor, otherwise null if the constructor is not present.
- */
- @SuppressWarnings("unchecked")
- public static Constructor getStringConstructor(Class c) {
- try {
- return c.getConstructor(String.class);
- } catch (Exception e) {
- return null;
- }
- }
-
-
- /**
- * A tuple consisting of a concrete class, declaring class that declares a
- * generic interface type.
- */
- public static class DeclaringClassInterfacePair {
- public final Class concreteClass;
-
- public final Class declaringClass;
-
- public final Type genericInterface;
-
- private DeclaringClassInterfacePair(Class concreteClass, Class declaringClass, Type genericInteface) {
- this.concreteClass = concreteClass;
- this.declaringClass = declaringClass;
- this.genericInterface = genericInteface;
- }
- }
-
- /**
- * Get the parameterized class arguments for a declaring class that
- * declares a generic interface type.
- *
- * @param p the declaring class
- * @return the parameterized class arguments, or null if the generic
- * interface type is not a parameterized type.
- */
- public static Class[] getParameterizedClassArguments(DeclaringClassInterfacePair p) {
- if (p.genericInterface instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)p.genericInterface;
- Type[] as = pt.getActualTypeArguments();
- Class[] cas = new Class[as.length];
-
- for (int i = 0; i < as.length; i++) {
- Type a = as[i];
- if (a instanceof Class) {
- cas[i] = (Class)a;
- } else if (a instanceof ParameterizedType) {
- pt = (ParameterizedType)a;
- cas[i] = (Class)pt.getRawType();
- } else if (a instanceof TypeVariable) {
- ClassTypePair ctp = resolveTypeVariable(p.concreteClass, p.declaringClass, (TypeVariable)a);
- cas[i] = (ctp != null) ? ctp.c : Object.class;
- }
- }
- return cas;
- } else {
- return null;
- }
- }
-
- /**
- * Get the parameterized type arguments for a declaring class that
- * declares a generic interface type.
- *
- * @param p the declaring class
- * @return the parameterized type arguments, or null if the generic
- * interface type is not a parameterized type.
- */
- public static Type[] getParameterizedTypeArguments(DeclaringClassInterfacePair p) {
- if (p.genericInterface instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)p.genericInterface;
- Type[] as = pt.getActualTypeArguments();
- Type[] ras = new Type[as.length];
-
- for (int i = 0; i < as.length; i++) {
- Type a = as[i];
- if (a instanceof Class) {
- ras[i] = a;
- } else if (a instanceof ParameterizedType) {
- pt = (ParameterizedType)a;
- ras[i] = a;
- } else if (a instanceof TypeVariable) {
- ClassTypePair ctp = resolveTypeVariable(p.concreteClass, p.declaringClass, (TypeVariable)a);
- ras[i] = ctp.t;
- }
- }
- return ras;
- } else {
- return null;
- }
- }
-
- /**
- * Find the declaring class that implements or extends an interface.
- *
- * @param concrete the concrete class than directly or indirectly
- * implements or extends an interface class.
- * @param iface the interface class.
- * @return the tuple of the declaring class and the generic interface
- * type.
- */
- public static DeclaringClassInterfacePair getClass(Class concrete, Class iface) {
- return getClass(concrete, iface, concrete);
- }
-
- private static DeclaringClassInterfacePair getClass(Class concrete, Class iface, Class c) {
- Type[] gis = c.getGenericInterfaces();
- DeclaringClassInterfacePair p = getType(concrete, iface, c, gis);
- if (p != null)
- return p;
-
- c = c.getSuperclass();
- if (c == null || c == Object.class)
- return null;
-
- return getClass(concrete, iface, c);
- }
-
- private static DeclaringClassInterfacePair getType(Class concrete, Class iface, Class c, Type[] ts) {
- for (Type t : ts) {
- DeclaringClassInterfacePair p = getType(concrete, iface, c, t);
- if (p != null)
- return p;
- }
- return null;
- }
-
- private static DeclaringClassInterfacePair getType(Class concrete, Class iface, Class c, Type t) {
- if (t instanceof Class) {
- if (t == iface) {
- return new DeclaringClassInterfacePair(concrete, c, t);
- } else {
- return getClass(concrete, iface, (Class)t);
- }
- } else if (t instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)t;
- if (pt.getRawType() == iface) {
- return new DeclaringClassInterfacePair(concrete, c, t);
- } else {
- return getClass(concrete, iface, (Class)pt.getRawType());
- }
- }
- return null;
- }
-
- /**
- * A tuple consisting of a class and type of the class.
- */
- public static class ClassTypePair {
- /**
- * The class.
- */
- public final Class c;
-
- /**
- * The type of the class.
- */
- public final Type t;
-
- public ClassTypePair(Class c) {
- this(c, c);
- }
-
- public ClassTypePair(Class c, Type t) {
- this.c = c;
- this.t = t;
- }
- }
-
- /**
- * Given a type variable resolve the Java class of that variable.
- *
- * @param c the concrete class from which all type variables are resolved
- * @param dc the declaring class where the type variable was defined
- * @param tv the type variable
- * @return the resolved Java class and type, otherwise null if the type variable
- * could not be resolved
- */
- public static ClassTypePair resolveTypeVariable(Class c, Class dc, TypeVariable tv) {
- return resolveTypeVariable(c, dc, tv, new HashMap<TypeVariable, Type>());
- }
-
- private static ClassTypePair resolveTypeVariable(Class c, Class dc, TypeVariable tv,
- Map<TypeVariable, Type> map) {
- Type[] gis = c.getGenericInterfaces();
- for (Type gi : gis) {
- if (gi instanceof ParameterizedType) {
- // process pt of interface
- ParameterizedType pt = (ParameterizedType)gi;
- ClassTypePair ctp = resolveTypeVariable(pt, (Class)pt.getRawType(), dc, tv, map);
- if (ctp != null)
- return ctp;
- }
- }
-
- Type gsc = c.getGenericSuperclass();
- if (gsc instanceof ParameterizedType) {
- // process pt of class
- ParameterizedType pt = (ParameterizedType)gsc;
- return resolveTypeVariable(pt, c.getSuperclass(), dc, tv, map);
- } else if (gsc instanceof Class) {
- return resolveTypeVariable(c.getSuperclass(), dc, tv, map);
- }
- return null;
- }
-
- private static ClassTypePair resolveTypeVariable(ParameterizedType pt, Class c, Class dc, TypeVariable tv,
- Map<TypeVariable, Type> map) {
- Type[] typeArguments = pt.getActualTypeArguments();
-
- TypeVariable[] typeParameters = c.getTypeParameters();
-
- Map<TypeVariable, Type> submap = new HashMap<TypeVariable, Type>();
- for (int i = 0; i < typeArguments.length; i++) {
- // Substitute a type variable with the Java class
- if (typeArguments[i] instanceof TypeVariable) {
- Type t = map.get(typeArguments[i]);
- submap.put(typeParameters[i], t);
- } else {
- submap.put(typeParameters[i], typeArguments[i]);
- }
- }
-
- if (c == dc) {
- Type t = submap.get(tv);
- if (t instanceof Class) {
- return new ClassTypePair((Class)t);
- } else if (t instanceof GenericArrayType) {
- t = ((GenericArrayType)t).getGenericComponentType();
- if (t instanceof Class) {
- c = (Class)t;
- try {
- return new ClassTypePair(getArrayClass(c));
- } catch (Exception e) {
- }
- return null;
- } else if (t instanceof ParameterizedType) {
- Type rt = ((ParameterizedType) t).getRawType();
- if (rt instanceof Class) {
- c = (Class) rt;
- } else {
- return null;
- }
- try {
- return new ClassTypePair(getArrayClass(c), t);
- } catch (Exception e) {
- return null;
- }
- } else {
- return null;
- }
- } else if (t instanceof ParameterizedType) {
- pt = (ParameterizedType)t;
- if (pt.getRawType() instanceof Class) {
- return new ClassTypePair((Class)pt.getRawType(), pt);
- } else
- return null;
- } else {
- return null;
- }
- } else {
- return resolveTypeVariable(c, dc, tv, submap);
- }
- }
-
- /**
- * Find a method on a class given an existing method.
- * <p>
- * If there exists a public method on the class that has the same name
- * and parameters as the existing method then that public method is
- * returned.
- * <p>
- * Otherwise, if there exists a public method on the class that has
- * the same name and the same number of parameters as the existing method,
- * and each generic parameter type, in order, of the public method is equal
- * to the generic parameter type, in the same order, of the existing method
- * or is an instance of {@link TypeVariable} then that public method is
- * returned.
- *
- * @param c the class to search for a public method
- * @param m the method to find
- * @return the found public method.
- */
- public static Method findMethodOnClass(Class c, Method m) {
- try {
- return c.getMethod(m.getName(), m.getParameterTypes());
- } catch (NoSuchMethodException ex) {
- for (Method _m : c.getMethods()) {
- if (_m.getName().equals(m.getName()) &&
- _m.getParameterTypes().length == m.getParameterTypes().length) {
- if (compareParameterTypes(m.getGenericParameterTypes(),
- _m.getGenericParameterTypes())) {
- return _m;
- }
- }
- }
- }
- return null;
- }
-
- private static boolean compareParameterTypes(Type[] ts, Type[] _ts) {
- for (int i = 0; i < ts.length; i++) {
- if (!ts[i].equals(_ts[i])) {
- if (!(_ts[i] instanceof TypeVariable)) {
- return false;
- }
- }
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/package-info.java
deleted file mode 100644
index f26a179944d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/reflection/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for reflection.
- */
-package com.sun.jersey.core.reflection;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/AnnotatedContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/AnnotatedContext.java
deleted file mode 100644
index fec34fa97ae..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/AnnotatedContext.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AccessibleObject;
-
-/**
- * A component context for an accessible object and/or an array of annotations.
- *
- * @author Paul.Sandoz@Oracle.Com
- */
-public class AnnotatedContext implements ComponentContext {
-
- private Annotation[] annotations;
-
- private AccessibleObject ao;
-
- public AnnotatedContext() {
- }
-
- public AnnotatedContext(Annotation[] annotations) {
- this(null, annotations);
- }
-
- public AnnotatedContext(AccessibleObject ao) {
- this(ao, null);
- }
-
- public AnnotatedContext(AccessibleObject ao, Annotation[] annotations) {
- this.ao = ao;
- this.annotations = annotations;
- }
-
- public void setAnnotations(Annotation[] annotations) {
- this.annotations = annotations;
- }
-
- public void setAccessibleObject(AccessibleObject ao) {
- this.ao = ao;
- }
-
- // ComponentContext
-
- public AccessibleObject getAccesibleObject() {
- return ao;
- }
-
- public Annotation[] getAnnotations() {
- return annotations;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentConstructor.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentConstructor.java
deleted file mode 100644
index c0dcb876ff2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentConstructor.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component;
-
-import com.sun.jersey.core.reflection.AnnotatedMethod;
-import com.sun.jersey.core.reflection.MethodList;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import com.sun.jersey.spi.inject.Errors;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-/**
- * A constructor of a component.
- *
- * @param <T> the type to construct
- * @author Paul.Sandoz@Sun.Com
- */
-public class ComponentConstructor<T> {
- /**
- * A tuple of a constructor and the list of injectables associated with
- * the parameters of the constructor.
- *
- * @param <T> the type to construct.
- */
- private static class ConstructorInjectablePair<T> {
- /**
- * The constructor.
- */
- private final Constructor<T> con;
-
- /**
- * The list of injectables associated with the parameters of the
- * constructor;
- */
- private final List<Injectable> is;
-
- /**
- * Create a new tuple of a constructor and list of injectables.
- *
- * @param con the constructor
- * @param is the list of injectables.
- */
- private ConstructorInjectablePair(Constructor<T> con, List<Injectable> is) {
- this.con = con;
- this.is = is;
- }
- }
-
- private static class ConstructorComparator<T> implements Comparator<ConstructorInjectablePair<T>> {
- @Override
- public int compare(ConstructorInjectablePair<T> o1, ConstructorInjectablePair<T> o2) {
- int p = Collections.frequency(o1.is, null) - Collections.frequency(o2.is, null);
- if (p != 0)
- return p;
-
- return o2.con.getParameterTypes().length - o1.con.getParameterTypes().length;
- }
- }
-
- private final InjectableProviderContext ipc;
-
- private final Class<T> c;
-
- private final List<Method> postConstructs;
-
- private final ComponentInjector<T> ci;
-
- public ComponentConstructor(InjectableProviderContext ipc, Class<T> c, ComponentInjector<T> ci) {
- this.ipc = ipc;
- this.c = c;
- this.ci = ci;
- this.postConstructs = getPostConstructMethods(c);
- }
-
- private static List<Method> getPostConstructMethods(Class c) {
- Class postConstructClass = ReflectionHelper.classForName("javax.annotation.PostConstruct");
- LinkedList<Method> list = new LinkedList<Method>();
- HashSet<String> names = new HashSet<String>();
- if (postConstructClass != null) {
- MethodList methodList = new MethodList(c, true);
- for (AnnotatedMethod m : methodList.
- hasAnnotation(postConstructClass).
- hasNumParams(0).
- hasReturnType(void.class)) {
- Method method = m.getMethod();
- // only add method if not hidden/overridden
- if (names.add(method.getName())) {
- ReflectionHelper.setAccessibleMethod(method);
- // methods from the superclass should go first, so inserting at the beginning
- list.addFirst(method);
- }
- }
- }
- return list;
- }
-
- /**
- * Get a new instance.
- *
- * @return a new instance.
- */
- public T getInstance()
- throws InstantiationException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException {
- final int modifiers = c.getModifiers();
- if (!Modifier.isPublic(modifiers)) {
- Errors.nonPublicClass(c);
- }
-
- if (Modifier.isAbstract(modifiers)) {
- if (Modifier.isInterface(modifiers)) {
- Errors.interfaceClass(c);
- } else {
- Errors.abstractClass(c);
- }
- }
-
- if (c.getEnclosingClass() != null && !Modifier.isStatic(modifiers)) {
- Errors.innerClass(c);
- }
-
- if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers)) {
- if (c.getConstructors().length == 0) {
- Errors.nonPublicConstructor(c);
- }
- }
-
- final T t = _getInstance();
- ci.inject(t);
- for (Method postConstruct : postConstructs) {
- postConstruct.invoke(t);
- }
- return t;
- }
-
- private T _getInstance()
- throws InstantiationException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException {
- ConstructorInjectablePair<T> cip = getConstructor();
- if (cip == null || cip.is.isEmpty()) {
- return c.newInstance();
- } else {
- if (cip.is.contains(null)) {
- // Missing dependency
- for (int i = 0; i < cip.is.size(); i++) {
- if (cip.is.get(i) == null) {
- Errors.missingDependency(cip.con, i);
- }
- }
- }
-
- Object[] params = new Object[cip.is.size()];
- int i = 0;
- for (Injectable injectable : cip.is) {
- if (injectable != null)
- params[i++] = injectable.getValue();
- }
- return cip.con.newInstance(params);
- }
- }
-
- /**
- * Get the most suitable constructor. The constructor with the most
- * parameters and that has the most parameters associated with
- * Injectable instances will be chosen.
- *
- * @param <T> The type to construct.
- * @param c the class to instantiate.
- * @return a list of constructor and list of injectables for the constructor
- * parameters.
- */
- private ConstructorInjectablePair<T> getConstructor() {
- if (c.getConstructors().length == 0)
- return null;
-
- SortedSet<ConstructorInjectablePair<T>> cs = new TreeSet<ConstructorInjectablePair<T>>(
- new ConstructorComparator());
-
- AnnotatedContext aoc = new AnnotatedContext();
- for (Constructor con : c.getConstructors()) {
- List<Injectable> is = new ArrayList<Injectable>();
- int ps = con.getParameterTypes().length;
- aoc.setAccessibleObject(con);
- for (int p = 0; p < ps; p++) {
- Type pgtype = con.getGenericParameterTypes()[p];
- Annotation[] as = con.getParameterAnnotations()[p];
- aoc.setAnnotations(as);
- Injectable i = null;
- for (Annotation a : as) {
- i = ipc.getInjectable(
- a.annotationType(), aoc, a, pgtype,
- ComponentScope.UNDEFINED_SINGLETON);
- }
- is.add(i);
- }
- cs.add(new ConstructorInjectablePair<T>(con, is));
- }
-
- return cs.first();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentContext.java
deleted file mode 100644
index 48c59a0c495..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentContext.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.component;
-
-import com.sun.jersey.spi.inject.InjectableProvider;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AccessibleObject;
-
-/**
- * A component context providing information to {@link ComponentProvider}
- * and {@link InjectableProvider} instances on the accessible object and list of
- * annotations associated with the component instance to be obtained and/or
- * injected.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ComponentContext {
-
- /**
- * Get the accessible object.
- *
- * @return the accessible object, may be null.
- */
- AccessibleObject getAccesibleObject();
-
- /**
- * Get the array of annotations.
- *
- * @return the array of annotations.
- */
- Annotation[] getAnnotations();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentDestructor.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentDestructor.java
deleted file mode 100644
index eaa7f8b9218..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentDestructor.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component;
-
-import com.sun.jersey.core.reflection.AnnotatedMethod;
-import com.sun.jersey.core.reflection.MethodList;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * A destructor of a component.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ComponentDestructor {
- private final List<Method> preDestroys;
-
- /**
- * Create a component destructor.
- *
- * @param c the class of instances to destruct.
- */
- public ComponentDestructor(Class c) {
- this.preDestroys = getPreDestroyMethods(c);
- }
-
- private static List<Method> getPreDestroyMethods(Class c) {
- Class preDestroyClass = ReflectionHelper.classForName("javax.annotation.PreDestroy");
- List<Method> list = new ArrayList<Method>();
- HashSet<String> names = new HashSet<String>();
- if (preDestroyClass != null) {
- MethodList methodList = new MethodList(c, true);
- for (AnnotatedMethod m : methodList.
- hasAnnotation(preDestroyClass).
- hasNumParams(0).
- hasReturnType(void.class)) {
- Method method = m.getMethod();
- // only add method if not hidden/overridden
- if (names.add(method.getName())) {
- ReflectionHelper.setAccessibleMethod(method);
- list.add(method);
- }
- }
- }
- return list;
- }
-
- public void destroy(Object o) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException {
- for (Method preDestroy : preDestroys) {
- preDestroy.invoke(o);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentInjector.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentInjector.java
deleted file mode 100644
index 11fa4272323..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentInjector.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component;
-
-import com.sun.jersey.core.reflection.AnnotatedMethod;
-import com.sun.jersey.core.reflection.MethodList;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import com.sun.jersey.spi.inject.Errors;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Type;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.Path;
-
-/**
- * An injector to inject on a component.
- *
- * @param <T> the type to inject on.
- * @author Paul.Sandoz@Sun.Com
- */
-public class ComponentInjector<T> {
- protected final InjectableProviderContext ipc;
-
- protected final Class<T> c;
-
- /**
- * Create a component injector.
- *
- * @param ipc the injector provider context to obtain injectables.
- * @param c the class of the type to inject on.
- */
- public ComponentInjector(InjectableProviderContext ipc, Class<T> c) {
- this.ipc = ipc;
- this.c = c;
- }
-
- /**
- * Inject on an instance.
- *
- * @param t the instance to inject on.
- */
- public void inject(T t) {
- AnnotatedContext aoc = new AnnotatedContext();
-
- Class oClass = c;
- while (oClass != Object.class) {
- for (final Field f : oClass.getDeclaredFields()) {
- aoc.setAccessibleObject(f);
- final Annotation[] as = f.getAnnotations();
- aoc.setAnnotations(as);
- boolean missingDependency = false;
- for (Annotation a : as) {
- Injectable i = ipc.getInjectable(
- a.annotationType(), aoc, a, f.getGenericType(),
- ComponentScope.UNDEFINED_SINGLETON);
- if (i != null) {
- missingDependency = false;
- setFieldValue(t, f, i.getValue());
- break;
- } else if (ipc.isAnnotationRegistered(a.annotationType(), f.getGenericType().getClass())) {
- missingDependency = true;
- }
- }
-
- if (missingDependency) {
- Errors.missingDependency(f);
- }
-
- }
- oClass = oClass.getSuperclass();
- }
-
- MethodList ml = new MethodList(c.getMethods());
- int methodIndex = 0;
- for (AnnotatedMethod m : ml.
- hasNotMetaAnnotation(HttpMethod.class).
- hasNotAnnotation(Path.class).
- hasNumParams(1).
- hasReturnType(void.class).
- nameStartsWith("set")) {
- final Annotation[] as = m.getAnnotations();
- aoc.setAccessibleObject(m.getMethod());
- aoc.setAnnotations(as);
- final Type gpt = m.getGenericParameterTypes()[0];
-
- boolean missingDependency = false;
- for (Annotation a : as) {
- Injectable i = ipc.getInjectable(
- a.annotationType(), aoc, a, gpt,
- ComponentScope.UNDEFINED_SINGLETON);
- if (i != null) {
- missingDependency = false;
- setMethodValue(t, m, i.getValue());
- break;
- } else if (ipc.isAnnotationRegistered(a.annotationType(), gpt.getClass())) {
- missingDependency = true;
- }
- }
-
- if (missingDependency) {
- Errors.missingDependency(m.getMethod(), methodIndex);
- }
-
- methodIndex++;
- }
- }
-
- private void setFieldValue(final Object resource, final Field f, final Object value) {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- try {
- if (!f.isAccessible()) {
- f.setAccessible(true);
- }
- f.set(resource, value);
- return null;
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex);
- }
- }
- });
- }
-
- private void setMethodValue(Object o, AnnotatedMethod m, Object value) {
- try {
- m.getMethod().invoke(o, value);
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProvider.java
deleted file mode 100644
index 0f68537d794..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component;
-
-/**
- * Provide instances of a component.
- *
- */
-public interface ComponentProvider {
- /**
- * Get the instance.
- *
- * @return the instance.
- */
- Object getInstance();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProviderFactory.java
deleted file mode 100644
index cfa6cc3fe87..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentProviderFactory.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component;
-
-/**
- * A factory for obtaining component providers.
- *
- * @param <C> the type of the {@link ComponentProvider}
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ComponentProviderFactory<C extends ComponentProvider> {
-
- /**
- * Get the component provider for a class.
- *
- * @param c the class
- * @return the component provider for the class
- */
- C getComponentProvider(Class<?> c);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentScope.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentScope.java
deleted file mode 100644
index 9bc0ce7f140..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ComponentScope.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.sun.jersey.core.spi.component;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * The scope contract for a component.
- */
-public enum ComponentScope {
-
- /**
- * Declares the scope of the component is a singleton whose instance
- * is valid for the scope of the running application.
- */
- Singleton,
-
- /**
- * Declares that the scope of the component is per request whose instance
- * is valid for the scope of the current HTTP request and response.
- */
- PerRequest,
-
- /**
- * Declares that the scope of the component is undefined.
- */
- Undefined;
-
- /**
- * A immutable list comprising of the scopes Undefined and
- * Singleton, in that order.
- */
- public static final List<ComponentScope> UNDEFINED_SINGLETON =
- Collections.unmodifiableList(Arrays.asList(ComponentScope.Undefined, ComponentScope.Singleton));
-
- /**
- * A immutable list comprising of the scopes PerRequest, Undefined and
- * Singleton, in that order.
- */
- public static final List<ComponentScope> PERREQUEST_UNDEFINED_SINGLETON =
- Collections.unmodifiableList(Arrays.asList(ComponentScope.PerRequest, ComponentScope.Undefined, ComponentScope.Singleton));
-
- /**
- * A immutable list comprising of the scopes PerRequest and
- * Undefined, in that order.
- */
- public static final List<ComponentScope> PERREQUEST_UNDEFINED =
- Collections.unmodifiableList(Arrays.asList(ComponentScope.PerRequest, ComponentScope.Undefined));
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderFactory.java
deleted file mode 100644
index 7f8feaccece..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderFactory.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component;
-
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A component provider factory for provider components (which are singletons).
- * <p>
- * A cache of component providers is managed. When a component provider for
- * a class is obtained it is cached such that the same instance on subsequent
- * requests.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ProviderFactory implements ComponentProviderFactory<ComponentProvider> {
- protected static final Logger LOGGER = Logger.getLogger(ProviderFactory.class.getName());
-
- protected interface Destroyable {
- void destroy();
- }
-
- private static final class SingletonComponentProvider implements ComponentProvider, Destroyable {
- private final Object o;
-
- private final ComponentDestructor cd;
-
- private final ComponentInjector ci;
-
- SingletonComponentProvider(ComponentInjector ci, Object o) {
- this.cd = new ComponentDestructor(o.getClass());
- this.ci = ci;
- this.o = o;
- }
-
- public Object getInstance() {
- return o;
- }
-
- public void inject() {
- ci.inject(o);
- }
-
- public void destroy() {
- try {
- cd.destroy(o);
- } catch (IllegalAccessException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- } catch (IllegalArgumentException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- } catch (InvocationTargetException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- }
- }
- }
-
- private final Map<Class, ComponentProvider> cache =
- new HashMap<Class, ComponentProvider>();
-
- private final InjectableProviderContext ipc;
-
- /**
- * Create the provider factory.
- *
- * @param ipc the injectable provider context to get injectables.
- */
- public ProviderFactory(InjectableProviderContext ipc) {
- this.ipc = ipc;
- }
-
- /**
- * Get the injectable provider context.
- *
- * @return the injectable provider context
- */
- public InjectableProviderContext getInjectableProviderContext() {
- return ipc;
- }
-
- /**
- * Get a component provider for a class.
- *
- * @param pc the provider class.
- * @return the component provider.
- */
- public final ComponentProvider getComponentProvider(ProviderServices.ProviderClass pc) {
- if (!pc.isServiceClass) {
- return getComponentProvider(pc.c);
- }
-
- ComponentProvider cp = cache.get(pc.c);
- if (cp != null) return cp;
-
- cp = __getComponentProvider(pc.c);
-
- if (cp != null) cache.put(pc.c, cp);
- return cp;
- }
-
- /**
- * Get a component provider for a class.
- *
- * @param c the class.
- * @return the component provider.
- */
- public final ComponentProvider getComponentProvider(Class c) {
- ComponentProvider cp = cache.get(c);
- if (cp != null) return cp;
-
- cp = _getComponentProvider(c);
- if (cp != null) cache.put(c, cp);
- return cp;
- }
-
- protected ComponentProvider _getComponentProvider(Class c) {
- return __getComponentProvider(c);
- }
-
- private ComponentProvider __getComponentProvider(Class c) {
- try {
- ComponentInjector ci = new ComponentInjector(ipc, c);
- ComponentConstructor cc = new ComponentConstructor(ipc, c, ci);
- Object o = cc.getInstance();
-
- return new SingletonComponentProvider(ci, o);
- } catch (NoClassDefFoundError ex) {
- // Dependent class of provider not found
- // This assumes that ex.getLocalizedMessage() returns
- // the name of a dependent class that is not found
- LOGGER.log(Level.CONFIG,
- "A dependent class, " + ex.getLocalizedMessage() +
- ", of the component " + c + " is not found." +
- " The component is ignored.");
- return null;
- } catch (InvocationTargetException ex) {
- if (ex.getCause() instanceof NoClassDefFoundError) {
- NoClassDefFoundError ncdf = (NoClassDefFoundError)ex.getCause();
- LOGGER.log(Level.CONFIG,
- "A dependent class, " + ncdf.getLocalizedMessage() +
- ", of the component " + c + " is not found." +
- " The component is ignored.");
- return null;
- } else {
- LOGGER.log(Level.SEVERE,
- "The provider class, " + c +
- ", could not be instantiated. Processing will continue but the class will not be utilized", ex.getTargetException());
- return null;
- }
- } catch (Exception ex) {
- LOGGER.log(Level.SEVERE,
- "The provider class, " + c +
- ", could not be instantiated. Processing will continue but the class will not be utilized", ex);
- return null;
- }
- }
-
- /**
- * Inject on all cached components.
- */
- public void injectOnAllComponents() {
- for (ComponentProvider cp : cache.values()) {
- if (cp instanceof SingletonComponentProvider) {
- SingletonComponentProvider scp = (SingletonComponentProvider)cp;
- scp.inject();
- }
- }
- }
-
- /**
- * Destroy all cached components.
- */
- public void destroy() {
- for (ComponentProvider cp : cache.values()) {
- if (cp instanceof Destroyable) {
- Destroyable d = (Destroyable)cp;
- d.destroy();
- }
- }
- }
-
- /**
- * Inject on a collection of providers.
- *
- * @param providers the collection of providers.
- */
- public void injectOnProviderInstances(Collection<?> providers) {
- for (Object o : providers) {
- injectOnProviderInstance(o);
- }
- }
-
- /**
- * Inject on a provider.
- *
- * @param provider the provider.
- */
- public void injectOnProviderInstance(Object provider) {
- Class c = provider.getClass();
- ComponentInjector ci = new ComponentInjector(ipc, c);
- ci.inject(provider);
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderServices.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderServices.java
deleted file mode 100644
index 2a069429033..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ProviderServices.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.component;
-
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.factory.InjectableProviderFactory;
-import com.sun.jersey.spi.inject.ConstrainedTo;
-import com.sun.jersey.spi.inject.ConstrainedToType;
-import com.sun.jersey.spi.service.ServiceFinder;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-/**
- * Combines access to provider instances given a set of provider classes,
- * a set of provider instances and providers registered in META-INF/services.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ProviderServices {
- private static final Logger LOGGER = Logger.getLogger(ProviderServices.class.getName());
-
- private final Class<? extends ConstrainedToType> constraintToType;
-
- private final ProviderFactory componentProviderFactory;
-
- private final Set<Class<?>> providers;
-
- private final Set providerInstances;
-
- /**
- * Create the provider services.
- *
- * @param componentProviderFactory
- * @param providers
- * @param providerInstances
- */
- public ProviderServices(
- ProviderFactory componentProviderFactory,
- Set<Class<?>> providers,
- Set<?> providerInstances) {
- this(ConstrainedToType.class, componentProviderFactory, providers, providerInstances);
- }
-
- /**
- * Create the provider services.
- *
- * @param constraintToType
- * @param componentProviderFactory
- * @param providers
- * @param providerInstances
- */
- public ProviderServices(
- Class<? extends ConstrainedToType> constraintToType,
- ProviderFactory componentProviderFactory,
- Set<Class<?>> providers,
- Set<?> providerInstances) {
- this.constraintToType = constraintToType;
- this.componentProviderFactory = componentProviderFactory;
- this.providers = providers;
- this.providerInstances = providerInstances;
- }
-
- public void update(Set<Class<?>> providers, Set<?> providerInstances, InjectableProviderFactory ipf) {
- final Set<Class<?>> addedProviders = diff(this.providers, providers);
- final Set<?> addedProviderInstances = diff(this.providerInstances, providerInstances);
-
- this.providers.clear();
- this.providers.addAll(providers);
-
- this.providerInstances.clear();
- this.providerInstances.addAll(providerInstances);
-
- final ProviderServices _ps = new ProviderServices(componentProviderFactory, addedProviders, addedProviderInstances);
- final InjectableProviderFactory _ipf = new InjectableProviderFactory();
- _ipf.configureProviders(_ps);
- ipf.update(_ipf);
- }
-
- private <T> Set<T> diff(Set<T> s1, Set<T> s2) {
- Set<T> diff = new LinkedHashSet<T>();
-
- for (T t : s1) {
- if (!s2.contains(t)) {
- diff.add(t);
- }
- }
-
- for (T t : s2) {
- if (!s1.contains(t)) {
- diff.add(t);
- }
- }
-
- return diff;
- }
-
- public ProviderFactory getComponentProviderFactory() {
- return componentProviderFactory;
- }
-
- public <T> Set<T> getProviders(Class<T> provider) {
- Set<T> ps = new LinkedHashSet<T>();
- ps.addAll(getProviderInstances(provider));
- for (Class pc : getProviderClasses(provider)) {
- Object o = getComponent(pc);
- if (o != null) {
- ps.add(provider.cast(o));
- }
- }
-
- return ps;
- }
-
- public <T> Set<T> getServices(Class<T> provider) {
- Set<T> ps = new LinkedHashSet<T>();
- for (ProviderClass pc : getServiceClasses(provider)) {
- Object o = getComponent(pc);
- if (o != null) {
- ps.add(provider.cast(o));
- }
- }
-
- return ps;
- }
-
- public <T> Set<T> getProvidersAndServices(Class<T> provider) {
- Set<T> ps = new LinkedHashSet<T>();
- ps.addAll(getProviderInstances(provider));
- for (ProviderClass pc : getProviderAndServiceClasses(provider)) {
- Object o = getComponent(pc);
- if (o != null) {
- ps.add(provider.cast(o));
- }
- }
-
- return ps;
- }
-
- public static interface ProviderListener<T> {
- void onAdd(T t);
- }
-
- public <T> void getProviders(Class<T> provider, ProviderListener listener) {
- for (T t : getProviderInstances(provider)) {
- listener.onAdd(t);
- }
-
- for (ProviderClass pc : getProviderOnlyClasses(provider)) {
- Object o = getComponent(pc);
- if (o != null) {
- listener.onAdd(provider.cast(o));
- }
- }
- }
-
- public <T> void getProvidersAndServices(Class<T> provider, ProviderListener listener) {
- for (T t : getProviderInstances(provider)) {
- listener.onAdd(t);
- }
-
- for (ProviderClass pc : getProviderAndServiceClasses(provider)) {
- Object o = getComponent(pc);
- if (o != null) {
- listener.onAdd(provider.cast(o));
- }
- }
- }
-
- public <T> List<T> getInstances(Class<T> provider, String[] classNames) {
- List<T> ps = new LinkedList<T>();
- for (String className : classNames) {
- try {
- Class<?> c = ReflectionHelper.classForNameWithException(className);
- if (provider.isAssignableFrom(c)) {
- Object o = getComponent(c);
- if (o != null)
- ps.add(provider.cast(o));
- } else {
- LOGGER.severe("The class " +
- className +
- " is not assignable to the class " +
- provider.getName() +
- ". This class is ignored.");
- }
- } catch (ClassNotFoundException e) {
- LOGGER.severe("The class " +
- className +
- " could not be found" +
- ". This class is ignored.");
- }
- }
-
- return ps;
- }
-
- public <T> List<T> getInstances(Class<T> provider, Class<? extends T>[] classes) {
- List<T> ps = new LinkedList<T>();
- for (Class<? extends T> c : classes) {
- Object o = getComponent(c);
- if (o != null)
- ps.add(provider.cast(o));
- }
-
- return ps;
- }
-
- private Object getComponent(Class provider) {
- ComponentProvider cp = componentProviderFactory.getComponentProvider(provider);
- return (cp != null) ? cp.getInstance() : null;
- }
-
- private Object getComponent(ProviderClass provider) {
- ComponentProvider cp = componentProviderFactory.getComponentProvider(provider);
- return (cp != null) ? cp.getInstance() : null;
- }
-
- private <T> Set<T> getProviderInstances(Class<T> service) {
- Set<T> sp = new LinkedHashSet<T>();
- for (Object p : providerInstances) {
- if (service.isInstance(p) && constrainedTo(p.getClass()))
- sp.add(service.cast(p));
- }
-
- return sp;
- }
-
- private Set<Class> getProviderClasses(Class<?> service) {
- Set<Class> sp = new LinkedHashSet<Class>();
- for (Class p : providers) {
- if (service.isAssignableFrom(p) && constrainedTo(p))
- sp.add(p);
- }
-
- return sp;
- }
-
- public class ProviderClass {
- final boolean isServiceClass;
- final Class c;
-
- ProviderClass(Class c) {
- this.c = c;
- this.isServiceClass = false;
- }
-
- ProviderClass(Class c, boolean isServiceClass) {
- this.c = c;
- this.isServiceClass = isServiceClass;
- }
- }
-
- private Set<ProviderClass> getProviderAndServiceClasses(Class<?> service) {
- Set<ProviderClass> sp = getProviderOnlyClasses(service);
- getServiceClasses(service, sp);
- return sp;
- }
-
- private Set<ProviderClass> getProviderOnlyClasses(Class<?> service) {
- Set<ProviderClass> sp = new LinkedHashSet<ProviderClass>();
- for(Class c : getProviderClasses(service)) {
- sp.add(new ProviderClass(c));
- }
- return sp;
- }
-
- private Set<ProviderClass> getServiceClasses(Class<?> service) {
- Set<ProviderClass> sp = new LinkedHashSet<ProviderClass>();
- getServiceClasses(service, sp);
- return sp;
- }
-
- private void getServiceClasses(Class<?> service, Set<ProviderClass> sp) {
- // Get the service-defined provider classes that implement serviceClass
- LOGGER.log(Level.CONFIG, "Searching for providers that implement: " + service);
- Class<?>[] pca = ServiceFinder.find(service, true).toClassArray();
- for (Class pc : pca) {
- if (constrainedTo(pc)) {
- LOGGER.log(Level.CONFIG, " Provider found: " + pc);
- }
- }
- // Add service-defined providers to the set after application-defined
- for (Class pc : pca) {
- if (constrainedTo(pc)) {
- if(service.isAssignableFrom(pc)) {
- sp.add(new ProviderClass(pc, true));
- } else {
- LOGGER.log(Level.CONFIG, "Provider " + pc.getName() +
- " won't be used because its not assignable to " +
- service.getName() + ". This might be caused by clashing " +
- "container-provided and application-bundled Jersey classes.");
- }
- }
- }
- }
-
- private boolean constrainedTo(Class<?> p) {
- final ConstrainedTo ct = p.getAnnotation(ConstrainedTo.class);
- return (ct != null)
- ? ct.value().isAssignableFrom(constraintToType)
- : true;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.java
deleted file mode 100644
index 7a1f326fcc6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-/**
- * A component processor capable of performing pre-construction and
- * post-construction initialization.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCComponentProcessor {
-
- /**
- * Pre-construction initialization of a component.
- */
- void preConstruct();
-
- /**
- * Post-construction initialization of a component.
- * <p>
- * For example, this may perform injecton onto the component.
- *
- * @param o the component instance.
- */
- void postConstruct(Object o);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.java
deleted file mode 100644
index 1630d2f756c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-import com.sun.jersey.core.spi.component.ComponentScope;
-
-/**
- * A factory for obtaining {@link IoCComponentProcessor} instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCComponentProcessorFactory {
-
- /**
- * Get the scope of the component, if that component is managed
- * by the Jersey runtime.
- *
- * @param c the class to determine the scope from.
- * @return the scope, otherwise null if the scope cannot be determined.
- */
- ComponentScope getScope(Class c);
-
- /**
- * Get a {@link IoCComponentProcessor} instance given a class
- * and scope.
- *
- * @param c the class.
- * @param scope the scope.
- * @return the IoC component processor or null if no processor is
- * available for the class and scope.
- */
- IoCComponentProcessor get(Class c, ComponentScope scope);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.java
deleted file mode 100644
index aecd85e9db5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-/**
- * An initializer interface to obtain a {@link IoCComponentProcessorFactory}
- * instance.
- * <p>
- * A {@link IoCComponentProcessorFactory} implementation may implement this
- * interface to be initialized with the {@link IoCComponentProcessorFactory}
- * instance.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see IoCComponentProcessorFactory
- */
-public interface IoCComponentProcessorFactoryInitializer {
-
- /**
- * Initialize with the {@link IoCComponentProcessorFactory}.
- *
- * @param cpf the IoC component processor factory.
- */
- void init(IoCComponentProcessorFactory cpf);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.java
deleted file mode 100644
index 3fddc90a4e9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-import com.sun.jersey.core.spi.component.ComponentProvider;
-
-/**
- * An IoC-based component provider.
- * <p>
- * This is a base interface for particular specializations of IoC-based
- * component providers that vary in terms of responsibility for managing
- * components.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCComponentProvider extends ComponentProvider {
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.java
deleted file mode 100644
index 321570dbd1f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentProviderFactory;
-import java.lang.reflect.Field;
-
-/**
- * An IoC component provider factory. An implementaton of such a class may be
- * used to support integration with Inversion of Control frameworks such as
- * Spring and Guice.
- * <p>
- * An instance of IoCComponentProviderFactory may be registered with a Client
- * or WebApplication instance on contruction and initialization respectively.
- * <p>
- * When a component, a resource class or provider class, needs to be managed
- * the runtime will defer to the registered IoCComponentProviderFactory instance
- * to obtain a {@link IoCComponentProvider} from which a component instance,
- * of the resource class or provider class, can be obtained.
- * If the component is not supported then a null value may be returned and the
- * runtime will manage the component.
- * <p>
- * Specializations of {@link IoCComponentProvider} must be returned by the
- * <code>getComponentProvider</code> methods that declare the boundary of
- * responsibility, between the runtime and the underlying IoC framework,
- * for management of a component.
- * <p>
- * If an instance of {@link IoCManagedComponentProvider} is returned then
- * the component is fully managed by the underlying IoC framework, which
- * includes managing the construction, injection and destruction according
- * to the life-cycle declared in the IoC framework's semantics.
- * <p>
- * If an instance of {@link IoCInstantiatedComponentProvider} is returned then
- * the component is instantiated and injected by the underlying IoC framework,
- * but the life-cycle is managed by the runtime according to the life-cycle
- * declared in the runtime's semantics.
- * <p>
- * If an instance of {@link IoCProxiedComponentProvider} is returned then the
- * component is fully managed by the runtime but when an instance is created
- * the underlying IoC framework is deferred to for creating a proxy of the
- * component instance.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCComponentProviderFactory extends ComponentProviderFactory<IoCComponentProvider> {
-
- /**
- * Get the IoC component provider for a class.
- *
- * @param c the class
- * @return the IoC component provider for the class, otherwise null if the
- * class is not supported.
- */
- IoCComponentProvider getComponentProvider(Class<?> c);
-
- /**
- * Get the IoC component provider for a class with additional context.
- * <p>
- * The additional context will be associated with the annotations and
- * optionally an annotated object. For example, a component provider may
- * be requested for a class that is the type of a {@link Field}, or be
- * requested for a class that is the type of a method parameter.
- *
- * @param cc the component context to obtain annotations and
- * the annotated object (if present).
- * @param c the class
- * @return the IoC component provider for the class, otherwise null if the
- * class is not supported.
- */
- IoCComponentProvider getComponentProvider(ComponentContext cc, Class<?> c);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.java
deleted file mode 100644
index 9f051070d4b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCDestroyable {
-
- public void destroy(Object o);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.java
deleted file mode 100644
index f310f97b3fa..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-import com.sun.jersey.core.spi.component.ComponentScope;
-
-/**
- * An IoC-fully-managed component provider.
- * <p>
- * The component is fully managed by the underlying IoC framework, which
- * includes managing the construction, injection and destruction according
- * to the life-cycle declared in the IoC framework's semantics. It is the
- * reponsibility of the IoC framework to inject Jersey-based artifacts onto
- * the component.
- * <p>
- * The {@link IoCComponentProcessorFactory} may be utilized
- * to inject Jersey-based artfacts onto a component at post construction
- * interception.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see IoCComponentProcessorFactory
- */
-public interface IoCFullyManagedComponentProvider extends IoCComponentProvider {
- /**
- * Get the scope.
- *
- * @return the scope.
- */
- ComponentScope getScope();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.java
deleted file mode 100644
index 0bdbecf4b60..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-/**
- * An IoC-instantiated component provider.
- * <p>
- * The component is instantiated and injected by the underlying IoC framework,
- * but the life-cycle is managed by the runtime according to the life-cycle
- * declared by the runtime's semantics.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCInstantiatedComponentProvider extends IoCComponentProvider {
- /**
- * The instance for the runtime to perform injection on.
- * <p>
- * Some IoC frameworks create proxies that proxy instances of the class to
- * enable, for example, Aspect Oriented Programming, to support cross
- * cutting functionality.
- * If such proxies are returned then any injection of onto fields of the
- * proxy (if any) will not have any effect. The runtime requires access
- * to the proxied instance such that injection onto fields will take
- * effect.
- *
- * @param o the component instance returned by {@link #getInstance()}.
- * @return the instance to inject on.
- */
- Object getInjectableInstance(Object o);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.java
deleted file mode 100644
index 2b09d3bb390..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-import com.sun.jersey.core.spi.component.ComponentScope;
-
-/**
- * An IoC-managed component provider.
- * <p>
- * The component is managed by the underlying IoC framework, which
- * includes managing the construction, injection and destruction according
- * to the life-cycle declared in the IoC framework's semantics. It is the
- * reponsibility of the Jersey runtime to inject Jersey-based artfacts onto
- * the component.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCManagedComponentProvider extends IoCInstantiatedComponentProvider {
- /**
- * Get the component scope.
- * <p>
- * The scope of the component declared by the underlying IoC framework
- * needs to be mapped to a {@link ComponentScope} value supported by the
- * runtime. This enables the runtime to correctly perform its own injecton
- * onto a component instance.
- *
- * @return the scope
- */
- ComponentScope getScope();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.java
deleted file mode 100644
index 4f648cccf41..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-import com.sun.jersey.core.spi.component.ComponentDestructor;
-import com.sun.jersey.core.spi.component.ComponentInjector;
-import com.sun.jersey.core.spi.component.ComponentProvider;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ProviderFactory;
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collections;
-import java.util.List;
-import java.util.logging.Level;
-
-/**
- * An extension of {@link ProviderFactory} that defers to an
- * {@link IoCComponentProviderFactory}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class IoCProviderFactory extends ProviderFactory {
- private final List<IoCComponentProviderFactory> factories;
-
- /**
- *
- * @param ipc the injectable provider context.
- * @param icpf the IoC component provider factory.
- */
- public IoCProviderFactory(
- InjectableProviderContext ipc,
- IoCComponentProviderFactory icpf) {
- this(ipc, Collections.singletonList(icpf));
- }
-
- /**
- *
- * @param ipc the injectable provider context.
- * @param factories the list of IoC component provider factory.
- */
- public IoCProviderFactory(
- InjectableProviderContext ipc,
- List<IoCComponentProviderFactory> factories) {
- super(ipc);
- this.factories = factories;
- }
-
- @Override
- public ComponentProvider _getComponentProvider(Class c) {
- IoCComponentProvider icp = null;
- for (IoCComponentProviderFactory f : factories) {
- icp = f.getComponentProvider(c);
- if (icp != null)
- break;
- }
- return (icp == null) ? super._getComponentProvider(c) : wrap(c, icp);
- }
-
- private ComponentProvider wrap(Class c, IoCComponentProvider icp) {
- if (icp instanceof IoCManagedComponentProvider) {
- IoCManagedComponentProvider imcp = (IoCManagedComponentProvider)icp;
- if (imcp.getScope() == ComponentScope.Singleton) {
- return new ManagedSingleton(getInjectableProviderContext(), imcp, c);
- } else {
- throw new RuntimeException("The scope of the component " + c + " must be a singleton");
- }
- } else if (icp instanceof IoCFullyManagedComponentProvider) {
- IoCFullyManagedComponentProvider ifmcp = (IoCFullyManagedComponentProvider)icp;
- return new FullyManagedSingleton(ifmcp.getInstance());
- } else if (icp instanceof IoCInstantiatedComponentProvider) {
- IoCInstantiatedComponentProvider iicp = (IoCInstantiatedComponentProvider)icp;
- return new InstantiatedSingleton(getInjectableProviderContext(), iicp, c);
- } else if (icp instanceof IoCProxiedComponentProvider) {
- IoCProxiedComponentProvider ipcp = (IoCProxiedComponentProvider)icp;
- ComponentProvider cp = super._getComponentProvider(c);
- // Problem creating the component provider
- if (cp == null)
- return null;
-
- return new ProxiedSingletonWrapper(ipcp, cp, c);
- }
- throw new UnsupportedOperationException();
- }
-
- private static class InstantiatedSingleton implements ComponentProvider, Destroyable {
- private final Object o;
-
- private final IoCDestroyable destroyable;
-
- private final ComponentDestructor cd;
-
- InstantiatedSingleton(InjectableProviderContext ipc,
- IoCInstantiatedComponentProvider iicp,
- Class c) {
- this.destroyable = (iicp instanceof IoCDestroyable)
- ? (IoCDestroyable) iicp : null;
-
- o = iicp.getInstance();
-
- this.cd = (destroyable == null) ? new ComponentDestructor(c) : null;
-
- if (destroyable == null) {
- ComponentInjector ci = new ComponentInjector(
- ipc,
- c);
- ci.inject(iicp.getInjectableInstance(o));
- }
- }
-
- @Override
- public Object getInstance() {
- return o;
- }
-
- @Override
- public void destroy() {
- if (destroyable != null) {
- destroyable.destroy(o);
- } else {
- try {
- cd.destroy(o);
- } catch (IllegalAccessException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- } catch (IllegalArgumentException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- } catch (InvocationTargetException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- }
- }
- }
- }
-
- private static class ManagedSingleton implements ComponentProvider {
- private final Object o;
-
- ManagedSingleton(InjectableProviderContext ipc,
- IoCInstantiatedComponentProvider iicp,
- Class c) {
- ComponentInjector rci = new ComponentInjector(
- ipc,
- c);
- o = iicp.getInstance();
- rci.inject(iicp.getInjectableInstance(o));
- }
-
- @Override
- public Object getInstance() {
- return o;
- }
- }
-
- private static class FullyManagedSingleton implements ComponentProvider {
- private final Object o;
-
- FullyManagedSingleton(Object o) {
- this.o = o;
- }
-
- @Override
- public Object getInstance() {
- return o;
- }
- }
-
- private static class ProxiedSingletonWrapper implements ComponentProvider, Destroyable {
- private final Destroyable destroyable;
-
- private final Object proxy;
-
- ProxiedSingletonWrapper(IoCProxiedComponentProvider ipcp,
- ComponentProvider cp,
- Class c) {
-
- this.destroyable = (cp instanceof Destroyable)
- ? (Destroyable) cp : null;
-
- Object o = cp.getInstance();
- this.proxy = ipcp.proxy(o);
- if (!this.proxy.getClass().isAssignableFrom(o.getClass()))
- throw new IllegalStateException("Proxied object class " + this.proxy.getClass() +
- " is not assignable from object class " + o.getClass());
- }
-
- @Override
- public Object getInstance() {
- return proxy;
- }
-
- @Override
- public void destroy() {
- if (destroyable != null) {
- destroyable.destroy();
- }
- }
- }
- } \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.java
deleted file mode 100644
index 3951eb0f987..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.component.ioc;
-
-/**
- * An IoC-proxied component provider.
- * <p>
- * The component is fully managed by the runtime but when an instance is created
- * the underlying IoC framework is deferred to for creating a proxy of the
- * component instance.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface IoCProxiedComponentProvider extends IoCComponentProvider {
- /**
- * This method will not be invoked since an instance is
- * created by the runtime, and that instance may be proxied via the
- * {@link #proxy(java.lang.Object) } method.
- *
- */
- Object getInstance();
-
- /**
- * Proxy a component instance.
- *
- * @param o the component instance to proxy.
- * @return the proxied instance.
- */
- Object proxy(Object o);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/package-info.java
deleted file mode 100644
index 45b0171ade3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/ioc/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for IoC-based components.
- */
-package com.sun.jersey.core.spi.component.ioc;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/package-info.java
deleted file mode 100644
index a856d113880..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/component/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for components.
- */
-package com.sun.jersey.core.spi.component;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.java
deleted file mode 100644
index 9baf4a8f308..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.factory;
-
-import com.sun.jersey.api.uri.UriBuilderImpl;
-import com.sun.jersey.spi.HeaderDelegateProvider;
-import com.sun.jersey.spi.service.ServiceFinder;
-import java.net.URI;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.NewCookie;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.Variant.VariantListBuilder;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-/**
- * An abstract implementation of {@link RuntimeDelegate} that
- * provides support common to the client and server.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractRuntimeDelegate extends RuntimeDelegate {
-
- final private Set<HeaderDelegateProvider> hps =
- new HashSet<HeaderDelegateProvider>();
-
- final private Map<Class<?>, HeaderDelegate> map =
- new WeakHashMap<Class<?>, HeaderDelegate>();
-
- public AbstractRuntimeDelegate() {
- for (HeaderDelegateProvider p : ServiceFinder.find(HeaderDelegateProvider.class, true))
- hps.add(p);
-
- /**
- * Construct a map for quick look up of known header classes
- */
- map.put(EntityTag.class, _createHeaderDelegate(EntityTag.class));
- map.put(MediaType.class, _createHeaderDelegate(MediaType.class));
- map.put(CacheControl.class, _createHeaderDelegate(CacheControl.class));
- map.put(NewCookie.class, _createHeaderDelegate(NewCookie.class));
- map.put(Cookie.class, _createHeaderDelegate(Cookie.class));
- map.put(URI.class, _createHeaderDelegate(URI.class));
- map.put(Date.class, _createHeaderDelegate(Date.class));
- map.put(String.class, _createHeaderDelegate(String.class));
- }
-
- @Override
- public VariantListBuilder createVariantListBuilder() {
- return new VariantListBuilderImpl();
- }
-
- @Override
- public ResponseBuilder createResponseBuilder() {
- return new ResponseBuilderImpl();
- }
-
- @Override
- public UriBuilder createUriBuilder() {
- return new UriBuilderImpl();
- }
-
- @Override
- public <T> HeaderDelegate<T> createHeaderDelegate(Class<T> type) {
- if (type == null)
- throw new IllegalArgumentException("type parameter cannot be null");
-
- HeaderDelegate h = map.get(type);
- if (h != null) return h;
-
- return _createHeaderDelegate(type);
- }
-
- private <T> HeaderDelegate<T> _createHeaderDelegate(Class<T> type) {
- for (HeaderDelegateProvider hp: hps)
- if (hp.supports(type))
- return hp;
-
- return null;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ContextResolverFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ContextResolverFactory.java
deleted file mode 100644
index 7e16d7743f6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ContextResolverFactory.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.factory;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.reflection.ReflectionHelper.DeclaringClassInterfacePair;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.core.util.KeyComparatorHashMap;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.ConcurrentHashMap;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.ContextResolver;
-
-/**
- * A factory for managing {@link ContextResolver} instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ContextResolverFactory {
- private final Map<Type, Map<MediaType, ContextResolver>> resolver =
- new HashMap<Type, Map<MediaType, ContextResolver>>(4);
-
- private final Map<Type, ConcurrentHashMap<MediaType, ContextResolver>> cache =
- new HashMap<Type, ConcurrentHashMap<MediaType, ContextResolver>>(4);
-
- public void init(ProviderServices providersServices,
- InjectableProviderFactory ipf) {
- Map<Type, Map<MediaType, List<ContextResolver>>> rs =
- new HashMap<Type, Map<MediaType, List<ContextResolver>>>();
-
- Set<ContextResolver> providers =
- providersServices.getProviders(ContextResolver.class);
- for (ContextResolver provider : providers) {
- List<MediaType> ms = MediaTypes.createMediaTypes(
- provider.getClass().getAnnotation(Produces.class));
-
- Type type = getParameterizedType(provider.getClass());
-
- Map<MediaType, List<ContextResolver>> mr = rs.get(type);
- if (mr == null) {
- mr = new HashMap<MediaType, List<ContextResolver>>();
- rs.put(type, mr);
- }
- for (MediaType m : ms) {
- List<ContextResolver> crl = mr.get(m);
- if (crl == null) {
- crl = new ArrayList<ContextResolver>();
- mr.put(m, crl);
- }
- crl.add(provider);
- }
- }
-
- // Reduce set of two or more context resolvers for same type and
- // media type
-
- for (Map.Entry<Type, Map<MediaType, List<ContextResolver>>> e : rs.entrySet()) {
- Map<MediaType, ContextResolver> mr = new KeyComparatorHashMap<MediaType, ContextResolver>(
- 4, MessageBodyFactory.MEDIA_TYPE_COMPARATOR);
- resolver.put(e.getKey(), mr);
-
- cache.put(e.getKey(), new ConcurrentHashMap<MediaType, ContextResolver>(4));
-
- for (Map.Entry<MediaType, List<ContextResolver>> f : e.getValue().entrySet()) {
- mr.put(f.getKey(), reduce(f.getValue()));
- }
- }
-
- // Add injectable
-
- ipf.add(new InjectableProvider<Context, Type>() {
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public Injectable getInjectable(ComponentContext ic, Context ac, Type c) {
- if (!(c instanceof ParameterizedType))
- return null;
- ParameterizedType pType = (ParameterizedType)c;
- if (pType.getRawType() != ContextResolver.class)
- return null;
- Type type = pType.getActualTypeArguments()[0];
- // TODO check if concrete type
-
- final ContextResolver cr = getResolver(ic, type);
- if (cr == null) {
- return new Injectable() {
- public Object getValue() {
- return null;
- }
- };
- } else {
- return new Injectable() {
- public Object getValue() {
- return cr;
- }
- };
- }
- }
-
- ContextResolver getResolver(ComponentContext ic, Type type) {
- Map<MediaType, ContextResolver> x = resolver.get(type);
- if (x == null)
- return null;
-
- List<MediaType> ms = getMediaTypes(ic);
- if (ms.size() == 1) {
- return resolve(type, ms.get(0));
- } else {
- Set<MediaType> ml = new TreeSet<MediaType>(MediaTypes.MEDIA_TYPE_COMPARATOR);
- for (MediaType m : ms) {
- if (m.isWildcardType()) {
- ml.add(MediaTypes.GENERAL_MEDIA_TYPE);
- } else if (m.isWildcardSubtype()) {
- ml.add(new MediaType(m.getType(), "*"));
- ml.add(MediaTypes.GENERAL_MEDIA_TYPE);
- } else {
- ml.add(new MediaType(m.getType(), m.getSubtype()));
- ml.add(new MediaType(m.getType(), "*"));
- ml.add(MediaTypes.GENERAL_MEDIA_TYPE); }
- }
-
- List<ContextResolver> crl = new ArrayList<ContextResolver>(ml.size());
- for (MediaType m : ms) {
- ContextResolver cr = x.get(m);
- if (cr != null) crl.add(cr);
- }
- if (crl.isEmpty())
- return null;
-
- return new ContextResolverAdapter(crl);
- }
- }
-
- List<MediaType> getMediaTypes(ComponentContext ic) {
- Produces p = null;
- for (Annotation a : ic.getAnnotations()) {
- if (a instanceof Produces) {
- p = (Produces)a;
- break;
- }
- }
-
- return MediaTypes.createMediaTypes(p);
- }
- });
- }
-
- private Type getParameterizedType(Class c) {
- DeclaringClassInterfacePair p = ReflectionHelper.getClass(
- c, ContextResolver.class);
-
- Type[] as = ReflectionHelper.getParameterizedTypeArguments(p);
-
- return (as != null) ? as[0] : Object.class;
- }
-
- private static final NullContextResolverAdapter NULL_CONTEXT_RESOLVER =
- new NullContextResolverAdapter();
-
- private static final class NullContextResolverAdapter implements ContextResolver {
- public Object getContext(Class type) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- }
-
- private static final class ContextResolverAdapter implements ContextResolver {
-
- private final ContextResolver[] cra;
-
- ContextResolverAdapter(ContextResolver... cra) {
- this(removeNull(cra));
- }
-
- ContextResolverAdapter(List<ContextResolver> crl) {
- this.cra = crl.toArray(new ContextResolver[crl.size()]);
- }
-
- public Object getContext(Class objectType) {
- for (ContextResolver cr : cra) {
- Object c = cr.getContext(objectType);
- if (c != null) return c;
- }
- return null;
- }
-
- ContextResolver reduce() {
- if (cra.length == 0) {
- return NULL_CONTEXT_RESOLVER;
- } if (cra.length == 1) {
- return cra[0];
- } else {
- return this;
- }
- }
-
- private static List<ContextResolver> removeNull(ContextResolver... cra) {
- List<ContextResolver> crl = new ArrayList<ContextResolver>(cra.length);
- for (ContextResolver cr : cra) {
- if (cr != null) {
- crl.add(cr);
- }
- }
- return crl;
- }
- }
-
- private ContextResolver reduce(List<ContextResolver> r) {
- if (r.size() == 1) {
- return r.iterator().next();
- } else {
- return new ContextResolverAdapter(r);
- }
- }
-
- public <T> ContextResolver<T> resolve(Type t, MediaType m) {
- final ConcurrentHashMap<MediaType, ContextResolver> crMapCache = cache.get(t);
- if (crMapCache == null) return null;
-
- if (m == null)
- m = MediaTypes.GENERAL_MEDIA_TYPE;
-
- ContextResolver<T> cr = crMapCache.get(m);
- if (cr == null) {
- final Map<MediaType, ContextResolver> crMap = resolver.get(t);
-
- if (m.isWildcardType()) {
- cr = crMap.get(MediaTypes.GENERAL_MEDIA_TYPE);
- if (cr == null) {
- cr = NULL_CONTEXT_RESOLVER;
- }
- } else if (m.isWildcardSubtype()) {
- // Include x, x/* and */*
- final ContextResolver<T> subTypeWildCard = crMap.get(m);
- final ContextResolver<T> wildCard = crMap.get(MediaTypes.GENERAL_MEDIA_TYPE);
-
- cr = new ContextResolverAdapter(subTypeWildCard, wildCard).reduce();
- } else {
- // Include x, x/* and */*
- final ContextResolver<T> type = crMap.get(m);
- final ContextResolver<T> subTypeWildCard = crMap.get(new MediaType(m.getType(), "*"));
- final ContextResolver<T> wildCard = crMap.get(MediaType.WILDCARD_TYPE);
-
- cr = new ContextResolverAdapter(type, subTypeWildCard, wildCard).reduce();
- }
-
- ContextResolver<T> _cr = crMapCache.putIfAbsent(m, cr);
- // If there is already a value in the cache use that
- // instance, and discard the new and redundent instance, to
- // ensure the same instance is always returned.
- // The cached instance and the new instance will have the same
- // functionality.
- if (_cr != null) {
- cr = _cr;
- }
- }
-
- return (cr != NULL_CONTEXT_RESOLVER) ? cr : null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/InjectableProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/InjectableProviderFactory.java
deleted file mode 100644
index b4078d5f524..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/InjectableProviderFactory.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.factory;
-
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ProviderServices.ProviderListener;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A factory for managing {@link InjectableProvider} instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class InjectableProviderFactory implements InjectableProviderContext {
-
- private static final class MetaInjectableProvider {
- final InjectableProvider ip;
- final Class<? extends Annotation> ac;
- final Class<?> cc;
-
- MetaInjectableProvider(
- InjectableProvider ip,
- Class<? extends Annotation> ac,
- Class<?> cc) {
- this.ip = ip;
- this.ac = ac;
- this.cc = cc;
- }
- }
-
- private final Map<Class<? extends Annotation>, LinkedList<MetaInjectableProvider>> ipm =
- new HashMap<Class<? extends Annotation>, LinkedList<MetaInjectableProvider>>();
-
- public final void update(InjectableProviderFactory ipf) {
- for (Map.Entry<Class<? extends Annotation>, LinkedList<MetaInjectableProvider>> e : ipf.ipm.entrySet()) {
- getList(e.getKey()).addAll(e.getValue());
- }
- }
-
- @SuppressWarnings("unchecked")
- public final void add(InjectableProvider ip) {
- Type[] args = getMetaArguments(ip.getClass());
- if (args != null) {
- MetaInjectableProvider mip = new MetaInjectableProvider(ip,
- (Class)args[0], (Class)args[1]);
-
- // TODO change to add first
- getList(mip.ac).add(mip);
- } else {
- // TODO throw exception or log error
- }
- }
-
- public final void configure(ProviderServices providerServices) {
- providerServices.getProvidersAndServices(InjectableProvider.class,
- new ProviderListener<InjectableProvider>() {
- public void onAdd(InjectableProvider ip) {
- add(ip);
- }
- });
- }
-
- public final void configureProviders(ProviderServices providerServices) {
- providerServices.getProviders(InjectableProvider.class,
- new ProviderListener<InjectableProvider>() {
- public void onAdd(InjectableProvider ip) {
- add(ip);
- }
- });
- }
-
- private LinkedList<MetaInjectableProvider> getList(Class<? extends Annotation> c) {
- LinkedList<MetaInjectableProvider> l = ipm.get(c);
- if (l == null) {
- l = new LinkedList<MetaInjectableProvider>();
- ipm.put(c, l);
- }
- return l;
- }
-
- private Type[] getMetaArguments(Class<? extends InjectableProvider> c) {
- Class _c = c;
- while (_c != Object.class) {
- Type[] ts = _c.getGenericInterfaces();
- for (Type t : ts) {
- if (t instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)t;
- if (pt.getRawType() == InjectableProvider.class) {
- Type[] args = pt.getActualTypeArguments();
- for (int i = 0; i < args.length; i++)
- args[i] = getResolvedType(args[i], c, _c);
- if (args[0] instanceof Class &&
- args[1] instanceof Class)
- return args;
- }
- }
- }
-
- _c = _c.getSuperclass();
- }
-
- return null;
- }
-
- private Type getResolvedType(Type t, Class c, Class dc) {
- if (t instanceof Class)
- return t;
- else if (t instanceof TypeVariable) {
- ReflectionHelper.ClassTypePair ct = ReflectionHelper.
- resolveTypeVariable(c, dc, (TypeVariable)t);
- if (ct != null)
- return ct.c;
- else
- return t;
- } else if (t instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)t;
- return pt.getRawType();
- } else
- return t;
- }
-
- private List<MetaInjectableProvider> findInjectableProviders(
- Class<? extends Annotation> ac,
- Class<?> cc,
- ComponentScope s) {
- List<MetaInjectableProvider> subips = new ArrayList<MetaInjectableProvider>();
- for (MetaInjectableProvider i : getList(ac)) {
- if (s == i.ip.getScope()) {
- if (i.cc.isAssignableFrom(cc)) {
- subips.add(i);
- }
- }
- }
-
- return subips;
- }
-
- // InjectableProviderContext
-
- public boolean isAnnotationRegistered(Class<? extends Annotation> ac,
- Class<?> cc) {
- for (MetaInjectableProvider i : getList(ac)) {
- if (i.cc.isAssignableFrom(cc)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isInjectableProviderRegistered(Class<? extends Annotation> ac,
- Class<?> cc,
- ComponentScope s) {
- return !findInjectableProviders(ac, cc, s).isEmpty();
- }
-
- public final <A extends Annotation, C> Injectable getInjectable(
- Class<? extends Annotation> ac,
- ComponentContext ic,
- A a,
- C c,
- ComponentScope s) {
- for (MetaInjectableProvider mip : findInjectableProviders(ac, c.getClass(), s)) {
- Injectable i = mip.ip.getInjectable(ic, a, c);
- if (i != null)
- return i;
- }
- return null;
- }
-
- public final <A extends Annotation, C> Injectable getInjectable(
- Class<? extends Annotation> ac,
- ComponentContext ic,
- A a,
- C c,
- List<ComponentScope> ls) {
- for (ComponentScope s : ls) {
- Injectable i = getInjectable(ac, ic, a, c, s);
- if (i != null)
- return i;
- else {
- }
- }
-
- return null;
- }
-
- public <A extends Annotation, C> InjectableScopePair getInjectableWithScope(
- Class<? extends Annotation> ac,
- ComponentContext ic,
- A a,
- C c,
- List<ComponentScope> ls) {
- for (ComponentScope s : ls) {
- Injectable i = getInjectable(ac, ic, a, c, s);
- if (i != null)
- return new InjectableScopePair(i, s);
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/MessageBodyFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/MessageBodyFactory.java
deleted file mode 100644
index ccc4649a4ea..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/MessageBodyFactory.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.factory;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.reflection.ReflectionHelper.DeclaringClassInterfacePair;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.core.util.KeyComparator;
-import com.sun.jersey.core.util.KeyComparatorHashMap;
-import com.sun.jersey.core.util.KeyComparatorLinkedHashMap;
-import com.sun.jersey.spi.MessageBodyWorkers;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A factory for managing {@link MessageBodyReader} and {@link MessageBodyWriter}
- * instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class MessageBodyFactory implements MessageBodyWorkers {
- /* package */ static final KeyComparator<MediaType> MEDIA_TYPE_COMPARATOR =
- new KeyComparator<MediaType>() {
- public boolean equals(MediaType x, MediaType y) {
- return x.getType().equalsIgnoreCase(y.getType())
- && x.getSubtype().equalsIgnoreCase(y.getSubtype());
- }
-
- public int hash(MediaType k) {
- return k.getType().toLowerCase().hashCode() +
- k.getSubtype().toLowerCase().hashCode();
- }
-
- public int compare(MediaType o1, MediaType o2) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- };
-
- private final ProviderServices providerServices;
-
- private final boolean deprecatedProviderPrecedence;
-
- private Map<MediaType, List<MessageBodyReader>> readerProviders;
-
- private Map<MediaType, List<MessageBodyWriter>> writerProviders;
-
- private List<MessageBodyWriterPair> writerListProviders;
-
- private Map<MediaType, List<MessageBodyReader>> customReaderProviders;
-
- private Map<MediaType, List<MessageBodyWriter>> customWriterProviders;
-
- private List<MessageBodyWriterPair> customWriterListProviders;
-
- private static class MessageBodyWriterPair {
- final MessageBodyWriter mbw;
-
- final List<MediaType> types;
-
- MessageBodyWriterPair(MessageBodyWriter mbw, List<MediaType> types) {
- this.mbw = mbw;
- this.types = types;
- }
- }
-
- public MessageBodyFactory(ProviderServices providerServices, boolean deprecatedProviderPrecedence) {
- this.providerServices = providerServices;
- this.deprecatedProviderPrecedence = deprecatedProviderPrecedence;
- }
-
- private static class DistanceComparator<T> implements Comparator<T> {
- private final Class<T> c;
-
- private final Map<Class, Integer> distanceMap = new HashMap<Class, Integer>();
-
- DistanceComparator(Class c) {
- this.c = c;
- }
-
- public int compare(T o1, T o2) {
- int d1 = getDistance(o1);
- int d2 = getDistance(o2);
- return d2 - d1;
- }
-
- int getDistance(T t) {
- Integer d = distanceMap.get(t.getClass());
- if (d != null)
- return d;
-
- DeclaringClassInterfacePair p = ReflectionHelper.getClass(
- t.getClass(), c);
-
- Class[] as = ReflectionHelper.getParameterizedClassArguments(p);
- Class a = (as != null) ? as[0] : null;
- d = 0;
- while (a != null && a != Object.class) {
- d++;
- a = a.getSuperclass();
- }
-
- distanceMap.put(t.getClass(), d);
- return d;
- }
- }
-
- public void init() {
- initReaders();
- initWriters();
- }
-
- private void initReaders() {
- this.customReaderProviders = new KeyComparatorHashMap<MediaType, List<MessageBodyReader>>(
- MEDIA_TYPE_COMPARATOR);
- this.readerProviders = new KeyComparatorHashMap<MediaType, List<MessageBodyReader>>(
- MEDIA_TYPE_COMPARATOR);
-
- if(deprecatedProviderPrecedence) {
- initReaders(this.readerProviders, providerServices.getProvidersAndServices(MessageBodyReader.class));
- } else {
- initReaders(this.customReaderProviders, providerServices.getProviders(MessageBodyReader.class));
- initReaders(this.readerProviders, providerServices.getServices(MessageBodyReader.class));
- }
- }
-
- private void initReaders(Map<MediaType, List<MessageBodyReader>> providersMap, Set<MessageBodyReader> providersSet) {
- for (MessageBodyReader provider : providersSet) {
- List<MediaType> values = MediaTypes.createMediaTypes(
- provider.getClass().getAnnotation(Consumes.class));
- for (MediaType type : values)
- getClassCapability(providersMap, provider, type);
- }
-
- DistanceComparator<MessageBodyReader> dc = new DistanceComparator<MessageBodyReader>(MessageBodyReader.class);
- for (Map.Entry<MediaType, List<MessageBodyReader>> e : providersMap.entrySet()) {
- Collections.sort(e.getValue(), dc);
- }
- }
-
- private void initWriters() {
- this.customWriterProviders = new KeyComparatorHashMap<MediaType, List<MessageBodyWriter>>(
- MEDIA_TYPE_COMPARATOR);
- this.customWriterListProviders = new ArrayList<MessageBodyWriterPair>();
-
- this.writerProviders = new KeyComparatorHashMap<MediaType, List<MessageBodyWriter>>(
- MEDIA_TYPE_COMPARATOR);
- this.writerListProviders = new ArrayList<MessageBodyWriterPair>();
-
- if(deprecatedProviderPrecedence) {
- initWriters(writerProviders,writerListProviders, providerServices.getProvidersAndServices(MessageBodyWriter.class));
- } else {
- initWriters(customWriterProviders, customWriterListProviders, providerServices.getProviders(MessageBodyWriter.class));
- initWriters(writerProviders, writerListProviders, providerServices.getServices(MessageBodyWriter.class));
- }
- }
-
- private void initWriters(Map<MediaType, List<MessageBodyWriter>> providersMap, List<MessageBodyWriterPair> listProviders, Set<MessageBodyWriter> providersSet) {
- for (MessageBodyWriter provider : providersSet) {
- List<MediaType> values = MediaTypes.createMediaTypes(
- provider.getClass().getAnnotation(Produces.class));
- for (MediaType type : values)
- getClassCapability(providersMap, provider, type);
-
- listProviders.add(new MessageBodyWriterPair(provider, values));
- }
-
- final DistanceComparator<MessageBodyWriter> dc = new DistanceComparator<MessageBodyWriter>(MessageBodyWriter.class);
- for (Map.Entry<MediaType, List<MessageBodyWriter>> e : providersMap.entrySet()) {
- Collections.sort(e.getValue(), dc);
- }
-
- Collections.sort(listProviders, new Comparator<MessageBodyWriterPair>() {
- public int compare(MessageBodyWriterPair p1, MessageBodyWriterPair p2) {
- return dc.compare(p1.mbw, p2.mbw);
- }
- });
- }
-
- private <T> void getClassCapability(Map<MediaType, List<T>> capabilities,
- T provider, MediaType mediaType) {
- if (!capabilities.containsKey(mediaType))
- capabilities.put(mediaType, new ArrayList<T>());
-
- List<T> providers = capabilities.get(mediaType);
- providers.add(provider);
- }
-
- // MessageBodyWorkers
-
- public Map<MediaType, List<MessageBodyReader>> getReaders(MediaType mediaType) {
- Map<MediaType, List<MessageBodyReader>> subSet =
- new KeyComparatorLinkedHashMap<MediaType, List<MessageBodyReader>>(
- MEDIA_TYPE_COMPARATOR);
-
- if(!customReaderProviders.isEmpty())
- getCompatibleReadersWritersMap(mediaType, customReaderProviders, subSet);
- getCompatibleReadersWritersMap(mediaType, readerProviders, subSet);
- return subSet;
- }
-
- public Map<MediaType, List<MessageBodyWriter>> getWriters(MediaType mediaType) {
- Map<MediaType, List<MessageBodyWriter>> subSet =
- new KeyComparatorLinkedHashMap<MediaType, List<MessageBodyWriter>>(
- MEDIA_TYPE_COMPARATOR);
-
- if(!customWriterProviders.isEmpty())
- getCompatibleReadersWritersMap(mediaType, customWriterProviders, subSet);
- getCompatibleReadersWritersMap(mediaType, writerProviders, subSet);
- return subSet;
- }
-
- public String readersToString(Map<MediaType, List<MessageBodyReader>> readers) {
- return toString(readers);
- }
-
- public String writersToString(Map<MediaType, List<MessageBodyWriter>> writers) {
- return toString(writers);
- }
-
- private <T> String toString(Map<MediaType, List<T>> set) {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- for (Map.Entry<MediaType, List<T>> e : set.entrySet()) {
- pw.append(e.getKey().toString()).println(" ->");
- for (T t : e.getValue()) {
- pw.append(" ").println(t.getClass().getName());
- }
- }
- pw.flush();
- return sw.toString();
- }
-
- public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> c, Type t,
- Annotation[] as,
- MediaType mediaType) {
-
- MessageBodyReader reader;
-
- if(!customReaderProviders.isEmpty()) {
- reader = _getMessageBodyReader(c, t, as, mediaType, customReaderProviders);
- if(reader != null)
- return reader;
- }
- reader = _getMessageBodyReader(c, t, as, mediaType, readerProviders);
-
- return reader;
- }
-
- private <T> MessageBodyReader<T> _getMessageBodyReader(Class<T> c, Type t,
- Annotation[] as,
- MediaType mediaType,
- Map<MediaType, List<MessageBodyReader>> providers) {
- MessageBodyReader p = null;
- if (mediaType != null) {
- p = _getMessageBodyReader(c, t, as, mediaType, mediaType, providers);
- if (p == null)
- p = _getMessageBodyReader(c, t, as, mediaType,
- MediaTypes.getTypeWildCart(mediaType), providers);
- }
- if (p == null)
- p = _getMessageBodyReader(c, t, as, mediaType, MediaTypes.GENERAL_MEDIA_TYPE, providers);
-
- return p;
- }
-
- private <T> MessageBodyReader<T> _getMessageBodyReader(Class<T> c, Type t,
- Annotation[] as,
- MediaType mediaType, MediaType lookup) {
-
- MessageBodyReader reader;
-
- if(!customReaderProviders.isEmpty()) {
- reader = _getMessageBodyReader(c, t, as, mediaType, lookup, customReaderProviders);
- if(reader != null)
- return reader;
- }
- reader = _getMessageBodyReader(c, t, as, mediaType, lookup, readerProviders);
-
- return reader;
- }
-
- private <T> MessageBodyReader<T> _getMessageBodyReader(Class<T> c, Type t,
- Annotation[] as,
- MediaType mediaType, MediaType lookup,
- Map<MediaType, List<MessageBodyReader>> providers) {
-
- List<MessageBodyReader> readers = providers.get(lookup);
- if (readers == null)
- return null;
- for (MessageBodyReader p : readers) {
- if (p.isReadable(c, t, as, mediaType)) {
- return p;
- }
- }
- return null;
- }
-
- public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> c, Type t,
- Annotation[] as,
- MediaType mediaType) {
-
- MessageBodyWriter p;
-
- if(!customWriterProviders.isEmpty()) {
- p = _getMessageBodyWriter(c, t, as, mediaType, customWriterProviders);
- if(p != null)
- return p;
- }
- p = _getMessageBodyWriter(c, t, as, mediaType, writerProviders);
-
- return p;
- }
-
- private <T> MessageBodyWriter<T> _getMessageBodyWriter(Class<T> c, Type t,
- Annotation[] as,
- MediaType mediaType,
- Map<MediaType, List<MessageBodyWriter>> providers) {
-
- MessageBodyWriter p = null;
-
- if (mediaType != null) {
- p = _getMessageBodyWriter(c, t, as, mediaType, mediaType, providers);
- if (p == null)
- p = _getMessageBodyWriter(c, t, as, mediaType,
- MediaTypes.getTypeWildCart(mediaType), providers);
- }
- if (p == null)
- p = _getMessageBodyWriter(c, t, as, mediaType, MediaTypes.GENERAL_MEDIA_TYPE, providers);
-
- return p;
- }
-
- private <T> MessageBodyWriter<T> _getMessageBodyWriter(Class<T> c, Type t,
- Annotation[] as,
- MediaType mediaType, MediaType lookup,
- Map<MediaType, List<MessageBodyWriter>> providers) {
- List<MessageBodyWriter> writers = providers.get(lookup);
- if (writers == null)
- return null;
- for (MessageBodyWriter p : writers) {
- if (p.isWriteable(c, t, as, mediaType)) {
- return p;
- }
- }
-
- return null;
- }
-
- private <T> void getCompatibleReadersWritersMap(MediaType mediaType,
- Map<MediaType, List<T>> set,
- Map<MediaType, List<T>> subSet) {
- if (mediaType.isWildcardType()) {
- getCompatibleReadersWritersList(mediaType, set, subSet);
- } else if (mediaType.isWildcardSubtype()) {
- getCompatibleReadersWritersList(mediaType, set, subSet);
- getCompatibleReadersWritersList(MediaTypes.GENERAL_MEDIA_TYPE, set, subSet);
- } else {
- getCompatibleReadersWritersList(mediaType, set, subSet);
- getCompatibleReadersWritersList(
- MediaTypes.getTypeWildCart(mediaType),
- set, subSet);
- getCompatibleReadersWritersList(MediaTypes.GENERAL_MEDIA_TYPE, set, subSet);
- }
-
- }
-
- private <T> void getCompatibleReadersWritersList(MediaType mediaType,
- Map<MediaType, List<T>> set,
- Map<MediaType, List<T>> subSet) {
- List<T> readers = set.get(mediaType);
- if (readers != null) {
- subSet.put(mediaType, Collections.unmodifiableList(readers));
- }
- }
-
- public <T> List<MediaType> getMessageBodyWriterMediaTypes(Class<T> c, Type t,
- Annotation[] as) {
- List<MediaType> mtl = new ArrayList<MediaType>();
- for (MessageBodyWriterPair mbwp : customWriterListProviders) {
- if (mbwp.mbw.isWriteable(c, t, as, MediaType.APPLICATION_OCTET_STREAM_TYPE)) {
- mtl.addAll(mbwp.types);
- }
- }
- for (MessageBodyWriterPair mbwp : writerListProviders) {
- if (mbwp.mbw.isWriteable(c, t, as, MediaType.APPLICATION_OCTET_STREAM_TYPE)) {
- mtl.addAll(mbwp.types);
- }
- }
-
- Collections.sort(mtl, MediaTypes.MEDIA_TYPE_COMPARATOR);
- return mtl;
- }
-
- public <T> MediaType getMessageBodyWriterMediaType(Class<T> c, Type t,
- Annotation[] as, List<MediaType> acceptableMediaTypes) {
- for (MediaType acceptable : acceptableMediaTypes) {
- for (MessageBodyWriterPair mbwp : customWriterListProviders) {
- for (MediaType mt : mbwp.types) {
- if (mt.isCompatible(acceptable) &&
- mbwp.mbw.isWriteable(c, t, as, acceptable)) {
- return MediaTypes.mostSpecific(mt, acceptable);
- }
- }
- }
- for (MessageBodyWriterPair mbwp : writerListProviders) {
- for (MediaType mt : mbwp.types) {
- if (mt.isCompatible(acceptable) &&
- mbwp.mbw.isWriteable(c, t, as, acceptable)) {
- return MediaTypes.mostSpecific(mt, acceptable);
- }
- }
- }
-
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.java
deleted file mode 100644
index 12f3d9bdad4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.factory;
-
-import com.sun.jersey.core.util.KeyComparatorHashMap;
-import com.sun.jersey.core.util.StringIgnoreCaseKeyComparator;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * HTTP header constants for use with {@link ResponseBuilderImpl} and
- * {@link ResponseImpl}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResponseBuilderHeaders {
- public static final int CACHE_CONTROL = 0;
-
- public static final int CONTENT_LANGUAGE = 1;
-
- public static final int CONTENT_LOCATION = 2;
-
- public static final int CONTENT_TYPE = 3;
-
- public static final int ETAG = 4;
-
- public static final int LAST_MODIFIED = 5;
-
- public static final int LOCATION = 6;
-
-
- private static final Map<String, Integer> HEADER_MAP = createHeaderMap();
-
- private static final String[] HEADER_ARRAY = createHeaderArray();
-
- private static Map<String, Integer> createHeaderMap() {
- Map<String, Integer> m = new KeyComparatorHashMap<String, Integer>(
- StringIgnoreCaseKeyComparator.SINGLETON);
-
- m.put("Cache-Control", CACHE_CONTROL);
- m.put("Content-Language", CONTENT_LANGUAGE);
- m.put("Content-Location", CONTENT_LOCATION);
- m.put("Content-Type", CONTENT_TYPE);
- m.put("ETag", ETAG);
- m.put("Last-Modified", LAST_MODIFIED);
- m.put("Location", LOCATION);
-
- return Collections.unmodifiableMap(m);
- }
-
- private static String[] createHeaderArray() {
- Map<String, Integer> m = createHeaderMap();
-
- String[] a = new String[m.size()];
- for (Map.Entry<String, Integer> e : m.entrySet()) {
- a[e.getValue()] = e.getKey();
- }
-
- return a;
- }
-
-
- public static int getSize() {
- return HEADER_MAP.size();
- }
-
- public static String getNameFromId(int id) {
- return HEADER_ARRAY[id];
- }
-
- public static Integer getIdFromName(String name) {
- return HEADER_MAP.get(name);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.java
deleted file mode 100644
index 8c3cb41fc67..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.factory;
-
-import com.sun.jersey.core.header.OutBoundHeaders;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.NewCookie;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.Response.StatusType;
-import javax.ws.rs.core.Variant;
-
-/**
- * An implementation of {@link ResponseBuilder}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResponseBuilderImpl extends Response.ResponseBuilder {
-
- private StatusType statusType = Status.NO_CONTENT;
-
- private OutBoundHeaders headers;
-
- private Object entity;
-
- private Type entityType;
-
- public ResponseBuilderImpl() { }
-
- private ResponseBuilderImpl(ResponseBuilderImpl that) {
- this.statusType = that.statusType;
- this.entity = that.entity;
- if (that.headers != null) {
- this.headers = new OutBoundHeaders(that.headers);
- } else {
- this.headers = null;
- }
- this.entityType = that.entityType;
- }
-
- public Response.ResponseBuilder entityWithType(Object entity, Type entityType) {
- this.entity = entity;
- this.entityType = entityType;
- return this;
- }
-
- private OutBoundHeaders getHeaders() {
- if (headers == null)
- headers = new OutBoundHeaders();
- return headers;
- }
-
- // Response.Builder
-
- public Response build() {
- final Response r = new ResponseImpl(
- statusType,
- getHeaders(),
- entity,
- entityType);
- reset();
- return r;
- }
-
- private void reset() {
- statusType = Status.NO_CONTENT;
- headers = null;
- entity = null;
- entityType = null;
- }
-
- @Override
- public ResponseBuilder clone() {
- return new ResponseBuilderImpl(this);
- }
-
- public Response.ResponseBuilder status(StatusType status) {
- if (status == null)
- throw new IllegalArgumentException();
- this.statusType = status;
- return this;
- };
-
- public Response.ResponseBuilder status(int status) {
- return status(ResponseImpl.toStatusType(status));
- }
-
- public Response.ResponseBuilder entity(Object entity) {
- this.entity = entity;
- this.entityType = (entity != null) ? entity.getClass() : null;
- return this;
- }
-
- public Response.ResponseBuilder type(MediaType type) {
- headerSingle(HttpHeaders.CONTENT_TYPE, type);
- return this;
- }
-
- public Response.ResponseBuilder type(String type) {
- return type(type == null ? null : MediaType.valueOf(type));
- }
-
- public Response.ResponseBuilder variant(Variant variant) {
- if (variant == null) {
- type((MediaType)null);
- language((String)null);
- encoding(null);
- return this;
- }
-
- type(variant.getMediaType());
- // TODO set charset
- language(variant.getLanguage());
- encoding(variant.getEncoding());
-
- return this;
- }
-
- public Response.ResponseBuilder variants(List<Variant> variants) {
- if (variants == null) {
- header(HttpHeaders.VARY, null);
- return this;
- }
-
- if (variants.isEmpty())
- return this;
-
- MediaType accept = variants.get(0).getMediaType();
- boolean vAccept = false;
-
- Locale acceptLanguage = variants.get(0).getLanguage();
- boolean vAcceptLanguage = false;
-
- String acceptEncoding = variants.get(0).getEncoding();
- boolean vAcceptEncoding = false;
-
- for (Variant v : variants) {
- vAccept |= !vAccept && vary(v.getMediaType(), accept);
- vAcceptLanguage |= !vAcceptLanguage && vary(v.getLanguage(), acceptLanguage);
- vAcceptEncoding |= !vAcceptEncoding && vary(v.getEncoding(), acceptEncoding);
- }
-
- StringBuilder vary = new StringBuilder();
- append(vary, vAccept, HttpHeaders.ACCEPT);
- append(vary, vAcceptLanguage, HttpHeaders.ACCEPT_LANGUAGE);
- append(vary, vAcceptEncoding, HttpHeaders.ACCEPT_ENCODING);
-
- if (vary.length() > 0)
- header(HttpHeaders.VARY, vary.toString());
- return this;
- }
-
- private boolean vary(MediaType v, MediaType vary) {
- return v != null && !v.equals(vary);
- }
-
- private boolean vary(Locale v, Locale vary) {
- return v != null && !v.equals(vary);
- }
-
- private boolean vary(String v, String vary) {
- return v != null && !v.equalsIgnoreCase(vary);
- }
-
- private void append(StringBuilder sb, boolean v, String s) {
- if (v) {
- if (sb.length() > 0)
- sb.append(',');
- sb.append(s);
- }
- }
-
- public Response.ResponseBuilder language(String language) {
- headerSingle(HttpHeaders.CONTENT_LANGUAGE, language);
- return this;
- }
-
- public Response.ResponseBuilder language(Locale language) {
- headerSingle(HttpHeaders.CONTENT_LANGUAGE, language);
- return this;
- }
-
- public Response.ResponseBuilder location(URI location) {
- headerSingle(HttpHeaders.LOCATION, location);
- return this;
- }
-
- public Response.ResponseBuilder contentLocation(URI location) {
- headerSingle(HttpHeaders.CONTENT_LOCATION, location);
- return this;
- }
-
- public Response.ResponseBuilder encoding(String encoding) {
- headerSingle(HttpHeaders.CONTENT_ENCODING, encoding);
- return this;
- }
-
- public Response.ResponseBuilder tag(EntityTag tag) {
- headerSingle(HttpHeaders.ETAG, tag);
- return this;
- }
-
- public Response.ResponseBuilder tag(String tag) {
- return tag(tag == null ? null : new EntityTag(tag));
- }
-
- public Response.ResponseBuilder lastModified(Date lastModified) {
- headerSingle(HttpHeaders.LAST_MODIFIED, lastModified);
- return this;
- }
-
- public Response.ResponseBuilder cacheControl(CacheControl cacheControl) {
- headerSingle(HttpHeaders.CACHE_CONTROL, cacheControl);
- return this;
- }
-
- public Response.ResponseBuilder expires(Date expires) {
- headerSingle(HttpHeaders.EXPIRES, expires);
- return this;
- }
-
- public Response.ResponseBuilder cookie(NewCookie... cookies) {
- if (cookies != null) {
- for (NewCookie cookie : cookies)
- header(HttpHeaders.SET_COOKIE, cookie);
- } else {
- header(HttpHeaders.SET_COOKIE, null);
- }
- return this;
- }
-
- public Response.ResponseBuilder header(String name, Object value) {
- return header(name, value, false);
- }
-
- public Response.ResponseBuilder headerSingle(String name, Object value) {
- return header(name, value, true);
- }
-
- public Response.ResponseBuilder header(String name, Object value, boolean single) {
- if (value != null) {
- if (single) {
- getHeaders().putSingle(name, value);
- } else {
- getHeaders().add(name, value);
- }
- } else {
- getHeaders().remove(name);
- }
- return this;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseImpl.java
deleted file mode 100644
index bcb0a79d1eb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/ResponseImpl.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.factory;
-
-import com.sun.jersey.core.header.OutBoundHeaders;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status.Family;
-import javax.ws.rs.ext.MessageBodyWriter;
-
-/**
- * An implementation of {@link Response}.
- * <p>
- * This implementation supports the declaration of an entity type that will be
- * utilized when a {@link MessageBodyWriter} is selected to write out the
- * entity.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ResponseImpl extends Response {
-
- private final StatusType statusType;
-
- private final MultivaluedMap<String, Object> headers;
-
- private final Object entity;
-
- private final Type entityType;
-
- /**
- * Construct given a status type, entity and metadata.
- *
- * @param statusType the status type
- * @param headers the metadata, it is the callers responsibility to copy
- * the metadata if necessary.
- * @param entity the entity
- * @param entityType the entity type, it is the callers responsibility to
- * ensure the entity type is compatible with the entity.
- */
- protected ResponseImpl(StatusType statusType, OutBoundHeaders headers, Object entity, Type entityType) {
- this.statusType = statusType;
- this.headers = headers;
- this.entity = entity;
- this.entityType = entityType;
- }
-
- /**
- * Construct given a status, entity and metadata.
- *
- * @param status the status
- * @param headers the metadata, it is the callers responsibility to copy
- * the metadata if necessary.
- * @param entity the entity
- * @param entityType the entity type, it is the callers responsibility to
- * ensure the entity type is compatible with the entity.
- */
- protected ResponseImpl(int status, OutBoundHeaders headers, Object entity, Type entityType) {
- this.statusType = toStatusType(status);
- this.headers = headers;
- this.entity = entity;
- this.entityType = entityType;
- }
-
- /**
- * Get the status type.
- *
- * @return the status type.
- */
- public StatusType getStatusType() {
- return statusType;
- }
-
- /**
- * Get the entity type.
- *
- * @return the entity type.
- */
- public Type getEntityType() {
- return entityType;
- }
-
- // Response
-
- public int getStatus() {
- return statusType.getStatusCode();
- }
-
- public MultivaluedMap<String, Object> getMetadata() {
- return headers;
- }
-
- public Object getEntity() {
- return entity;
- }
-
- public static StatusType toStatusType(final int statusCode) {
- switch(statusCode) {
- case 200: return Status.OK;
- case 201: return Status.CREATED;
- case 202: return Status.ACCEPTED;
- case 204: return Status.NO_CONTENT;
-
- case 301: return Status.MOVED_PERMANENTLY;
- case 303: return Status.SEE_OTHER;
- case 304: return Status.NOT_MODIFIED;
- case 307: return Status.TEMPORARY_REDIRECT;
-
- case 400: return Status.BAD_REQUEST;
- case 401: return Status.UNAUTHORIZED;
- case 403: return Status.FORBIDDEN;
- case 404: return Status.NOT_FOUND;
- case 406: return Status.NOT_ACCEPTABLE;
- case 409: return Status.CONFLICT;
- case 410: return Status.GONE;
- case 412: return Status.PRECONDITION_FAILED;
- case 415: return Status.UNSUPPORTED_MEDIA_TYPE;
-
- case 500: return Status.INTERNAL_SERVER_ERROR;
- case 503: return Status.SERVICE_UNAVAILABLE;
-
- default: {
- return new StatusType() {
- @Override
- public int getStatusCode() {
- return statusCode;
- }
-
- @Override
- public Family getFamily() {
- return toFamilyCode(statusCode);
- }
-
- @Override
- public String getReasonPhrase() {
- return "";
- }
- };
- }
- }
- }
-
- public static Family toFamilyCode(final int statusCode) {
- switch(statusCode / 100) {
- case 1: return Family.INFORMATIONAL;
- case 2: return Family.SUCCESSFUL;
- case 3: return Family.REDIRECTION;
- case 4: return Family.CLIENT_ERROR;
- case 5: return Family.SERVER_ERROR;
- default: return Family.OTHER;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.java
deleted file mode 100644
index e42bce3c94b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.factory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Variant;
-import javax.ws.rs.core.Variant.VariantListBuilder;
-
-/**
- * An implementation of {@link VariantListBuilder}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class VariantListBuilderImpl extends Variant.VariantListBuilder {
-
- private List<Variant> variants;
-
- private final List<MediaType> mediaTypes = new ArrayList<MediaType>();
-
- private final List<Locale> languages = new ArrayList<Locale>();
-
- private final List<String> charsets = new ArrayList<String>();
-
- private final List<String> encodings = new ArrayList<String>();
-
- @Override
- public List<Variant> build() {
- if (variants == null)
- variants = new ArrayList<Variant>();
-
- return variants;
- }
-
- @Override
- public VariantListBuilder add() {
- if (variants == null)
- variants = new ArrayList<Variant>();
-
- addMediaTypes();
-
- charsets.clear();
- languages.clear();
- encodings.clear();
- mediaTypes.clear();
-
- return this;
- }
-
- private void addMediaTypes() {
- if (mediaTypes.isEmpty()) addLanguages(null);
- else for (MediaType mediaType : mediaTypes) addLanguages(mediaType);
- }
-
- private void addLanguages(MediaType mediaType) {
- if (languages.isEmpty()) addEncodings(mediaType, null);
- else for (Locale language : languages) addEncodings(mediaType, language);
- }
-
- private void addEncodings(MediaType mediaType, Locale language) {
- if (encodings.isEmpty()) addVariant(mediaType, language, null);
- else for (String encoding : encodings) addVariant(mediaType, language, encoding);
- }
-
- private void addVariant(MediaType mediaType, Locale language, String encoding) {
- variants.add(new Variant(mediaType, language, encoding));
- }
-
- @Override
- public VariantListBuilder languages(Locale... languages) {
- for (Locale language : languages) this.languages.add(language);
- return this;
- }
-
- @Override
- public VariantListBuilder encodings(String... encodings) {
- for (String encoding : encodings) this.encodings.add(encoding);
- return this;
- }
-
- @Override
- public VariantListBuilder mediaTypes(MediaType... mediaTypes) {
- for (MediaType mediaType : mediaTypes) this.mediaTypes.add(mediaType);
- return this;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/package-info.java
deleted file mode 100644
index e6347ab00af..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/factory/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for factories of particular component types.
- */
-package com.sun.jersey.core.spi.factory;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/FilesScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/FilesScanner.java
deleted file mode 100644
index ed973a7b1f5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/FilesScanner.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning;
-
-import com.sun.jersey.core.util.Closing;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A scanner that recursively scans directories and jar files.
- * Files or jar entries are reported to a {@link ScannerListener}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class FilesScanner implements Scanner {
-
- private final File[] files;
-
- /**
- * Scan from a set of files.
- *
- * @param files an array of files that are either directories or jar files
- * ending in the suffix '.jar' or '.zip'. Any other type of file
- * is ignored.
- */
- public FilesScanner(final File[] files) {
- this.files = files;
- }
-
- // Scanner
-
- public void scan(final ScannerListener cfl) {
- for (final File f : files) {
- scan(f, cfl);
- }
- }
-
- private void scan(final File f, final ScannerListener cfl) {
- if (f.isDirectory()) {
- scanDir(f, cfl);
- } else if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip")) {
- try {
- JarFileScanner.scan(f, "", cfl);
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning jar file " + f, ex);
- }
- } else {
- // TODO log
- }
- }
-
- private void scanDir(final File root, final ScannerListener cfl) {
- for (final File child : root.listFiles()) {
- if (child.isDirectory()) {
- scanDir(child, cfl);
- } else if (child.getName().endsWith(".jar")) {
- try {
- JarFileScanner.scan(child, "", cfl);
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning jar file " + child, ex);
- }
- } else if (cfl.onAccept(child.getName())) {
- try {
- new Closing(new BufferedInputStream(new FileInputStream(child))).f(new Closing.Closure() {
-
- public void f(InputStream in) throws IOException {
- cfl.onProcess(child.getName(), in);
- }
- });
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning file " + child, ex);
- }
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/JarFileScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/JarFileScanner.java
deleted file mode 100644
index 1c194c5e374..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/JarFileScanner.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning;
-
-import com.sun.jersey.core.util.Closing;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-/**
- * A utility class that scans entries in jar files.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class JarFileScanner {
-
- /**
- * Scan entries in a jar file.
- * <p>
- * An entry will be reported to the scanning listener if the entry is a
- * child of the parent path.
- *
- * @param f the jar file.
- * @param parent the parent path.
- * @param sl the scanning lister to report jar entries.
- * @throws IOException if an error occurred scanning the jar entries
- */
- public static void scan(final File f, final String parent, final ScannerListener sl) throws IOException {
- new Closing(new FileInputStream(f)).f(new Closing.Closure() {
-
- public void f(final InputStream in) throws IOException {
- scan(in, parent, sl);
- }
- });
- }
-
- /**
- * Scan entries in a jar file.
- * <p>
- * An entry will be reported to the scanning listener if the entry is a
- * child of the parent path.
- *
- * @param in the jar file as an input stream.
- * @param parent the parent path.
- * @param sl the scanning lister to report jar entries.
- * @throws IOException if an error occurred scanning the jar entries
- */
- public static void scan(final InputStream in, final String parent, final ScannerListener sl) throws IOException {
- JarInputStream jarIn = null;
- try {
- jarIn = new JarInputStream(in);
- JarEntry e = jarIn.getNextJarEntry();
- while (e != null) {
- if (!e.isDirectory() && e.getName().startsWith(parent) && sl.onAccept(e.getName())) {
- sl.onProcess(e.getName(), jarIn);
- }
- jarIn.closeEntry();
- e = jarIn.getNextJarEntry();
- }
- } finally {
- if (jarIn != null) {
- jarIn.close();
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/PackageNamesScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/PackageNamesScanner.java
deleted file mode 100644
index 4664497016c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/PackageNamesScanner.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning;
-
-import com.sun.jersey.api.uri.UriComponent;
-import com.sun.jersey.api.uri.UriComponent.Type;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner;
-import com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner;
-import com.sun.jersey.core.spi.scanning.uri.UriSchemeScanner;
-import com.sun.jersey.core.spi.scanning.uri.VfsSchemeScanner;
-import com.sun.jersey.spi.service.ServiceFinder;
-import java.io.IOException;
-import java.lang.reflect.ReflectPermission;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A scanner that recursively scans URI-based resources present in a set of
- * package names, and sub-package names of that set.
- * <p>
- * The URIs for a package name are obtained, by default, by invoking
- * {@link ClassLoader#getResources(java.lang.String) } with the parameter that
- * is the package name with "." replaced by "/". The obtaining of the resources
- * with a given name may be overridden by registering an implementation of
- * {@link ResourcesProvider} using the method
- * {@link #setResourcesProvider(com.sun.jersey.core.spi.scanning.PackageNamesScanner.ResourcesProvider) }.
- * <p>
- * Each URI is then scanned using a registered {@link UriSchemeScanner} that
- * supports the URI scheme.
- * <p>
- * The following are registered by default.
- * The {@link FileSchemeScanner} for "file" URI schemes.
- * The {@link JarZipSchemeScanner} for "jar" or "zip" URI schemes to jar
- * resources.
- * The {@link VfsSchemeScanner} for the JBoss-based "vfsfile" and "vfszip"
- * URI schemes.
- * <p>
- * Further schemes may be registered by registering an implementation of
- * {@link UriSchemeScanner} in the META-INF/services file whose name is the
- * the fully qualified class name of {@link UriSchemeScanner}.
- * <p>
- * If a URI scheme is not supported a {@link ScannerException} will be thrown
- * and package scanning deployment will fail.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author Jakub.Podlesak@Sun.Com
- */
-public class PackageNamesScanner implements Scanner {
-
- private final String[] packages;
- private final ClassLoader classloader;
- private final Map<String, UriSchemeScanner> scanners;
-
- /**
- * Scan from a set of packages using the context class loader.
- *
- * @param packages an array of package names.
- */
- public PackageNamesScanner(final String[] packages) {
- this(ReflectionHelper.getContextClassLoader(), packages);
- }
-
- /**
- * Scan from a set of packages using declared class loader.
- *
- * @param classloader the class loader to load classes from.
- * @param packages an array of package names.
- */
- public PackageNamesScanner(final ClassLoader classloader, final String[] packages) {
- this.packages = packages;
- this.classloader = classloader;
-
- this.scanners = new HashMap<String, UriSchemeScanner>();
- add(new JarZipSchemeScanner());
- add(new FileSchemeScanner());
- add(new VfsSchemeScanner());
-
- for (UriSchemeScanner s : ServiceFinder.find(UriSchemeScanner.class)) {
- add(s);
- }
- }
-
- private void add(final UriSchemeScanner ss) {
- for (final String s : ss.getSchemes()) {
- scanners.put(s.toLowerCase(), ss);
- }
- }
-
- @Override
- public void scan(final ScannerListener cfl) {
- for (final String p : packages) {
- try {
- final Enumeration<URL> urls = ResourcesProvider.getInstance().
- getResources(p.replace('.', '/'), classloader);
- while (urls.hasMoreElements()) {
- try {
- scan(toURI(urls.nextElement()), cfl);
- } catch (URISyntaxException ex) {
- throw new ScannerException("Error when converting a URL to a URI", ex);
- }
- }
- } catch (IOException ex) {
- throw new ScannerException("IO error when package scanning jar", ex);
- }
- }
- }
-
- /**
- * Find resources with a given name and class loader.
- */
- public static abstract class ResourcesProvider {
-
- private static volatile ResourcesProvider provider;
-
- private static ResourcesProvider getInstance() {
- // Double-check idiom for lazy initialization
- ResourcesProvider result = provider;
-
- if (result == null) { // first check without locking
- synchronized (ResourcesProvider.class) {
- result = provider;
- if (result == null) { // second check with locking
- provider = result = new ResourcesProvider() {
-
- @Override
- public Enumeration<URL> getResources(String name, ClassLoader cl)
- throws IOException {
- return cl.getResources(name);
- }
- };
-
- }
- }
-
- }
- return result;
- }
-
- private static void setInstance(ResourcesProvider provider) throws SecurityException {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- ReflectPermission rp = new ReflectPermission("suppressAccessChecks");
- security.checkPermission(rp);
- }
- synchronized (ResourcesProvider.class) {
- ResourcesProvider.provider = provider;
- }
- }
-
- /**
- * Find all resources with the given name using a class loader.
- *
- * @param cl the class loader use to find the resources
- * @param name the resource name
- * @return An enumeration of URL objects for the resource.
- * If no resources could be found, the enumeration will be empty.
- * Resources that the class loader doesn't have access to will
- * not be in the enumeration.
- * @throws IOException if I/O errors occur
- */
- public abstract Enumeration<URL> getResources(String name, ClassLoader cl) throws IOException;
- }
-
- /**
- * Set the {@link ResourcesProvider} implementation to find resources.
- * <p>
- * This method should be invoked before any package scanning is performed
- * otherwise the functionality method will be utilized.
- *
- * @param provider the resources provider.
- * @throws SecurityException if the resources provider cannot be set.
- */
- public static void setResourcesProvider(ResourcesProvider provider) throws SecurityException {
- ResourcesProvider.setInstance(provider);
- }
-
-
- private void scan(final URI u, final ScannerListener cfl) {
- final UriSchemeScanner ss = scanners.get(u.getScheme().toLowerCase());
- if (ss != null) {
- ss.scan(u, cfl);
- } else {
- throw new ScannerException("The URI scheme " + u.getScheme() +
- " of the URI " + u +
- " is not supported. Package scanning deployment is not" +
- " supported for such URIs." +
- "\nTry using a different deployment mechanism such as" +
- " explicitly declaring root resource and provider classes" +
- " using an extension of javax.ws.rs.core.Application");
- }
- }
-
- private URI toURI(URL url) throws URISyntaxException {
- try {
- return url.toURI();
- } catch (URISyntaxException e) {
- // Work around bug where some URLs are incorrectly encoded.
- // This can occur when certain class loaders are utilized
- // to obtain URLs for resources.
- return URI.create(toExternalForm(url));
- }
- }
-
- private String toExternalForm(URL u) {
-
- // pre-compute length of StringBuffer
- int len = u.getProtocol().length() + 1;
- if (u.getAuthority() != null && u.getAuthority().length() > 0) {
- len += 2 + u.getAuthority().length();
- }
- if (u.getPath() != null) {
- len += u.getPath().length();
- }
- if (u.getQuery() != null) {
- len += 1 + u.getQuery().length();
- }
- if (u.getRef() != null) {
- len += 1 + u.getRef().length();
- }
-
- StringBuffer result = new StringBuffer(len);
- result.append(u.getProtocol());
- result.append(":");
- if (u.getAuthority() != null && u.getAuthority().length() > 0) {
- result.append("//");
- result.append(u.getAuthority());
- }
- if (u.getPath() != null) {
- result.append(UriComponent.contextualEncode(u.getPath(), Type.PATH));
- }
- if (u.getQuery() != null) {
- result.append('?');
- result.append(UriComponent.contextualEncode(u.getQuery(), Type.QUERY));
- }
- if (u.getRef() != null) {
- result.append("#");
- result.append(u.getRef());
- }
- return result.toString();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/Scanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/Scanner.java
deleted file mode 100644
index 820552039bc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/Scanner.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning;
-
-/**
- * An interface for scanning resources and reporting those resources
- * to a scanning listener.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface Scanner {
-
- /**
- * Perform a scan and report resources to a scanning listener.
- *
- * @param sl the scanning listener to report entries.
- * @throws ScannerException if an error occured while scanning.
- */
- public void scan(ScannerListener sl) throws ScannerException;
-}
-
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerException.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerException.java
deleted file mode 100644
index 24f3f622dd2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerException.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.scanning;
-
-/**
- * An runtime exception that may be thrown when scanning.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ScannerException extends RuntimeException {
-
- /**
- * Construct a new instance with the supplied message
- */
- public ScannerException() {
- super();
- }
-
- /**
- * Construct a new instance with the supplied message
- * @param message the message
- */
- public ScannerException(String message) {
- super(message);
- }
-
- /**
- * Construct a new instance with the supplied message and cause
- * @param message the message
- * @param cause the Throwable that caused the exception to be thrown
- */
- public ScannerException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Construct a new instance with the supplied cause
- * @param cause the Throwable that caused the exception to be thrown
- */
- public ScannerException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerListener.java
deleted file mode 100644
index 04cdfc640cc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/ScannerListener.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A listener for recieving events on resources from a {@link Scanner}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ScannerListener {
-
- /**
- * Accept a scanned resource.
- * <p>
- * This method will be invoked by a {@link Scanner} to ascertain if the
- * listener accepts the resource for processing. If acceptable then
- * the {@link Scanner} will then invoke the
- * {@link #onProcess(java.lang.String, java.io.InputStream) } method.
- *
- * @param name the resource name.
- * @return true if the resource is accepted for processing, otherwise false.
- */
- boolean onAccept(String name);
-
- /**
- * Process a scanned resource.
- * <p>
- * This method will be invoked after the listener has accepted the
- * resource.
- *
- * @param name the resource name.
- * @param in the input stream of the resource
- * @throws IOException if an error occurs when processing the resource.
- */
- void onProcess(String name, InputStream in) throws IOException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/package-info.java
deleted file mode 100644
index 870902bea54..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for class scanning.
- */
-package com.sun.jersey.core.spi.scanning;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.java
deleted file mode 100644
index fab69473ee3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.spi.scanning.uri;
-
-import com.sun.jersey.core.spi.scanning.ScannerException;
-import com.sun.jersey.core.spi.scanning.ScannerListener;
-import com.sun.jersey.core.util.Closing;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class BundleSchemeScanner implements UriSchemeScanner{
-
- @Override
- public Set<String> getSchemes() {
- return new HashSet<String>(Arrays.asList("bundle"));
- }
-
- @Override
- public void scan(final URI u, final ScannerListener sl) throws ScannerException {
- if (sl.onAccept(u.getPath())) {
- try {
- new Closing(new BufferedInputStream(u.toURL().openStream())).f(new Closing.Closure() {
-
- @Override
- public void f(final InputStream in) throws IOException {
- sl.onProcess(u.getPath(), in);
- }
- });
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning bundle class " + u, ex);
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.java
deleted file mode 100644
index d53cb648297..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning.uri;
-
-import com.sun.jersey.core.spi.scanning.ScannerException;
-import com.sun.jersey.core.util.Closing;
-import com.sun.jersey.core.spi.scanning.ScannerListener;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * A "file" scheme URI scanner that recursively scans directories.
- * Files are reported to a {@link ScannerListener}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class FileSchemeScanner implements UriSchemeScanner {
-
- public Set<String> getSchemes() {
- return Collections.singleton("file");
- }
-
- // UriSchemeScanner
-
- public void scan(final URI u, final ScannerListener cfl) {
- final File f = new File(u.getPath());
- if (f.isDirectory()) {
- scanDirectory(f, cfl);
- } else {
- // TODO log
- }
- }
-
- private void scanDirectory(final File root, final ScannerListener cfl) {
- for (final File child : root.listFiles()) {
- if (child.isDirectory()) {
- scanDirectory(child, cfl);
- } else if (cfl.onAccept(child.getName())) {
- try {
- new Closing(new BufferedInputStream(new FileInputStream(child))).f(new Closing.Closure() {
-
- public void f(final InputStream in) throws IOException {
- cfl.onProcess(child.getName(), in);
- }
- });
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning jar file " + child, ex);
- }
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.java
deleted file mode 100644
index 13f46cabf74..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning.uri;
-
-import com.sun.jersey.api.uri.UriComponent;
-import com.sun.jersey.core.util.Closing;
-import com.sun.jersey.core.spi.scanning.JarFileScanner;
-import com.sun.jersey.core.spi.scanning.ScannerException;
-import com.sun.jersey.core.spi.scanning.ScannerListener;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * A "jar" and "zip" scheme URI scanner that recursively jar files.
- * Jar entries are reported to a {@link ScannerListener}.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author gerard.davison@oracle.com
- */
-public class JarZipSchemeScanner implements UriSchemeScanner {
-
- public Set<String> getSchemes() {
- return new HashSet<String>(Arrays.asList("jar", "zip"));
- }
-
- public void scan(final URI u, final ScannerListener cfl) {
- final String ssp = u.getRawSchemeSpecificPart();
- final String jarUrlString = ssp.substring(0, ssp.lastIndexOf('!'));
- final String parent = ssp.substring(ssp.lastIndexOf('!') + 2);
- try {
- closing(jarUrlString).f(new Closing.Closure() {
-
- public void f(final InputStream in) throws IOException {
- JarFileScanner.scan(in, parent, cfl);
- }
- });
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning jar " + u, ex);
- }
- }
-
- /**
- * Obtain a {@link Closing} of the jar file.
- * <p>
- * For most platforms the format for the zip or jar follows the form of
- * the <a href="http://docs.sun.com/source/819-0913/author/jar.html#jarprotocol"jar protcol.</a></p>
- * <ul>
- * <li><code>jar:file:///tmp/fishfingers.zip!/example.txt</code></li>
- * <li><code>zip:http://www.example.com/fishfingers.zip!/example.txt</code></li>
- * </ul>
- * <p>
- * On versions of the WebLogic application server a proprietary format is
- * supported of the following form, which assumes a zip file located on
- * the local file system:
- * </p>
- * <ul>
- * <li><code>zip:/tmp/fishfingers.zip!/example.txt</code></li>
- * <li><code>zip:d:/tempfishfingers.zip!/example.txt</code></li>
- * </ul>
- * <p>
- * This method will first attempt to create a {@link Closing} as follows:
- * <pre>
- * new Closing(new URL(jarUrlString).openStream());
- * </pre>
- * if that fails with a {@link MalformedURLException} then the method will
- * attempt to create a {@link Closing} instance as follows:
- * <pre>
- * return new Closing(new FileInputStream(
- * UriComponent.decode(jarUrlString, UriComponent.Type.PATH)));
- * </pre>
- *
- * @param jarUrlString the raw scheme specific part of a URI minus the jar
- * entry
- * @return a {@link Closing}.
- * @throws IOException if there is an error opening the stream.
- */
- protected Closing closing(String jarUrlString) throws IOException {
- try {
- return new Closing(new URL(jarUrlString).openStream());
- } catch (MalformedURLException ex) {
- return new Closing(new FileInputStream(
- UriComponent.decode(jarUrlString, UriComponent.Type.PATH)));
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.java
deleted file mode 100644
index 2fe8b39f289..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning.uri;
-
-import com.sun.jersey.core.spi.scanning.ScannerException;
-import com.sun.jersey.core.spi.scanning.ScannerListener;
-import java.net.URI;
-import java.util.Set;
-
-/**
- * An interface for scanning URI-based resources and reporting those resources
- * to a scanning listener.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface UriSchemeScanner {
-
- /**
- * Get the set of supported URI schemes.
- *
- * @return the supported URI schemes.
- */
- Set<String> getSchemes();
-
- /**
- * Perform a scan and report resources to a scanning listener.
- *
- * @param u the URI to scan for resources.
- * @param sl the scanning listener to report entries.
- * @throws ScannerException if an error occured while scanning.
- */
- void scan(URI u, ScannerListener sl) throws ScannerException;
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.java
deleted file mode 100644
index efabab53167..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.spi.scanning.uri;
-
-import com.sun.jersey.core.spi.scanning.JarFileScanner;
-import com.sun.jersey.core.spi.scanning.ScannerException;
-import com.sun.jersey.core.spi.scanning.ScannerListener;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-import javax.ws.rs.core.UriBuilder;
-
-/**
- * A JBoss-based "vfsfile" and "vfszip" scheme URI scanner.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class VfsSchemeScanner implements UriSchemeScanner {
-
- public Set<String> getSchemes() {
- return new HashSet<String>(Arrays.asList("vfsfile", "vfszip"));
- }
-
- // UriSchemeScanner
-
- public void scan(final URI u, final ScannerListener sl) {
- if (u.getScheme().equalsIgnoreCase("vfsfile")) {
- new FileSchemeScanner().scan(
- UriBuilder.fromUri(u).scheme("file").build(),
- sl);
- } else {
- final String su = u.toString();
- final int webInfIndex = su.indexOf("/WEB-INF/classes");
- if (webInfIndex != -1) {
- final String war = su.substring(0, webInfIndex);
- final String path = su.substring(webInfIndex + 1);
-
- final int warParentIndex = war.lastIndexOf('/');
- final String warParent = su.substring(0, warParentIndex);
-
- // Check is there is a war within an ear
- // If so we need to load the ear then obtain the InputStream
- // of the entry to the war
- if (warParent.endsWith(".ear")) {
- final String warName = su.substring(warParentIndex + 1, war.length());
- try {
- JarFileScanner.scan(new URL(warParent.replace("vfszip", "file")).openStream(), "",
- new ScannerListener() {
- public boolean onAccept(String name) {
- return name.equals(warName);
- }
-
- public void onProcess(String name, InputStream in) throws IOException {
- // This is required so that the underlying ear
- // is not closed
- in = new FilterInputStream(in) {
- public void close() throws IOException {};
- };
- try {
- JarFileScanner.scan(in, path, sl);
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning war " + u, ex);
- }
- }
- });
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning war " + u, ex);
- }
- } else {
- try {
- JarFileScanner.scan(new URL(war.replace("vfszip", "file")).openStream(), path, sl);
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning war " + u, ex);
- }
- }
- } else {
- try {
- JarFileScanner.scan(new URL(su).openStream(), "", sl);
- } catch (IOException ex) {
- throw new ScannerException("IO error when scanning jar " + u, ex);
- }
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/package-info.java
deleted file mode 100644
index e3e5b159a1f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/spi/scanning/uri/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for package-based class scanning using URIs.
- */
-package com.sun.jersey.core.spi.scanning.uri;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/Base64.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/Base64.java
deleted file mode 100644
index 38b75872d87..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/Base64.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- *
- *
- * This file incorporates work covered by the following copyright and
- * permission notice:
- *
- * Copyright 2010 The Apache Software Foundation
- *
- * Licensed 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 com.sun.jersey.core.util;
-
-/**
- * This class provides encode/decode for RFC 2045 Base64 as defined by
- * RFC 2045, N. Freed and N. Borenstein. <a
- * href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>:
- * Multipurpose Internet Mail Extensions (MIME) Part One: Format of
- * Internet Message Bodies. Reference 1996
- *
- * @author Jeffrey Rodriguez
- */
-public final class Base64
-{
- static private final int BASELENGTH = 255;
- static private final int LOOKUPLENGTH = 64;
- static private final int TWENTYFOURBITGROUP = 24;
- static private final int EIGHTBIT = 8;
- static private final int SIXTEENBIT = 16;
- static private final int SIXBIT = 6;
- static private final int FOURBYTE = 4;
- static private final int SIGN = -128;
- static private final byte PAD = (byte) '=';
- static private byte [] base64Alphabet = new byte[BASELENGTH];
- static private byte [] lookUpBase64Alphabet = new byte[LOOKUPLENGTH];
-
- static
- {
- for (int i = 0; i < BASELENGTH; i++ )
- {
- base64Alphabet[i] = -1;
- }
- for (int i = 'Z'; i >= 'A'; i--)
- {
- base64Alphabet[i] = (byte) (i - 'A');
- }
- for (int i = 'z'; i>= 'a'; i--)
- {
- base64Alphabet[i] = (byte) (i - 'a' + 26);
- }
- for (int i = '9'; i >= '0'; i--)
- {
- base64Alphabet[i] = (byte) (i - '0' + 52);
- }
-
- base64Alphabet['+'] = 62;
- base64Alphabet['/'] = 63;
-
- for (int i = 0; i <= 25; i++ )
- lookUpBase64Alphabet[i] = (byte) ('A' + i);
-
- for (int i = 26, j = 0; i <= 51; i++, j++ )
- lookUpBase64Alphabet[i] = (byte) ('a'+ j);
-
- for (int i = 52, j = 0; i <= 61; i++, j++ )
- lookUpBase64Alphabet[i] = (byte) ('0' + j);
-
- lookUpBase64Alphabet[62] = (byte) '+';
- lookUpBase64Alphabet[63] = (byte) '/';
- }
-
- public static boolean isBase64( String isValidString )
- {
- return isArrayByteBase64(isValidString.getBytes());
- }
-
- public static boolean isBase64( byte octect )
- {
- //shall we ignore white space? JEFF??
- return (octect == PAD || base64Alphabet[octect] != -1);
- }
-
- public static boolean isArrayByteBase64( byte[] arrayOctect )
- {
- int length = arrayOctect.length;
- if (length == 0)
- {
- // shouldn't a 0 length array be valid base64 data?
- // return false;
- return true;
- }
- for (int i=0; i < length; i++)
- {
- if ( !Base64.isBase64(arrayOctect[i]) )
- return false;
- }
- return true;
- }
-
- /**
- * Encodes hex octects into Base64.
- *
- * @param binaryData Array containing binary data to encode.
- * @return Base64-encoded data.
- */
- public static byte[] encode( byte[] binaryData )
- {
- int lengthDataBits = binaryData.length*EIGHTBIT;
- int fewerThan24bits = lengthDataBits%TWENTYFOURBITGROUP;
- int numberTriplets = lengthDataBits/TWENTYFOURBITGROUP;
- byte encodedData[] = null;
-
-
- if (fewerThan24bits != 0)
- {
- //data not divisible by 24 bit
- encodedData = new byte[ (numberTriplets + 1 ) * 4 ];
- }
- else
- {
- // 16 or 8 bit
- encodedData = new byte[ numberTriplets * 4 ];
- }
-
- byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
-
- int encodedIndex = 0;
- int dataIndex = 0;
- int i = 0;
- for ( i = 0; i<numberTriplets; i++ )
- {
- dataIndex = i*3;
- b1 = binaryData[dataIndex];
- b2 = binaryData[dataIndex + 1];
- b3 = binaryData[dataIndex + 2];
-
- l = (byte)(b2 & 0x0f);
- k = (byte)(b1 & 0x03);
-
- encodedIndex = i * 4;
- byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
- byte val2 = ((b2 & SIGN)==0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);
- byte val3 = ((b3 & SIGN)==0)?(byte)(b3>>6):(byte)((b3)>>6^0xfc);
-
- encodedData[encodedIndex] = lookUpBase64Alphabet[ val1 ];
- encodedData[encodedIndex+1] =
- lookUpBase64Alphabet[ val2 | ( k<<4 )];
- encodedData[encodedIndex+2] =
- lookUpBase64Alphabet[ (l <<2 ) | val3 ];
- encodedData[encodedIndex+3] = lookUpBase64Alphabet[ b3 & 0x3f ];
- }
-
- // form integral number of 6-bit groups
- dataIndex = i*3;
- encodedIndex = i*4;
- if (fewerThan24bits == EIGHTBIT )
- {
- b1 = binaryData[dataIndex];
- k = (byte) ( b1 &0x03 );
- byte val1 = ((b1 & SIGN)==0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
- encodedData[encodedIndex] = lookUpBase64Alphabet[ val1 ];
- encodedData[encodedIndex + 1] = lookUpBase64Alphabet[ k<<4 ];
- encodedData[encodedIndex + 2] = PAD;
- encodedData[encodedIndex + 3] = PAD;
- }
- else if (fewerThan24bits == SIXTEENBIT)
- {
-
- b1 = binaryData[dataIndex];
- b2 = binaryData[dataIndex +1 ];
- l = (byte) (b2 & 0x0f);
- k = (byte) (b1 & 0x03);
-
- byte val1 = ((b1 & SIGN) == 0)?(byte)(b1>>2):(byte)((b1)>>2^0xc0);
- byte val2 = ((b2 & SIGN) == 0)?(byte)(b2>>4):(byte)((b2)>>4^0xf0);
-
- encodedData[encodedIndex] = lookUpBase64Alphabet[ val1 ];
- encodedData[encodedIndex + 1] =
- lookUpBase64Alphabet[ val2 | ( k<<4 )];
- encodedData[encodedIndex + 2] = lookUpBase64Alphabet[ l<<2 ];
- encodedData[encodedIndex + 3] = PAD;
- }
-
- return encodedData;
- }
-
- /**
- * Decodes Base64 data into octects
- *
- * @param binaryData Byte array containing Base64 data
- * @return Array containing decoded data.
- */
- public static byte[] decode( byte[] base64Data )
- {
- // handle the edge case, so we don't have to worry about it later
- if(base64Data.length == 0) { return new byte[0]; }
-
- int numberQuadruple = base64Data.length/FOURBYTE;
- byte decodedData[] = null;
- byte b1=0,b2=0,b3=0, b4=0, marker0=0, marker1=0;
-
- // Throw away anything not in base64Data
-
- int encodedIndex = 0;
- int dataIndex = 0;
- {
- // this sizes the output array properly - rlw
- int lastData = base64Data.length;
- // ignore the '=' padding
- while (base64Data[lastData-1] == PAD)
- {
- if (--lastData == 0)
- {
- return new byte[0];
- }
- }
- decodedData = new byte[ lastData - numberQuadruple ];
- }
-
- for (int i = 0; i < numberQuadruple; i++)
- {
- dataIndex = i * 4;
- marker0 = base64Data[dataIndex + 2];
- marker1 = base64Data[dataIndex + 3];
-
- b1 = base64Alphabet[base64Data[dataIndex]];
- b2 = base64Alphabet[base64Data[dataIndex +1]];
-
- if (marker0 != PAD && marker1 != PAD)
- {
- //No PAD e.g 3cQl
- b3 = base64Alphabet[ marker0 ];
- b4 = base64Alphabet[ marker1 ];
-
- decodedData[encodedIndex] = (byte)( b1 <<2 | b2>>4 ) ;
- decodedData[encodedIndex + 1] =
- (byte)(((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) );
- decodedData[encodedIndex + 2] = (byte)( b3<<6 | b4 );
- }
- else if (marker0 == PAD)
- {
- //Two PAD e.g. 3c[Pad][Pad]
- decodedData[encodedIndex] = (byte)( b1 <<2 | b2>>4 ) ;
- }
- else if (marker1 == PAD)
- {
- //One PAD e.g. 3cQ[Pad]
- b3 = base64Alphabet[ marker0 ];
-
- decodedData[encodedIndex] = (byte)( b1 <<2 | b2>>4 );
- decodedData[encodedIndex + 1] =
- (byte)(((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) );
- }
- encodedIndex += 3;
- }
- return decodedData;
- }
-
- /**
- * Encodes hex octets of a UTF-8 encoded String into Base64
- *
- * @param data the String to encode.
- * @return Encoded Base64 array
- */
- public static byte[] encode(String data) {
- return encode(data.getBytes());
- }
-
- /**
- * Decodes a string containing Base64 data
- *
- * @param data the String to decode.
- * @return Decoded Base64 array
- */
- public static byte[] decode(String data) {
- return decode(data.getBytes());
- }
-
- static final int base64[] = {
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
- 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
- 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
- };
-
- public static String base64Decode(String orig) {
- char chars[] = orig.toCharArray();
- StringBuilder sb = new StringBuilder();
- int i = 0;
-
- int shift = 0; // # of excess bits stored in accum
- int acc = 0;
-
- for (i = 0; i < chars.length; i++) {
- int v = base64[chars[i] & 0xFF];
-
- if (v >= 64) {
- // Removed logging at finest level
- } else {
- acc = (acc << 6) | v;
- shift += 6;
- if (shift >= 8) {
- shift -= 8;
- sb.append((char) ((acc >> shift) & 0xff));
- }
- }
- }
- return sb.toString();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/Closing.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/Closing.java
deleted file mode 100644
index 7729681d50c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/Closing.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A helper class to aid the closing of {@link InputStream}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class Closing {
-
- public static interface Closure {
- public void f(InputStream in) throws IOException;
- }
-
- public static Closing with(final InputStream in) {
- return new Closing(in);
- }
-
- private final InputStream in;
-
- public Closing(final InputStream in) {
- this.in = in;
- }
-
- public void f(final Closure c) throws IOException {
- if (in == null) {
- return;
- }
- try {
- c.f(in);
- } finally {
- try {
- in.close();
- } catch (IOException ex) {
- throw ex;
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/FeaturesAndProperties.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/FeaturesAndProperties.java
deleted file mode 100644
index d091c54c311..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/FeaturesAndProperties.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.util;
-
-import java.util.Map;
-
-/**
- * Features and properties.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface FeaturesAndProperties {
- /**
- * If true XML security features when parsing XML documents will be
- * disabled.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_DISABLE_XML_SECURITY
- = "com.sun.jersey.config.feature.DisableXmlSecurity";
-
- /**
- * If true then returned XML will be formatted.
- * <p>
- * If true then an entity written by a {@link javax.ws.rs.ext.MessageBodyWriter}
- * may be formatted for the purposes of human readability if that
- * <code>MessageBodyWriter</code> can support such formatting.
- * <p>
- * JAXB-based message body writers that produce XML documents support this
- * property such that , if true, those XML documents will be formatted for
- * human readability.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_FORMATTED
- = "com.sun.jersey.config.feature.Formatted";
-
- /**
- * If true then XML root element tag name for lists
- * will be derived from @XmlRootElement annotation
- * and won't be decapitalized.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_XMLROOTELEMENT_PROCESSING
- = "com.sun.jersey.config.feature.XmlRootElementProcessing";
-
- /**
- * If true, provider precedence will work as it did prior Jersey version 1.4.
- * That behaviour was not according to the spec regarding priority of user
- * defined providers. See (@link https://jersey.dev.java.net/issues/show_bug.cgi?id=571}.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_PRE_1_4_PROVIDER_PRECEDENCE
- = "com.sun.jersey.config.feature.Pre14ProviderPrecedence";
-
- /**
- * Get the map of features associated with the client.
- *
- * @return the features.
- * The returned value shall never be null.
- */
- Map<String, Boolean> getFeatures();
-
- /**
- * Get the value of a feature.
- *
- * @param featureName the feature name.
- * @return true if the feature is present and set to true, otherwise false
- * if the feature is present and set to false or the feature is not
- * present.
- */
- boolean getFeature(String featureName);
-
- /**
- * Get the map of properties associated with the client.
- *
- * @return the properties.
- * The returned value shall never be null.
- */
- Map<String, Object> getProperties();
-
- /**
- * Get the value of a property.
- *
- * @param propertyName the property name.
- * @return the property, or null if there is no property present for the
- * given property name.
- */
- Object getProperty(String propertyName);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparator.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparator.java
deleted file mode 100644
index efe327cc217..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.util.Comparator;
-
-/**
- * A key comparator.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface KeyComparator<K> extends Comparator<K> {
- /**
- * Compare two keys for equality.
- *
- * @param x the first key
- * @param y the second key
- * @return true if the keys are equal.
- */
- boolean equals(K x, K y);
-
- /**
- * Get the hash code of a key.
- * @param k the key.
- * @return the hash code of the key.
- */
- int hash(K k);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorHashMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorHashMap.java
deleted file mode 100644
index cc328dde7ce..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorHashMap.java
+++ /dev/null
@@ -1,983 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import com.sun.jersey.impl.ImplMessages;
-
-/**
- * A implementation similar to {@link java.util.HashMap} but supports the
- * comparison of keys using a {@link KeyComparator}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@SuppressWarnings("unchecked")
-public class KeyComparatorHashMap<K,V>
- extends AbstractMap<K,V>
- implements Map<K,V>, Cloneable, Serializable
-{
-
- /**
- * The default initial capacity - MUST be a power of two.
- */
- static final int DEFAULT_INITIAL_CAPACITY = 16;
-
- /**
- * The maximum capacity, used if a higher value is implicitly specified
- * by either of the constructors with arguments.
- * MUST be a power of two <= 1<<30.
- */
- static final int MAXIMUM_CAPACITY = 1 << 30;
-
- /**
- * The load factor used when none specified in constructor.
- **/
- static final float DEFAULT_LOAD_FACTOR = 0.75f;
-
- /**
- * The table, resized as necessary. Length MUST Always be a power of two.
- */
- transient Entry<K, V>[] table;
-
- /**
- * The number of key-value mappings contained in this identity hash map.
- */
- transient int size;
-
- /**
- * The next size value at which to resize (capacity * load factor).
- * @serial
- */
- int threshold;
-
- /**
- * The load factor for the hash table.
- *
- * @serial
- */
- final float loadFactor;
-
- /**
- * The number of times this HashMap has been structurally modified
- * Structural modifications are those that change the number of mappings in
- * the HashMap or otherwise modify its internal structure (e.g.,
- * rehash). This field is used to make iterators on Collection-views of
- * the HashMap fail-fast. (See ConcurrentModificationException).
- */
- transient volatile int modCount;
-
- public int getDEFAULT_INITIAL_CAPACITY() {
- return DEFAULT_INITIAL_CAPACITY;
- }
-
- final KeyComparator<K> keyComparator;
-
- /**
- * Constructs an empty <tt>HashMap</tt> with the specified initial
- * capacity and load factor.
- *
- * @param initialCapacity The initial capacity.
- * @param loadFactor The load factor.
- * @throws IllegalArgumentException if the initial capacity is negative
- * or the load factor is nonpositive.
- */
- public KeyComparatorHashMap(int initialCapacity, float loadFactor, KeyComparator<K> keyComparator) {
- if (initialCapacity < 0)
- throw new IllegalArgumentException(ImplMessages.ILLEGAL_INITIAL_CAPACITY(initialCapacity));
- if (initialCapacity > MAXIMUM_CAPACITY)
- initialCapacity = MAXIMUM_CAPACITY;
- if (loadFactor <= 0 || Float.isNaN(loadFactor))
- throw new IllegalArgumentException(ImplMessages.ILLEGAL_LOAD_FACTOR(loadFactor));
-
- // Find a power of 2 >= initialCapacity
- int capacity = 1;
- while (capacity < initialCapacity)
- capacity <<= 1;
-
- this.loadFactor = loadFactor;
- threshold = (int)(capacity * loadFactor);
- table = new Entry[capacity];
- init();
-
- this.keyComparator = keyComparator;
- }
-
- /**
- * Constructs an empty <tt>HashMap</tt> with the specified initial
- * capacity and the default load factor (0.75).
- *
- * @param initialCapacity the initial capacity.
- * @throws IllegalArgumentException if the initial capacity is negative.
- */
- public KeyComparatorHashMap(int initialCapacity, KeyComparator<K> keyComparator) {
- this(initialCapacity, DEFAULT_LOAD_FACTOR, keyComparator);
- }
-
- /**
- * Constructs an empty <tt>HashMap</tt> with the default initial capacity
- * (16) and the default load factor (0.75).
- */
- public KeyComparatorHashMap(KeyComparator<K> keyComparator) {
- this.loadFactor = DEFAULT_LOAD_FACTOR;
- threshold = (int)(DEFAULT_INITIAL_CAPACITY * DEFAULT_LOAD_FACTOR);
- table = new Entry[DEFAULT_INITIAL_CAPACITY];
- init();
-
- this.keyComparator = keyComparator;
- }
-
- /**
- * Constructs a new <tt>HashMap</tt> with the same mappings as the
- * specified <tt>Map</tt>. The <tt>HashMap</tt> is created with
- * default load factor (0.75) and an initial capacity sufficient to
- * hold the mappings in the specified <tt>Map</tt>.
- *
- * @param m the map whose mappings are to be placed in this map.
- * @throws NullPointerException if the specified map is null.
- */
- public KeyComparatorHashMap(Map<? extends K, ? extends V> m,
- KeyComparator<K> keyComparator) {
- this(Math.max((int) (m.size() / DEFAULT_LOAD_FACTOR) + 1,
- DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR, keyComparator);
- putAllForCreate(m);
- }
-
- //
-
- /**
- * Get the number of times this HashMap has been structurally modified
- * Structural modifications are those that change the number of mappings in
- * the HashMap or otherwise modify its internal structure (e.g.,
- * rehash).
- *
- * @return return the modification count.
- */
- public int getModCount() {
- return modCount;
- }
-
- // internal utilities
-
- /**
- * Initialization hook for subclasses. This method is called
- * in all constructors and pseudo-constructors (clone, readObject)
- * after HashMap has been initialized but before any entries have
- * been inserted. (In the absence of this method, readObject would
- * require explicit knowledge of subclasses.)
- */
- void init() {
- }
-
- /**
- * Value representing null keys inside tables.
- */
- static final Object NULL_KEY = new Object();
-
- /**
- * Returns internal representation for key. Use NULL_KEY if key is null.
- */
- static <T> T maskNull(T key) {
- return key == null ? (T)NULL_KEY : key;
- }
-
- static <T> boolean isNull(T key) {
- return key == NULL_KEY;
- }
- /**
- * Returns key represented by specified internal representation.
- */
- static <T> T unmaskNull(T key) {
- return key == NULL_KEY ? null : key;
- }
-
- /**
- * Returns a hash value for the specified object. In addition to
- * the object's own hashCode, this method applies a "supplemental
- * hash function," which defends against poor quality hash functions.
- * This is critical because HashMap uses power-of two length
- * hash tables.<p>
- *
- * The shift distances in this function were chosen as the result
- * of an automated search over the entire four-dimensional search space.
- */
- static int hash(Object x) {
- int h = x.hashCode();
-
- h += ~(h << 9);
- h ^= (h >>> 14);
- h += (h << 4);
- h ^= (h >>> 10);
- return h;
- }
-
- /**
- * Check for equality of non-null reference x and possibly-null y.
- */
- static boolean eq(Object x, Object y) {
- return x == y || x.equals(y);
- }
-
- /**
- * Returns index for hash code h.
- */
- static int indexFor(int h, int length) {
- return h & (length-1);
- }
-
- /**
- * Returns the number of key-value mappings in this map.
- *
- * @return the number of key-value mappings in this map.
- */
- @Override
- public int size() {
- return size;
- }
-
- /**
- * Returns <tt>true</tt> if this map contains no key-value mappings.
- *
- * @return <tt>true</tt> if this map contains no key-value mappings.
- */
- @Override
- public boolean isEmpty() {
- return size == 0;
- }
-
- int keyComparatorHash(K k) {
- return isNull(k)
- ? hash(k.hashCode())
- : hash(keyComparator.hash(k));
- }
-
- int hash(int h) {
- h += ~(h << 9);
- h ^= (h >>> 14);
- h += (h << 4);
- h ^= (h >>> 10);
- return h;
- }
-
- /**
- * Check for equality of non-null reference x and possibly-null y.
- */
- boolean keyComparatorEq(K x, K y) {
- if (isNull(x)) {
- return x == y;
- } else if (isNull(y)) {
- return x == y;
- } else {
- return x == y || keyComparator.equals(x, y);
- }
- }
-
- /**
- * Returns the value to which the specified key is mapped in this identity
- * hash map, or <tt>null</tt> if the map contains no mapping for this key.
- * A return value of <tt>null</tt> does not <i>necessarily</i> indicate
- * that the map contains no mapping for the key; it is also possible that
- * the map explicitly maps the key to <tt>null</tt>. The
- * <tt>containsKey</tt> method may be used to distinguish these two cases.
- *
- * @param key the key whose associated value is to be returned.
- * @return the value to which this map maps the specified key, or
- * <tt>null</tt> if the map contains no mapping for this key.
- * @see #put(Object, Object)
- */
- @Override
- public V get(Object key) {
- K k = (K)maskNull(key);
- int hash = keyComparatorHash(k);
- int i = indexFor(hash, table.length);
- Entry<K,V> e = table[i];
- while (true) {
- if (e == null)
- return null;
- if (e.hash == hash && keyComparatorEq(k, e.key))
- return e.value;
- e = e.next;
- }
- }
-
- /**
- * Returns <tt>true</tt> if this map contains a mapping for the
- * specified key.
- *
- * @param key The key whose presence in this map is to be tested
- * @return <tt>true</tt> if this map contains a mapping for the specified
- * key.
- */
- @Override
- public boolean containsKey(Object key) {
- K k = (K)maskNull(key);
- int hash = keyComparatorHash(k);
- int i = indexFor(hash, table.length);
- Entry<K,V> e = table[i];
- while (e != null) {
- if (e.hash == hash && keyComparatorEq(k, e.key))
- return true;
- e = e.next;
- }
- return false;
- }
-
- /**
- * Returns the entry associated with the specified key in the
- * HashMap. Returns null if the HashMap contains no mapping
- * for this key.
- */
- Entry<K,V> getEntry(K key) {
- K k = maskNull(key);
- int hash = keyComparatorHash(k);
- int i = indexFor(hash, table.length);
- Entry<K,V> e = table[i];
- while (e != null && !(e.hash == hash && keyComparatorEq(k, e.key)))
- e = e.next;
- return e;
- }
-
- /**
- * Associates the specified value with the specified key in this map.
- * If the map previously contained a mapping for this key, the old
- * value is replaced.
- *
- * @param key key with which the specified value is to be associated.
- * @param value value to be associated with the specified key.
- * @return previous value associated with specified key, or <tt>null</tt>
- * if there was no mapping for key. A <tt>null</tt> return can
- * also indicate that the HashMap previously associated
- * <tt>null</tt> with the specified key.
- */
- @Override
- public V put(K key, V value) {
- K k = maskNull(key);
- int hash = keyComparatorHash(k);
- int i = indexFor(hash, table.length);
-
- for (Entry<K,V> e = table[i]; e != null; e = e.next) {
- if (e.hash == hash && keyComparatorEq(k, e.key)) {
- V oldValue = e.value;
- e.value = value;
- e.recordAccess(this);
- return oldValue;
- }
- }
-
- modCount++;
- addEntry(hash, k, value, i);
- return null;
- }
-
- /**
- * This method is used instead of put by constructors and
- * pseudoconstructors (clone, readObject). It does not resize the table,
- * check for comodification, etc. It calls createEntry rather than
- * addEntry.
- */
- private void putForCreate(K key, V value) {
- K k = maskNull(key);
- int hash = keyComparatorHash(k);
- int i = indexFor(hash, table.length);
-
- /**
- * Look for preexisting entry for key. This will never happen for
- * clone or deserialize. It will only happen for construction if the
- * input Map is a sorted map whose ordering is inconsistent w/ equals.
- */
- for (Entry<K,V> e = table[i]; e != null; e = e.next) {
- if (e.hash == hash && keyComparatorEq(k, e.key)) {
- e.value = value;
- return;
- }
- }
-
- createEntry(hash, k, value, i);
- }
-
- void putAllForCreate(Map<? extends K, ? extends V> m) {
- for (Iterator<? extends Map.Entry<? extends K, ? extends V>> i = m.entrySet().iterator(); i.hasNext(); ) {
- Map.Entry<? extends K, ? extends V> e = i.next();
- putForCreate(e.getKey(), e.getValue());
- }
- }
-
- /**
- * Rehashes the contents of this map into a new array with a
- * larger capacity. This method is called automatically when the
- * number of keys in this map reaches its threshold.
- *
- * If current capacity is MAXIMUM_CAPACITY, this method does not
- * resize the map, but sets threshold to Integer.MAX_VALUE.
- * This has the effect of preventing future calls.
- *
- * @param newCapacity the new capacity, MUST be a power of two;
- * must be greater than current capacity unless current
- * capacity is MAXIMUM_CAPACITY (in which case value
- * is irrelevant).
- */
- void resize(int newCapacity) {
- Entry<K,V>[] oldTable = table;
- int oldCapacity = oldTable.length;
- if (oldCapacity == MAXIMUM_CAPACITY) {
- threshold = Integer.MAX_VALUE;
- return;
- }
-
- Entry<K,V>[] newTable = new Entry[newCapacity];
- transfer(newTable);
- table = newTable;
- threshold = (int)(newCapacity * loadFactor);
- }
-
- /**
- * Transfer all entries from current table to newTable.
- */
- void transfer(Entry<K,V>[] newTable) {
- Entry<K,V>[] src = table;
- int newCapacity = newTable.length;
- for (int j = 0; j < src.length; j++) {
- Entry<K,V> e = src[j];
- if (e != null) {
- src[j] = null;
- do {
- Entry<K,V> next = e.next;
- int i = indexFor(e.hash, newCapacity);
- e.next = newTable[i];
- newTable[i] = e;
- e = next;
- } while (e != null);
- }
- }
- }
-
- /**
- * Copies all of the mappings from the specified map to this map
- * These mappings will replace any mappings that
- * this map had for any of the keys currently in the specified map.
- *
- * @param m mappings to be stored in this map.
- * @throws NullPointerException if the specified map is null.
- */
- @Override
- public void putAll(Map<? extends K, ? extends V> m) {
- int numKeysToBeAdded = m.size();
- if (numKeysToBeAdded == 0)
- return;
-
- /*
- * Expand the map if the map if the number of mappings to be added
- * is greater than or equal to threshold. This is conservative; the
- * obvious condition is (m.size() + size) >= threshold, but this
- * condition could result in a map with twice the appropriate capacity,
- * if the keys to be added overlap with the keys already in this map.
- * By using the conservative calculation, we subject ourself
- * to at most one extra resize.
- */
- if (numKeysToBeAdded > threshold) {
- int targetCapacity = (int)(numKeysToBeAdded / loadFactor + 1);
- if (targetCapacity > MAXIMUM_CAPACITY)
- targetCapacity = MAXIMUM_CAPACITY;
- int newCapacity = table.length;
- while (newCapacity < targetCapacity)
- newCapacity <<= 1;
- if (newCapacity > table.length)
- resize(newCapacity);
- }
-
- for (Iterator<? extends Map.Entry<? extends K, ? extends V>> i = m.entrySet().iterator(); i.hasNext(); ) {
- Map.Entry<? extends K, ? extends V> e = i.next();
- put(e.getKey(), e.getValue());
- }
- }
-
- /**
- * Removes the mapping for this key from this map if present.
- *
- * @param key key whose mapping is to be removed from the map.
- * @return previous value associated with specified key, or <tt>null</tt>
- * if there was no mapping for key. A <tt>null</tt> return can
- * also indicate that the map previously associated <tt>null</tt>
- * with the specified key.
- */
- @Override
- public V remove(Object key) {
- Entry<K,V> e = removeEntryForKey(key);
- return (e == null ? null : e.value);
- }
-
- /**
- * Removes and returns the entry associated with the specified key
- * in the HashMap. Returns null if the HashMap contains no mapping
- * for this key.
- */
- Entry<K,V> removeEntryForKey(Object key) {
- K k = (K)maskNull(key);
- int hash = keyComparatorHash(k);
- int i = indexFor(hash, table.length);
- Entry<K,V> prev = table[i];
- Entry<K,V> e = prev;
-
- while (e != null) {
- Entry<K,V> next = e.next;
- if (e.hash == hash && keyComparatorEq(k, e.key)) {
- modCount++;
- size--;
- if (prev == e)
- table[i] = next;
- else
- prev.next = next;
- e.recordRemoval(this);
- return e;
- }
- prev = e;
- e = next;
- }
-
- return e;
- }
-
- /**
- * Special version of remove for EntrySet.
- */
- Entry<K,V> removeMapping(Object o) {
- if (!(o instanceof Map.Entry))
- return null;
-
- Map.Entry<K,V> entry = (Map.Entry<K,V>) o;
- K k = (K)maskNull(entry.getKey());
- int hash = keyComparatorHash(k);
- int i = indexFor(hash, table.length);
- Entry<K,V> prev = table[i];
- Entry<K,V> e = prev;
-
- while (e != null) {
- Entry<K,V> next = e.next;
- if (e.hash == hash && e.equals(entry)) {
- modCount++;
- size--;
- if (prev == e)
- table[i] = next;
- else
- prev.next = next;
- e.recordRemoval(this);
- return e;
- }
- prev = e;
- e = next;
- }
-
- return e;
- }
-
- /**
- * Removes all mappings from this map.
- */
- @Override
- public void clear() {
- modCount++;
- Entry[] tab = table;
- for (int i = 0; i < tab.length; i++)
- tab[i] = null;
- size = 0;
- }
-
- /**
- * Returns <tt>true</tt> if this map maps one or more keys to the
- * specified value.
- *
- * @param value value whose presence in this map is to be tested.
- * @return <tt>true</tt> if this map maps one or more keys to the
- * specified value.
- */
- @Override
- public boolean containsValue(Object value) {
- if (value == null)
- return containsNullValue();
-
- Entry[] tab = table;
- for (int i = 0; i < tab.length ; i++)
- for (Entry e = tab[i] ; e != null ; e = e.next)
- if (value.equals(e.value))
- return true;
- return false;
- }
-
- /**
- * Special-case code for containsValue with null argument
- **/
- private boolean containsNullValue() {
- Entry[] tab = table;
- for (int i = 0; i < tab.length ; i++)
- for (Entry e = tab[i] ; e != null ; e = e.next)
- if (e.value == null)
- return true;
- return false;
- }
-
- /**
- * Returns a shallow copy of this <tt>HashMap</tt> instance: the keys and
- * values themselves are not cloned.
- *
- * @return a shallow copy of this map.
- */
- @Override
- public Object clone() {
- KeyComparatorHashMap<K,V> result = null;
- try {
- result = (KeyComparatorHashMap<K,V>)super.clone();
- } catch (CloneNotSupportedException e) {
- // assert false;
- }
- result.table = new Entry[table.length];
- result.entrySet = null;
- result.modCount = 0;
- result.size = 0;
- result.init();
- result.putAllForCreate(this);
-
- return result;
- }
-
- static class Entry<K,V> implements Map.Entry<K,V> {
- final K key;
- V value;
- final int hash;
- Entry<K,V> next;
-
- /**
- * Create new entry.
- */
- Entry(int h, K k, V v, Entry<K,V> n) {
- value = v;
- next = n;
- key = k;
- hash = h;
- }
-
- public K getKey() {
- return KeyComparatorHashMap.<K>unmaskNull(key);
- }
-
- public V getValue() {
- return value;
- }
-
- public V setValue(V newValue) {
- V oldValue = value;
- value = newValue;
- return oldValue;
- }
-
- @Override
- public boolean equals(Object o) {
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry e = (Map.Entry)o;
- Object k1 = getKey();
- Object k2 = e.getKey();
- if (k1 == k2 || (k1 != null && k1.equals(k2))) {
- Object v1 = getValue();
- Object v2 = e.getValue();
- if (v1 == v2 || (v1 != null && v1.equals(v2)))
- return true;
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return (key==NULL_KEY ? 0 : key.hashCode()) ^
- (value==null ? 0 : value.hashCode());
- }
-
- @Override
- public String toString() {
- return getKey() + "=" + getValue();
- }
-
- /**
- * This method is invoked whenever the value in an entry is
- * overwritten by an invocation of put(k,v) for a key k that's already
- * in the HashMap.
- */
- void recordAccess(KeyComparatorHashMap<K,V> m) {
- }
-
- /**
- * This method is invoked whenever the entry is
- * removed from the table.
- */
- void recordRemoval(KeyComparatorHashMap<K,V> m) {
- }
- }
-
- /**
- * Add a new entry with the specified key, value and hash code to
- * the specified bucket. It is the responsibility of this
- * method to resize the table if appropriate.
- *
- * Subclass overrides this to alter the behavior of put method.
- */
- void addEntry(int hash, K key, V value, int bucketIndex) {
- Entry<K,V> e = table[bucketIndex];
- table[bucketIndex] = new Entry<K,V>(hash, key, value, e);
- if (size++ >= threshold)
- resize(2 * table.length);
- }
-
- /**
- * Like addEntry except that this version is used when creating entries
- * as part of Map construction or "pseudo-construction" (cloning,
- * deserialization). This version needn't worry about resizing the table.
- *
- * Subclass overrides this to alter the behavior of HashMap(Map),
- * clone, and readObject.
- */
- void createEntry(int hash, K key, V value, int bucketIndex) {
- Entry<K,V> e = table[bucketIndex];
- table[bucketIndex] = new Entry<K,V>(hash, key, value, e);
- size++;
- }
-
- private abstract class HashIterator<E> implements Iterator<E> {
- Entry<K,V> next; // next entry to return
- int expectedModCount; // For fast-fail
- int index; // current slot
- Entry<K,V> current; // current entry
-
- HashIterator() {
- expectedModCount = modCount;
- Entry<K,V>[] t = table;
- int i = t.length;
- Entry<K,V> n = null;
- if (size != 0) { // advance to first entry
- while (i > 0 && (n = t[--i]) == null)
- ;
- }
- next = n;
- index = i;
- }
-
- public boolean hasNext() {
- return next != null;
- }
-
- Entry<K,V> nextEntry() {
- if (modCount != expectedModCount)
- throw new ConcurrentModificationException();
- Entry<K,V> e = next;
- if (e == null)
- throw new NoSuchElementException();
-
- Entry<K,V> n = e.next;
- Entry<K,V>[] t = table;
- int i = index;
- while (n == null && i > 0)
- n = t[--i];
- index = i;
- next = n;
- return current = e;
- }
-
- public void remove() {
- if (current == null)
- throw new IllegalStateException();
- if (modCount != expectedModCount)
- throw new ConcurrentModificationException();
- K k = current.key;
- current = null;
- KeyComparatorHashMap.this.removeEntryForKey(k);
- expectedModCount = modCount;
- }
-
- }
-
- private class ValueIterator extends HashIterator<V> {
- public V next() {
- return nextEntry().value;
- }
- }
-
- private class KeyIterator extends HashIterator<K> {
- public K next() {
- return nextEntry().getKey();
- }
- }
-
- private class EntryIterator extends HashIterator<Map.Entry<K,V>> {
- public Map.Entry<K,V> next() {
- return nextEntry();
- }
- }
-
- // Subclass overrides these to alter behavior of views' iterator() method
- Iterator<K> newKeyIterator() {
- return new KeyIterator();
- }
- Iterator<V> newValueIterator() {
- return new ValueIterator();
- }
- Iterator<Map.Entry<K,V>> newEntryIterator() {
- return new EntryIterator();
- }
-
-
- // Views
-
- private transient Set<Map.Entry<K,V>> entrySet = null;
-
-
- /**
- * Returns a collection view of the mappings contained in this map. Each
- * element in the returned collection is a <tt>Map.Entry</tt>. The
- * collection is backed by the map, so changes to the map are reflected in
- * the collection, and vice-versa. The collection supports element
- * removal, which removes the corresponding mapping from the map, via the
- * <tt>Iterator.remove</tt>, <tt>Collection.remove</tt>,
- * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt> operations.
- * It does not support the <tt>add</tt> or <tt>addAll</tt> operations.
- *
- * @return a collection view of the mappings contained in this map.
- */
- public Set<Map.Entry<K,V>> entrySet() {
- Set<Map.Entry<K,V>> es = entrySet;
- return (es != null ? es : (entrySet = (Set<Map.Entry<K,V>>) (Set) new EntrySet()));
- }
-
- private class EntrySet extends AbstractSet/*<Map.Entry<K,V>>*/ {
- public Iterator/*<Map.Entry<K,V>>*/ iterator() {
- return newEntryIterator();
- }
- @Override
- public boolean contains(Object o) {
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry<K,V> e = (Map.Entry<K,V>) o;
- Entry<K,V> candidate = getEntry(e.getKey());
- return candidate != null && candidate.equals(e);
- }
- @Override
- public boolean remove(Object o) {
- return removeMapping(o) != null;
- }
- public int size() {
- return size;
- }
- @Override
- public void clear() {
- KeyComparatorHashMap.this.clear();
- }
- }
-
- /**
- * Save the state of the <tt>HashMap</tt> instance to a stream (i.e.,
- * serialize it).
- *
- * @serialData The <i>capacity</i> of the HashMap (the length of the
- * bucket array) is emitted (int), followed by the
- * <i>size</i> of the HashMap (the number of key-value
- * mappings), followed by the key (Object) and value (Object)
- * for each key-value mapping represented by the HashMap
- * The key-value mappings are emitted in the order that they
- * are returned by <tt>entrySet().iterator()</tt>.
- *
- */
- private void writeObject(java.io.ObjectOutputStream s)
- throws IOException
- {
- Iterator<Map.Entry<K,V>> i = entrySet().iterator();
-
- // Write out the threshold, loadfactor, and any hidden stuff
- s.defaultWriteObject();
-
- // Write out number of buckets
- s.writeInt(table.length);
-
- // Write out size (number of Mappings)
- s.writeInt(size);
-
- // Write out keys and values (alternating)
- while (i.hasNext()) {
- Map.Entry<K,V> e = i.next();
- s.writeObject(e.getKey());
- s.writeObject(e.getValue());
- }
- }
-
- /**
- * Reconstitute the <tt>HashMap</tt> instance from a stream (i.e.,
- * deserialize it).
- */
- private void readObject(java.io.ObjectInputStream s)
- throws IOException, ClassNotFoundException
- {
- // Read in the threshold, loadfactor, and any hidden stuff
- s.defaultReadObject();
-
- // Read in number of buckets and allocate the bucket array;
- int numBuckets = s.readInt();
- table = new Entry[numBuckets];
-
- init(); // Give subclass a chance to do its thing.
-
- // Read in size (number of Mappings)
- int size = s.readInt();
-
- // Read the keys and values, and put the mappings in the HashMap
- for (int i=0; i<size; i++) {
- K key = (K) s.readObject();
- V value = (V) s.readObject();
- putForCreate(key, value);
- }
- }
-
- // These methods are used when serializing HashSets
- int capacity() { return table.length; }
- float loadFactor() { return loadFactor; }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.java
deleted file mode 100644
index cf3e3924482..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.java
+++ /dev/null
@@ -1,437 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.core.util;
-
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-/**
- * A implementation similar to {@link java.util.LinkedHashMap} but supports the
- * comparison of keys using a {@link KeyComparator}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class KeyComparatorLinkedHashMap<K, V>
- extends KeyComparatorHashMap<K, V>
- implements Map<K, V> {
-
- private static final long serialVersionUID = 3801124242820219131L;
- /**
- * The head of the doubly linked list.
- */
- private transient Entry<K, V> header;
- /**
- * The iteration ordering method for this linked hash map: <tt>true</tt>
- * for access-order, <tt>false</tt> for insertion-order.
- *
- * @serial
- */
- private final boolean accessOrder;
-
- /**
- * Constructs an empty insertion-ordered <tt>LinkedHashMap</tt> instance
- * with the specified initial capacity and load factor.
- *
- * @param initialCapacity the initial capacity
- * @param loadFactor the load factor
- * @throws IllegalArgumentException if the initial capacity is negative
- * or the load factor is nonpositive
- */
- public KeyComparatorLinkedHashMap(int initialCapacity, float loadFactor,
- KeyComparator<K> keyComparator) {
- super(initialCapacity, loadFactor, keyComparator);
- accessOrder = false;
- }
-
- /**
- * Constructs an empty insertion-ordered <tt>LinkedHashMap</tt> instance
- * with the specified initial capacity and a default load factor (0.75).
- *
- * @param initialCapacity the initial capacity
- * @throws IllegalArgumentException if the initial capacity is negative
- */
- public KeyComparatorLinkedHashMap(int initialCapacity,
- KeyComparator<K> keyComparator) {
- super(initialCapacity, keyComparator);
- accessOrder = false;
- }
-
- /**
- * Constructs an empty insertion-ordered <tt>LinkedHashMap</tt> instance
- * with the default initial capacity (16) and load factor (0.75).
- */
- public KeyComparatorLinkedHashMap(KeyComparator<K> keyComparator) {
- super(keyComparator);
- accessOrder = false;
- }
-
- /**
- * Constructs an insertion-ordered <tt>LinkedHashMap</tt> instance with
- * the same mappings as the specified map. The <tt>LinkedHashMap</tt>
- * instance is created with a default load factor (0.75) and an initial
- * capacity sufficient to hold the mappings in the specified map.
- *
- * @param m the map whose mappings are to be placed in this map
- * @throws NullPointerException if the specified map is null
- */
- public KeyComparatorLinkedHashMap(Map<? extends K, ? extends V> m,
- KeyComparator<K> keyComparator) {
- super(m, keyComparator);
- accessOrder = false;
- }
-
- /**
- * Constructs an empty <tt>LinkedHashMap</tt> instance with the
- * specified initial capacity, load factor and ordering mode.
- *
- * @param initialCapacity the initial capacity
- * @param loadFactor the load factor
- * @param accessOrder the ordering mode - <tt>true</tt> for
- * access-order, <tt>false</tt> for insertion-order
- * @throws IllegalArgumentException if the initial capacity is negative
- * or the load factor is nonpositive
- */
- public KeyComparatorLinkedHashMap(int initialCapacity,
- float loadFactor,
- boolean accessOrder, KeyComparator<K> keyComparator) {
- super(initialCapacity, loadFactor, keyComparator);
- this.accessOrder = accessOrder;
- }
-
- /**
- * Called by superclass constructors and pseudoconstructors (clone,
- * readObject) before any entries are inserted into the map. Initializes
- * the chain.
- */
- @Override
- void init() {
- header = new Entry<K, V>(-1, null, null, null);
- header.before = header.after = header;
- }
-
- /**
- * Transfers all entries to new table array. This method is called
- * by superclass resize. It is overridden for performance, as it is
- * faster to iterate using our linked list.
- */
- @Override
- void transfer(KeyComparatorHashMap.Entry[] newTable) {
- int newCapacity = newTable.length;
- for (Entry<K, V> e = header.after; e != header; e = e.after) {
- int index = indexFor(e.hash, newCapacity);
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
-
- /**
- * Returns <tt>true</tt> if this map maps one or more keys to the
- * specified value.
- *
- * @param value value whose presence in this map is to be tested
- * @return <tt>true</tt> if this map maps one or more keys to the
- * specified value
- */
- @Override
- public boolean containsValue(Object value) {
- // Overridden to take advantage of faster iterator
- if (value == null) {
- for (Entry e = header.after; e != header; e = e.after) {
- if (e.value == null) {
- return true;
- }
- }
- } else {
- for (Entry e = header.after; e != header; e = e.after) {
- if (value.equals(e.value)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Returns the value to which the specified key is mapped,
- * or {@code null} if this map contains no mapping for the key.
- *
- * <p>More formally, if this map contains a mapping from a key
- * {@code k} to a value {@code v} such that {@code (key==null ? k==null :
- * key.equals(k))}, then this method returns {@code v}; otherwise
- * it returns {@code null}. (There can be at most one such mapping.)
- *
- * <p>A return value of {@code null} does not <i>necessarily</i>
- * indicate that the map contains no mapping for the key; it's also
- * possible that the map explicitly maps the key to {@code null}.
- * The {@link #containsKey containsKey} operation may be used to
- * distinguish these two cases.
- */
- @Override
- public V get(Object key) {
- Entry<K, V> e = (Entry<K, V>) getEntry((K)key);
- if (e == null) {
- return null;
- }
- e.recordAccess(this);
- return e.value;
- }
-
- /**
- * Removes all of the mappings from this map.
- * The map will be empty after this call returns.
- */
- @Override
- public void clear() {
- super.clear();
- header.before = header.after = header;
- }
-
- /**
- * LinkedHashMap entry.
- */
- private static class Entry<K, V> extends KeyComparatorHashMap.Entry<K, V> {
- // These fields comprise the doubly linked list used for iteration.
-
- Entry<K, V> before, after;
-
- Entry(int hash, K key, V value, KeyComparatorHashMap.Entry<K, V> next) {
- super(hash, key, value, next);
- }
-
- /**
- * Removes this entry from the linked list.
- */
- private void remove() {
- before.after = after;
- after.before = before;
- }
-
- /**
- * Inserts this entry before the specified existing entry in the list.
- */
- private void addBefore(Entry<K, V> existingEntry) {
- after = existingEntry;
- before = existingEntry.before;
- before.after = this;
- after.before = this;
- }
-
- /**
- * This method is invoked by the superclass whenever the value
- * of a pre-existing entry is read by Map.get or modified by Map.set.
- * If the enclosing Map is access-ordered, it moves the entry
- * to the end of the list; otherwise, it does nothing.
- */
- @Override
- void recordAccess(KeyComparatorHashMap<K, V> m) {
- KeyComparatorLinkedHashMap<K, V> lm = (KeyComparatorLinkedHashMap<K, V>) m;
- if (lm.accessOrder) {
- lm.modCount++;
- remove();
- addBefore(lm.header);
- }
- }
-
- @Override
- void recordRemoval(KeyComparatorHashMap<K,V> m) {
- remove();
- }
- }
-
- private abstract class LinkedHashIterator<T> implements Iterator<T> {
-
- Entry<K, V> nextEntry = header.after;
- Entry<K, V> lastReturned = null;
- /**
- * The modCount value that the iterator believes that the backing
- * List should have. If this expectation is violated, the iterator
- * has detected concurrent modification.
- */
- int expectedModCount = modCount;
-
- public boolean hasNext() {
- return nextEntry != header;
- }
-
- public void remove() {
- if (lastReturned == null) {
- throw new IllegalStateException();
- }
- if (modCount != expectedModCount) {
- throw new ConcurrentModificationException();
- }
-
- KeyComparatorLinkedHashMap.this.remove(lastReturned.key);
- lastReturned = null;
- expectedModCount = modCount;
- }
-
- Entry<K, V> nextEntry() {
- if (modCount != expectedModCount) {
- throw new ConcurrentModificationException();
- }
- if (nextEntry == header) {
- throw new NoSuchElementException();
- }
-
- Entry<K, V> e = lastReturned = nextEntry;
- nextEntry = e.after;
- return e;
- }
- }
-
- private class KeyIterator extends LinkedHashIterator<K> {
-
- public K next() {
- return nextEntry().getKey();
- }
- }
-
- private class ValueIterator extends LinkedHashIterator<V> {
-
- public V next() {
- return nextEntry().value;
- }
- }
-
- private class EntryIterator extends LinkedHashIterator<Map.Entry<K, V>> {
-
- public Map.Entry<K, V> next() {
- return nextEntry();
- }
- }
-
- // These Overrides alter the behavior of superclass view iterator() methods
- @Override
- Iterator<K> newKeyIterator() {
- return new KeyIterator();
- }
-
- @Override
- Iterator<V> newValueIterator() {
- return new ValueIterator();
- }
-
- @Override
- Iterator<Map.Entry<K, V>> newEntryIterator() {
- return new EntryIterator();
- }
-
- /**
- * This override alters behavior of superclass put method. It causes newly
- * allocated entry to get inserted at the end of the linked list and
- * removes the eldest entry if appropriate.
- */
- @Override
- void addEntry(int hash, K key, V value, int bucketIndex) {
- createEntry(hash, key, value, bucketIndex);
-
- // Remove eldest entry if instructed, else grow capacity if appropriate
- Entry<K, V> eldest = header.after;
- if (removeEldestEntry(eldest)) {
- removeEntryForKey(eldest.key);
- } else {
- if (size >= threshold) {
- resize(2 * table.length);
- }
- }
- }
-
- /**
- * This override differs from addEntry in that it doesn't resize the
- * table or remove the eldest entry.
- */
- @Override
- void createEntry(int hash, K key, V value, int bucketIndex) {
- KeyComparatorHashMap.Entry<K, V> old = table[bucketIndex];
- Entry<K, V> e = new Entry<K, V>(hash, key, value, old);
- table[bucketIndex] = e;
- e.addBefore(header);
- size++;
- }
-
- /**
- * Returns <tt>true</tt> if this map should remove its eldest entry.
- * This method is invoked by <tt>put</tt> and <tt>putAll</tt> after
- * inserting a new entry into the map. It provides the implementor
- * with the opportunity to remove the eldest entry each time a new one
- * is added. This is useful if the map represents a cache: it allows
- * the map to reduce memory consumption by deleting stale entries.
- *
- * <p>Sample use: this override will allow the map to grow up to 100
- * entries and then delete the eldest entry each time a new entry is
- * added, maintaining a steady state of 100 entries.
- * <pre>
- * private static final int MAX_ENTRIES = 100;
- *
- * protected boolean removeEldestEntry(Map.Entry eldest) {
- * return size() > MAX_ENTRIES;
- * }
- * </pre>
- *
- * <p>This method typically does not modify the map in any way,
- * instead allowing the map to modify itself as directed by its
- * return value. It <i>is</i> permitted for this method to modify
- * the map directly, but if it does so, it <i>must</i> return
- * <tt>false</tt> (indicating that the map should not attempt any
- * further modification). The effects of returning <tt>true</tt>
- * after modifying the map from within this method are unspecified.
- *
- * <p>This implementation merely returns <tt>false</tt> (so that this
- * map acts like a normal map - the eldest element is never removed).
- *
- * @param eldest The least recently inserted entry in the map, or if
- * this is an access-ordered map, the least recently accessed
- * entry. This is the entry that will be removed it this
- * method returns <tt>true</tt>. If the map was empty prior
- * to the <tt>put</tt> or <tt>putAll</tt> invocation resulting
- * in this invocation, this will be the entry that was just
- * inserted; in other words, if the map contains a single
- * entry, the eldest entry is also the newest.
- * @return <tt>true</tt> if the eldest entry should be removed
- * from the map; <tt>false</tt> if it should be retained.
- */
- protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
- return false;
- }
-}
-
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/LazyVal.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/LazyVal.java
deleted file mode 100644
index 4362e0400a8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/LazyVal.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-/**
- *
- * @author Paul.Sandoz@Oracle.Com
- */
-public abstract class LazyVal<T> {
- private volatile T val;
-
- // Double-check idiom for lazy initialization of instance fields.
- public T get() {
- T result = val;
- if (result == null) { // First check (no locking)
- synchronized (this) {
- result = val;
- if (result == null) { // Second check (with locking)
- val = result = instance();
- }
- }
- }
- return result;
- }
-
- public void set(T t) {
- val = t;
- }
-
- protected abstract T instance();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/MultivaluedMapImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/MultivaluedMapImpl.java
deleted file mode 100644
index 4835b6dde0b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/MultivaluedMapImpl.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * An implementation of {@link MultivaluedMap} where keys and values are
- * instances of String.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class MultivaluedMapImpl
- extends HashMap<String, List<String>>
- implements MultivaluedMap<String, String> {
-
- static final long serialVersionUID = -6052320403766368902L;
-
- public MultivaluedMapImpl() { }
-
- public MultivaluedMapImpl(MultivaluedMap<String, String> that) {
- for (Map.Entry<String, List<String>> e : that.entrySet()) {
- this.put(e.getKey(), new ArrayList<String>(e.getValue()));
- }
- }
-
- // MultivaluedMap
-
- @Override
- public final void putSingle(String key, String value) {
- List<String> l = getList(key);
-
- l.clear();
- if (value != null)
- l.add(value);
- else
- l.add("");
- }
-
- @Override
- public final void add(String key, String value) {
- List<String> l = getList(key);
-
- if (value != null)
- l.add(value);
- else
- l.add("");
- }
-
- @Override
- public final String getFirst(String key) {
- List<String> values = get(key);
- if (values != null && values.size() > 0)
- return values.get(0);
- else
- return null;
- }
-
- //
-
- public final void addFirst(String key, String value) {
- List<String> l = getList(key);
-
- if (value != null)
- l.add(0, value);
- else
- l.add(0, "");
- }
-
- public final <A> List<A> get(String key, Class<A> type) {
- Constructor<A> c = null;
- try {
- c = type.getConstructor(String.class);
- } catch (Exception ex) {
- throw new IllegalArgumentException(type.getName()+" has no String constructor", ex);
- }
-
- ArrayList<A> l = null;
- List<String> values = get(key);
- if (values != null) {
- l = new ArrayList<A>();
- for (String value: values) {
- try {
- l.add(c.newInstance(value));
- } catch (Exception ex) {
- l.add(null);
- }
- }
- }
- return l;
- }
-
- public final void putSingle(String key, Object value) {
- List<String> l = getList(key);
-
- l.clear();
- if (value != null)
- l.add(value.toString());
- else
- l.add("");
- }
-
- public final void add(String key, Object value) {
- List<String> l = getList(key);
-
- if (value != null)
- l.add(value.toString());
- else
- l.add("");
- }
-
- private List<String> getList(String key) {
- List<String> l = get(key);
- if (l == null) {
- l = new LinkedList<String>();
- put(key, l);
- }
- return l;
- }
-
- public final <A> A getFirst(String key, Class<A> type) {
- String value = getFirst(key);
- if (value == null)
- return null;
- Constructor<A> c = null;
- try {
- c = type.getConstructor(String.class);
- } catch (Exception ex) {
- throw new IllegalArgumentException(type.getName()+" has no String constructor", ex);
- }
- A retVal = null;
- try {
- retVal = c.newInstance(value);
- } catch (Exception ex) {
- }
- return retVal;
- }
-
- @SuppressWarnings("unchecked")
- public final <A> A getFirst(String key, A defaultValue) {
- String value = getFirst(key);
- if (value == null)
- return defaultValue;
-
- Class<A> type = (Class<A>)defaultValue.getClass();
-
- Constructor<A> c = null;
- try {
- c = type.getConstructor(String.class);
- } catch (Exception ex) {
- throw new IllegalArgumentException(type.getName()+" has no String constructor", ex);
- }
- A retVal = defaultValue;
- try {
- retVal = c.newInstance(value);
- } catch (Exception ex) {
- }
- return retVal;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/ReaderWriter.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/ReaderWriter.java
deleted file mode 100644
index 1772d8f2c04..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/ReaderWriter.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.nio.charset.Charset;
-import javax.ws.rs.core.MediaType;
-
-/**
- * A utility class for reading and writing using byte and character streams.
- * <p>
- * If a byte or character array is utilized then the size of the array
- * is by default the value of {@link #DEFAULT_BUFFER_SIZE}. This value can
- * be set using the system property {@link #BUFFER_SIZE_SYSTEM_PROPERTY}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ReaderWriter {
- /**
- * The UTF-8 Charset.
- */
- public static final Charset UTF8 = Charset.forName("UTF-8");
-
- /**
- * The system property to set the default buffer size for arrays
- * of byte and character.
- * <p>
- * If the property value is not a positive integer then the default buffer
- * size declared by {@link #DEFAULT_BUFFER_SIZE} will be utilized.
- */
- public static final String BUFFER_SIZE_SYSTEM_PROPERTY =
- "com.sun.jersey.core.util.ReaderWriter.BufferSize";
-
- /**
- * The default buffer size for arrays of byte and character.
- */
- public static final int DEFAULT_BUFFER_SIZE = 8192;
-
- /**
- * The buffer size for arrays of byte and character.
- */
- public static final int BUFFER_SIZE = getBufferSize();
-
-
- private static int getBufferSize() {
- String v = System.getProperty(
- BUFFER_SIZE_SYSTEM_PROPERTY,
- Integer.toString(DEFAULT_BUFFER_SIZE));
- try {
- int i = Integer.valueOf(v);
- if (i <= 0)
- throw new NumberFormatException();
- return i;
- } catch (NumberFormatException ex) {
- return DEFAULT_BUFFER_SIZE;
- }
- }
-
- /**
- * Read bytes from an input stream and write them to an output stream.
- *
- * @param in the input stream to read from.
- * @param out the output stream to write to.
- * @throws IOException if there is an error reading or writing bytes.
- */
- public static final void writeTo(InputStream in, OutputStream out) throws IOException {
- int read;
- final byte[] data = new byte[BUFFER_SIZE];
- while ((read = in.read(data)) != -1)
- out.write(data, 0, read);
- }
-
- /**
- * Read characters from an input stream and write them to an output stream.
- *
- * @param in the reader to read from.
- * @param out the writer to write to.
- * @throws IOException if there is an error reading or writing characters.
- */
- public static final void writeTo(Reader in, Writer out) throws IOException {
- int read;
- final char[] data = new char[BUFFER_SIZE];
- while ((read = in.read(data)) != -1)
- out.write(data, 0, read);
- }
-
- /**
- * Get the character set from a media type.
- * <p>
- * The character set is obtained from the media type parameter "charset".
- * If the parameter is not present the {@link #UTF8} charset is utilized.
- *
- * @param m the media type.
- * @return the character set.
- */
- public static final Charset getCharset(MediaType m) {
- String name = (m == null) ? null : m.getParameters().get("charset");
- return (name == null) ? UTF8 : Charset.forName(name);
- }
-
- /**
- * Read the bytes of an input stream and convert to a string.
- *
- * @param in the input stream to read from.
- * @param type the media type that determines the character set defining
- * how to decode bytes to charaters.
- * @return the string.
- * @throws IOException if there is an error reading from the input stream.
- */
- public static final String readFromAsString(InputStream in,
- MediaType type) throws IOException {
- return readFromAsString(new InputStreamReader(in, getCharset(type)));
- }
-
- /**
- * Read the characters of a reader and convert to a string.
- *
- * @param reader the reader
- * @return the string
- * @throws IOException if there is an error reading from the reader.
- */
- public static final String readFromAsString(Reader reader) throws IOException {
- StringBuilder sb = new StringBuilder();
- char[] c = new char[BUFFER_SIZE];
- int l;
- while ((l = reader.read(c)) != -1) {
- sb.append(c, 0, l);
- }
- return sb.toString();
- }
-
- /**
- * Convert a string to bytes and write those bytes to an output stream.
- *
- * @param s the string to convert to bytes.
- * @param out the output stream to write to.
- * @param type the media type that determines the character set defining
- * how to decode bytes to characters.
- * @throws IOException
- */
- public static final void writeToAsString(String s, OutputStream out,
- MediaType type) throws IOException {
- Writer osw = new BufferedWriter(new OutputStreamWriter(out,
- getCharset(type)));
- osw.write(s);
- osw.flush();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.java
deleted file mode 100644
index 20db22d7ca3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-/**
- * Case insensitive String key comparator.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class StringIgnoreCaseKeyComparator implements KeyComparator<String> {
- public static final StringIgnoreCaseKeyComparator SINGLETON =
- new StringIgnoreCaseKeyComparator();
-
- public int hash(String k) {
- return k.toLowerCase().hashCode();
- }
-
- public boolean equals(String x, String y) {
- return x.equalsIgnoreCase(y);
- }
-
- public int compare(String o1, String o2) {
- return o1.compareToIgnoreCase(o2);
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.java
deleted file mode 100644
index 3e503cce2bd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * An implementation of {@link MultivaluedMap} where keys are instances of
- * String and are compared ignoring case.
- *
- * @param <V> the type of values.
- * @author Paul.Sandoz@Sun.Com
- */
-public class StringKeyIgnoreCaseMultivaluedMap<V>
- extends KeyComparatorLinkedHashMap<String, List<V>>
- implements MultivaluedMap<String, V> {
-
- public StringKeyIgnoreCaseMultivaluedMap() {
- super(StringIgnoreCaseKeyComparator.SINGLETON);
- }
-
- public StringKeyIgnoreCaseMultivaluedMap(StringKeyIgnoreCaseMultivaluedMap<V> that) {
- super(StringIgnoreCaseKeyComparator.SINGLETON);
- for (Map.Entry<String, List<V>> e : that.entrySet()) {
- this.put(e.getKey(), new ArrayList(e.getValue()));
- }
- }
-
- // MultivaluedMap
-
- public void putSingle(String key, V value) {
- if (value == null)
- return;
-
- List<V> l = getList(key);
- l.clear();
- l.add(value);
- }
-
- public void add(String key, V value) {
- if (value == null)
- return;
-
- List<V> l = getList(key);
- l.add(value);
- }
-
- public V getFirst(String key) {
- List<V> values = get(key);
- if (values != null && values.size() > 0)
- return values.get(0);
- else
- return null;
- }
-
- protected List<V> getList(String key) {
- List<V> l = get(key);
- if (l == null) {
- l = new LinkedList<V>();
- put(key, l);
- }
- return l;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.java
deleted file mode 100644
index 6eb695cf32b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * An implementation of {@link MultivaluedMap} where keys are instances of
- * String and are compared ignoring case and values are instances of Object.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class StringKeyObjectValueIgnoreCaseMultivaluedMap
- extends StringKeyIgnoreCaseMultivaluedMap<Object> {
-
- public StringKeyObjectValueIgnoreCaseMultivaluedMap() {
- super();
- }
-
- public StringKeyObjectValueIgnoreCaseMultivaluedMap(StringKeyObjectValueIgnoreCaseMultivaluedMap that) {
- super(that);
- }
-
- @SuppressWarnings("unchecked")
- public <A> List<A> get(String key, Class<A> type) {
- ArrayList<A> l = null;
- List<Object> values = get(key);
- if (values != null) {
- l = new ArrayList<A>();
- for (Object value : values) {
- if (type.isInstance(value)) {
- l.add((A)value);
- } else {
- throw new IllegalArgumentException(type + " is not an instance of " + value.getClass());
- }
- }
- }
- return l;
- }
-
- @SuppressWarnings("unchecked")
- public <A> A getFirst(String key, Class<A> type) {
- Object value = getFirst(key);
- if (value == null)
- return null;
-
- if (type.isInstance(value)) {
- return (A)value;
- } else {
- throw new IllegalArgumentException(type + " is not an instance of " + value.getClass());
- }
- }
-
- @SuppressWarnings("unchecked")
- public <A> A getFirst(String key, A defaultValue) {
- Object value = getFirst(key);
- if (value == null)
- return defaultValue;
-
- if (defaultValue.getClass().isInstance(value)) {
- return (A)value;
- } else {
- throw new IllegalArgumentException(defaultValue.getClass() + " is not an instance of " + value.getClass());
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.java
deleted file mode 100644
index 9ca32bf6851..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * An implementation of {@link MultivaluedMap} where keys are instances of
- * String and are compared ignoring case and values are instances of String.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class StringKeyStringValueIgnoreCaseMultivaluedMap
- extends StringKeyIgnoreCaseMultivaluedMap<String> {
-
- public StringKeyStringValueIgnoreCaseMultivaluedMap() {
- super();
- }
-
- public StringKeyStringValueIgnoreCaseMultivaluedMap(StringKeyStringValueIgnoreCaseMultivaluedMap that) {
- super(that);
- }
-
- public void putSingleObject(String key, Object value) {
- List<String> l = getList(key);
-
- l.clear();
- if (value != null)
- l.add(value.toString());
- else
- l.add("");
- }
-
- public void addObject(String key, Object value) {
- List<String> l = getList(key);
-
- if (value != null)
- l.add(value.toString());
- else
- l.add("");
- }
-
- public <A> List<A> get(String key, Class<A> type) {
- Constructor<A> c = null;
- try {
- c = type.getConstructor(String.class);
- } catch (Exception ex) {
- throw new IllegalArgumentException(type.getName()+" has no String constructor", ex);
- }
-
- ArrayList<A> l = null;
- List<String> values = get(key);
- if (values != null) {
- l = new ArrayList<A>();
- for (String value: values) {
- try {
- l.add(c.newInstance(value));
- } catch (Exception ex) {
- l.add(null);
- }
- }
- }
- return l;
- }
-
- public <A> A getFirst(String key, Class<A> type) {
- String value = getFirst(key);
- if (value == null)
- return null;
- Constructor<A> c = null;
- try {
- c = type.getConstructor(String.class);
- } catch (Exception ex) {
- throw new IllegalArgumentException(type.getName()+" has no String constructor", ex);
- }
- A retVal = null;
- try {
- retVal = c.newInstance(value);
- } catch (Exception ex) {
- }
- return retVal;
- }
-
- @SuppressWarnings("unchecked")
- public <A> A getFirst(String key, A defaultValue) {
- String value = getFirst(key);
- if (value == null)
- return defaultValue;
-
- Class<A> type = (Class<A>)defaultValue.getClass();
-
- Constructor<A> c = null;
- try {
- c = type.getConstructor(String.class);
- } catch (Exception ex) {
- throw new IllegalArgumentException(type.getName()+" has no String constructor", ex);
- }
- A retVal = defaultValue;
- try {
- retVal = c.newInstance(value);
- } catch (Exception ex) {
- }
- return retVal;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/ThrowHelper.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/ThrowHelper.java
deleted file mode 100644
index 13fd566cd47..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/ThrowHelper.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-/**
- * Help functionality when throwing exceptions.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ThrowHelper {
-
- /**
- * Set the cause of an exception.
- *
- * @param <T> the exception type.
- * @param cause the cause.
- * @param effect the effect
- * @return the effect.
- */
- public static <T extends Exception> T withInitCause(Exception cause, T effect) {
- effect.initCause(cause);
- return effect;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.java
deleted file mode 100644
index bc482a5e813..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.core.util;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * An unmodifiable view of a {@link MultivaluedMap}.
- *
- * @param <K> the key
- * @param <V> the value
- * @author Gili Tzabari
- */
-public class UnmodifiableMultivaluedMap<K, V> implements MultivaluedMap<K, V>
-{
- private final MultivaluedMap<K, V> delegate;
-
- /**
- * Creates a new ImmutableMultivaluedMap.
- *
- * @param delegate the underlying MultivaluedMap
- */
- public UnmodifiableMultivaluedMap(MultivaluedMap<K, V> delegate)
- {
- this.delegate = delegate;
- }
-
- public void putSingle(K key, V value)
- {
- throw new UnsupportedOperationException();
- }
-
- public void add(K key, V value)
- {
- throw new UnsupportedOperationException();
- }
-
- public V getFirst(K key)
- {
- return delegate.getFirst(key);
- }
-
- public int size()
- {
- return delegate.size();
- }
-
- public boolean isEmpty()
- {
- return delegate.isEmpty();
- }
-
- public boolean containsKey(Object key)
- {
- return delegate.containsKey(key);
- }
-
- public boolean containsValue(Object value)
- {
- return delegate.containsValue(value);
- }
-
- public List<V> get(Object key)
- {
- return delegate.get(key);
- }
-
- public List<V> put(K key, List<V> value)
- {
- throw new UnsupportedOperationException();
- }
-
- public List<V> remove(Object key)
- {
- throw new UnsupportedOperationException();
- }
-
- public void putAll(Map<? extends K, ? extends List<V>> m)
- {
- throw new UnsupportedOperationException();
- }
-
- public void clear()
- {
- throw new UnsupportedOperationException();
- }
-
- public Set<K> keySet()
- {
- return Collections.unmodifiableSet(delegate.keySet());
- }
-
- public Collection<List<V>> values()
- {
- return Collections.unmodifiableCollection(delegate.values());
- }
-
- public Set<Entry<K, List<V>>> entrySet()
- {
- return Collections.unmodifiableSet(delegate.entrySet());
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/core/util/package-info.java
deleted file mode 100644
index 38ff141d6cc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/core/util/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for collection-based classes.
- */
-package com.sun.jersey.core.util;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.java
deleted file mode 100644
index e93abc998d1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.fastinfoset.impl.provider.entity;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider;
-import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer;
-import com.sun.xml.fastinfoset.stax.StAXDocumentParser;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces("application/fastinfoset")
-@Consumes("application/fastinfoset")
-public final class FastInfosetJAXBElementProvider extends AbstractJAXBElementProvider {
-
- public FastInfosetJAXBElementProvider(@Context Providers ps) {
- super(ps, MediaTypes.FAST_INFOSET);
- }
-
- protected final JAXBElement<?> readFrom(Class<?> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException {
- return u.unmarshal(new StAXDocumentParser(entityStream), type);
- }
-
- protected final void writeTo(JAXBElement<?> t, MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException {
- final XMLStreamWriter xsw = new StAXDocumentSerializer(entityStream);
- m.marshal(t, xsw);
- try {
- xsw.flush();
- } catch (XMLStreamException cause) {
- throw new JAXBException(cause);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.java
deleted file mode 100644
index 8745e4feb53..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.fastinfoset.impl.provider.entity;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.provider.jaxb.AbstractListElementProvider;
-import com.sun.jersey.core.util.ThrowHelper;
-import com.sun.xml.fastinfoset.stax.StAXDocumentParser;
-import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-import java.util.Collection;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces("application/fastinfoset")
-@Consumes("application/fastinfoset")
-public class FastInfosetListElementProvider extends AbstractListElementProvider {
-
- public FastInfosetListElementProvider(@Context Providers ps) {
- super(ps, MediaTypes.FAST_INFOSET);
- }
-
- @Override
- protected final XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller u,
- InputStream entityStream)
- throws XMLStreamException {
- StAXDocumentParser parser = new StAXDocumentParser(entityStream);
-
- // jaxb needs interning doc parser, see http://java.net/jira/browse/JERSEY-320
- parser.setStringInterning(true);
-
- return parser;
- }
-
- public final void writeList(Class<?> elementType, Collection<?> t,
- MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException, IOException {
- final XMLStreamWriter xsw = new StAXDocumentSerializer(entityStream);
-
- final String rootElement = getRootElementName(elementType);
-
- try {
- xsw.writeStartDocument();
- xsw.writeStartElement(rootElement);
- for (Object o : t)
- m.marshal(o, xsw);
- xsw.writeEndElement();
- xsw.writeEndDocument();
- xsw.flush();
- } catch (XMLStreamException cause) {
- throw ThrowHelper.withInitCause(cause,
- new IOException()
- );
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.java
deleted file mode 100644
index 2aedcd806f7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.fastinfoset.impl.provider.entity;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider;
-import com.sun.xml.fastinfoset.stax.StAXDocumentParser;
-import com.sun.xml.fastinfoset.stax.StAXDocumentSerializer;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces("application/fastinfoset")
-@Consumes("application/fastinfoset")
-public final class FastInfosetRootElementProvider extends AbstractRootElementProvider {
-
- public FastInfosetRootElementProvider(@Context Providers ps) {
- super(ps, MediaTypes.FAST_INFOSET);
- }
-
- @Override
- protected final Object readFrom(Class<Object> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException {
- final StAXDocumentParser p = new StAXDocumentParser(entityStream);
- if (type.isAnnotationPresent(XmlRootElement.class))
- return u.unmarshal(p);
- else
- return u.unmarshal(p, type).getValue();
- }
-
- @Override
- protected void writeTo(Object t, MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException {
- XMLStreamWriter xsw = new StAXDocumentSerializer(entityStream);
- m.marshal(t, xsw);
- try {
- xsw.flush();
- } catch (XMLStreamException cause) {
- throw new JAXBException(cause);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/impl/ApiMessages.java b/plugins/com.sun.jersey.source/com/sun/jersey/impl/ApiMessages.java
deleted file mode 100644
index 5f58f509a23..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/impl/ApiMessages.java
+++ /dev/null
@@ -1,17 +0,0 @@
-
-package com.sun.jersey.impl;
-
-import com.sun.jersey.localization.LocalizableMessageFactory;
-import com.sun.jersey.localization.Localizer;
-
-
-/**
- * Defines string formatting method for each constant in the resource file
- *
- */
-public final class ApiMessages {
-
- private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.jersey.impl.api");
- private final static Localizer localizer = new Localizer();
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/impl/ImplMessages.java b/plugins/com.sun.jersey.source/com/sun/jersey/impl/ImplMessages.java
deleted file mode 100644
index 9ca7656d63a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/impl/ImplMessages.java
+++ /dev/null
@@ -1,774 +0,0 @@
-
-package com.sun.jersey.impl;
-
-import com.sun.jersey.localization.Localizable;
-import com.sun.jersey.localization.LocalizableMessageFactory;
-import com.sun.jersey.localization.Localizer;
-
-
-/**
- * Defines string formatting method for each constant in the resource file
- *
- */
-public final class ImplMessages {
-
- private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.jersey.impl.impl");
- private final static Localizer localizer = new Localizer();
-
- public static Localizable localizableERROR_NO_SUB_RES_METHOD_LOCATOR_FOUND(Object arg0) {
- return messageFactory.getMessage("error.no.sub.res.method.locator.found", arg0);
- }
-
- /**
- * A resource class, {0}, does not have any resource method, sub-resource method, or sub-resource locator.
- *
- */
- public static String ERROR_NO_SUB_RES_METHOD_LOCATOR_FOUND(Object arg0) {
- return localizer.localize(localizableERROR_NO_SUB_RES_METHOD_LOCATOR_FOUND(arg0));
- }
-
- public static Localizable localizableQUALITY_GREATER_THAN_ONE(Object arg0) {
- return messageFactory.getMessage("quality.greater.than.one", arg0);
- }
-
- /**
- * Quality value "{0}" is greater than 1.
- *
- */
- public static String QUALITY_GREATER_THAN_ONE(Object arg0) {
- return localizer.localize(localizableQUALITY_GREATER_THAN_ONE(arg0));
- }
-
- public static Localizable localizableAMBIGUOUS_SRMS_OUT(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) {
- return messageFactory.getMessage("ambiguous.srms.out", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- }
-
- /**
- * A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and output mime-type: {3}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {4} and {5}) are {6} and {7}
- *
- */
- public static String AMBIGUOUS_SRMS_OUT(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) {
- return localizer.localize(localizableAMBIGUOUS_SRMS_OUT(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7));
- }
-
- public static Localizable localizableAMBIGUOUS_RMS_OUT(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
- return messageFactory.getMessage("ambiguous.rms.out", arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- }
-
- /**
- * A resource, {0}, has ambiguous resource method for HTTP method {1} and output mime-type: {2}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {3} and {4}) are {5} and {6}
- *
- */
- public static String AMBIGUOUS_RMS_OUT(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
- return localizer.localize(localizableAMBIGUOUS_RMS_OUT(arg0, arg1, arg2, arg3, arg4, arg5, arg6));
- }
-
- public static Localizable localizableAMBIGUOUS_RMS_IN(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
- return messageFactory.getMessage("ambiguous.rms.in", arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- }
-
- /**
- * A resource, {0}, has ambiguous resource method for HTTP method {1} and input mime-type: {2}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {3} and {4}) are {5} and {6}. This could cause an error for conflicting output types!
- *
- */
- public static String AMBIGUOUS_RMS_IN(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) {
- return localizer.localize(localizableAMBIGUOUS_RMS_IN(arg0, arg1, arg2, arg3, arg4, arg5, arg6));
- }
-
- public static Localizable localizableDEFAULT_COULD_NOT_PROCESS_METHOD(Object arg0, Object arg1) {
- return messageFactory.getMessage("default.could.not.process.method", arg0, arg1);
- }
-
- /**
- * Default value, {0} could not be processed by method {1}.
- *
- */
- public static String DEFAULT_COULD_NOT_PROCESS_METHOD(Object arg0, Object arg1) {
- return localizer.localize(localizableDEFAULT_COULD_NOT_PROCESS_METHOD(arg0, arg1));
- }
-
- public static Localizable localizableNESTED_ERROR(Object arg0) {
- return messageFactory.getMessage("nested.error", arg0);
- }
-
- /**
- * NESTED ERROR: {0}.
- *
- */
- public static String NESTED_ERROR(Object arg0) {
- return localizer.localize(localizableNESTED_ERROR(arg0));
- }
-
- public static Localizable localizableAMBIGUOUS_SRMS_IN(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) {
- return messageFactory.getMessage("ambiguous.srms.in", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- }
-
- /**
- * A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and input mime-type: {3}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {4} and {5}) are {6} and {7}. This could cause an error for conflicting output types!
- *
- */
- public static String AMBIGUOUS_SRMS_IN(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) {
- return localizer.localize(localizableAMBIGUOUS_SRMS_IN(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7));
- }
-
- public static Localizable localizableSUB_RES_METHOD_TREATED_AS_RES_METHOD(Object arg0, Object arg1) {
- return messageFactory.getMessage("sub.res.method.treated.as.res.method", arg0, arg1);
- }
-
- /**
- * A sub-resource method, {0}, with URI template, "{1}", is treated as a resource method
- *
- */
- public static String SUB_RES_METHOD_TREATED_AS_RES_METHOD(Object arg0, Object arg1) {
- return localizer.localize(localizableSUB_RES_METHOD_TREATED_AS_RES_METHOD(arg0, arg1));
- }
-
- public static Localizable localizableMULTIPLE_HTTP_METHOD_DESIGNATORS(Object arg0, Object arg1) {
- return messageFactory.getMessage("multiple.http.method.designators", arg0, arg1);
- }
-
- /**
- * A (sub-)resource method, {0}, should have only one HTTP method designator. It currently has the following designators defined: {1}
- *
- */
- public static String MULTIPLE_HTTP_METHOD_DESIGNATORS(Object arg0, Object arg1) {
- return localizer.localize(localizableMULTIPLE_HTTP_METHOD_DESIGNATORS(arg0, arg1));
- }
-
- public static Localizable localizableAMBIGUOUS_CTORS(Object arg0) {
- return messageFactory.getMessage("ambiguous.ctors", arg0);
- }
-
- /**
- * A root resource, {0}, has ambiguous constructors to use for initialization
- *
- */
- public static String AMBIGUOUS_CTORS(Object arg0) {
- return localizer.localize(localizableAMBIGUOUS_CTORS(arg0));
- }
-
- public static Localizable localizableFAILED_TO_CREATE_WEB_RESOURCE(Object arg0) {
- return messageFactory.getMessage("failed.to.create.web.resource", arg0);
- }
-
- /**
- * Failed to create Web resource: {0}.
- *
- */
- public static String FAILED_TO_CREATE_WEB_RESOURCE(Object arg0) {
- return localizer.localize(localizableFAILED_TO_CREATE_WEB_RESOURCE(arg0));
- }
-
- public static Localizable localizableERROR_GET_RETURNS_VOID(Object arg0) {
- return messageFactory.getMessage("error.get.returns.void", arg0);
- }
-
- /**
- * A HTTP GET method, {0}, MUST return a non-void type.
- *
- */
- public static String ERROR_GET_RETURNS_VOID(Object arg0) {
- return localizer.localize(localizableERROR_GET_RETURNS_VOID(arg0));
- }
-
- public static Localizable localizableERROR_RES_URI_PATH_INVALID(Object arg0, Object arg1) {
- return messageFactory.getMessage("error.res.uri.path.invalid", arg0, arg1);
- }
-
- /**
- * A root resource class, {0}, has an invalid URI path: {1}.
- *
- */
- public static String ERROR_RES_URI_PATH_INVALID(Object arg0, Object arg1) {
- return localizer.localize(localizableERROR_RES_URI_PATH_INVALID(arg0, arg1));
- }
-
- public static Localizable localizableILLEGAL_PROVIDER_CLASS_NAME(Object arg0) {
- return messageFactory.getMessage("illegal.provider.class.name", arg0);
- }
-
- /**
- * Illegal provider-class name: {0}.
- *
- */
- public static String ILLEGAL_PROVIDER_CLASS_NAME(Object arg0) {
- return localizer.localize(localizableILLEGAL_PROVIDER_CLASS_NAME(arg0));
- }
-
- public static Localizable localizableERROR_PROCESSING_METHOD(Object arg0, Object arg1) {
- return messageFactory.getMessage("error.processing.method", arg0, arg1);
- }
-
- /**
- * Error processing resource method, {0}, for ResourceMethodDispatchProvider, {1}.
- *
- */
- public static String ERROR_PROCESSING_METHOD(Object arg0, Object arg1) {
- return localizer.localize(localizableERROR_PROCESSING_METHOD(arg0, arg1));
- }
-
- public static Localizable localizableBAD_URITEMPLATE(Object arg0, Object arg1) {
- return messageFactory.getMessage("bad.uritemplate", arg0, arg1);
- }
-
- /**
- * Web resource, "{0}": URI template "{1}" of @Path could not be processed on Web resource.
- *
- */
- public static String BAD_URITEMPLATE(Object arg0, Object arg1) {
- return localizer.localize(localizableBAD_URITEMPLATE(arg0, arg1));
- }
-
- public static Localizable localizableRESOURCE_NOT_ACCEPTABLE(Object arg0, Object arg1) {
- return messageFactory.getMessage("resource.not.acceptable", arg0, arg1);
- }
-
- /**
- * {0}, is returning a MIME type, "{1}", that is not acceptable.
- *
- */
- public static String RESOURCE_NOT_ACCEPTABLE(Object arg0, Object arg1) {
- return localizer.localize(localizableRESOURCE_NOT_ACCEPTABLE(arg0, arg1));
- }
-
- public static Localizable localizableGENERIC_TYPE_NOT_SUPPORTED(Object arg0, Object arg1) {
- return messageFactory.getMessage("generic.type.not.supported", arg0, arg1);
- }
-
- /**
- * Generic type, {0}, not support for parameter {1}.
- *
- */
- public static String GENERIC_TYPE_NOT_SUPPORTED(Object arg0, Object arg1) {
- return localizer.localize(localizableGENERIC_TYPE_NOT_SUPPORTED(arg0, arg1));
- }
-
- public static Localizable localizableBAD_CONTENT_TYPE(Object arg0) {
- return messageFactory.getMessage("bad.content.type", arg0);
- }
-
- /**
- * The HTTP header field "Content-Type" with value "{0}" could not be parsed.
- *
- */
- public static String BAD_CONTENT_TYPE(Object arg0) {
- return localizer.localize(localizableBAD_CONTENT_TYPE(arg0));
- }
-
- public static Localizable localizableERROR_SUBRES_LOC_URI_PATH_INVALID(Object arg0, Object arg1) {
- return messageFactory.getMessage("error.subres.loc.uri.path.invalid", arg0, arg1);
- }
-
- /**
- * A sub-resource locator, {0}, has an invalid URI path: {1}
- *
- */
- public static String ERROR_SUBRES_LOC_URI_PATH_INVALID(Object arg0, Object arg1) {
- return localizer.localize(localizableERROR_SUBRES_LOC_URI_PATH_INVALID(arg0, arg1));
- }
-
- public static Localizable localizableNOT_VALID_HTTPMETHOD(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("not.valid.httpmethod", arg0, arg1, arg2);
- }
-
- /**
- * Method, {0}, annotated with {1} of resource, {2}, is not recognized as valid resource method.
- *
- */
- public static String NOT_VALID_HTTPMETHOD(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableNOT_VALID_HTTPMETHOD(arg0, arg1, arg2));
- }
-
- public static Localizable localizableNON_PUB_SUB_RES_LOC(Object arg0) {
- return messageFactory.getMessage("non.pub.sub.res.loc", arg0);
- }
-
- /**
- * A sub-resource locator, {0}, MUST be public scoped otherwise the method is ignored
- *
- */
- public static String NON_PUB_SUB_RES_LOC(Object arg0) {
- return localizer.localize(localizableNON_PUB_SUB_RES_LOC(arg0));
- }
-
- public static Localizable localizableERROR_GET_CONSUMES_ENTITY(Object arg0) {
- return messageFactory.getMessage("error.get.consumes.entity", arg0);
- }
-
- /**
- * A HTTP GET method, {0}, should not consume any entity.
- *
- */
- public static String ERROR_GET_CONSUMES_ENTITY(Object arg0) {
- return localizer.localize(localizableERROR_GET_CONSUMES_ENTITY(arg0));
- }
-
- public static Localizable localizableWEB_APP_ALREADY_INITIATED() {
- return messageFactory.getMessage("web.app.already.initiated");
- }
-
- /**
- * Web application is already initiated.
- *
- */
- public static String WEB_APP_ALREADY_INITIATED() {
- return localizer.localize(localizableWEB_APP_ALREADY_INITIATED());
- }
-
- public static Localizable localizableAMBIGUOUS_SRLS(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("ambiguous.srls", arg0, arg1, arg2);
- }
-
- /**
- * A resource, {0}, has ambiguous sub-resource locator for URI template {1}, which matches with template {2}
- *
- */
- public static String AMBIGUOUS_SRLS(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableAMBIGUOUS_SRLS(arg0, arg1, arg2));
- }
-
- public static Localizable localizableERROR_UNMARSHALLING_JAXB(Object arg0) {
- return messageFactory.getMessage("error.unmarshalling.jaxb", arg0);
- }
-
- /**
- * Error unmarshalling JAXB object of type "{0}".
- *
- */
- public static String ERROR_UNMARSHALLING_JAXB(Object arg0) {
- return localizer.localize(localizableERROR_UNMARSHALLING_JAXB(arg0));
- }
-
- public static Localizable localizableBAD_CLASS_CONSUMEMIME(Object arg0, Object arg1) {
- return messageFactory.getMessage("bad.class.consumemime", arg0, arg1);
- }
-
- /**
- * Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on Web resource.
- *
- */
- public static String BAD_CLASS_CONSUMEMIME(Object arg0, Object arg1) {
- return localizer.localize(localizableBAD_CLASS_CONSUMEMIME(arg0, arg1));
- }
-
- public static Localizable localizableERROR_SUBRES_METHOD_URI_PATH_INVALID(Object arg0, Object arg1) {
- return messageFactory.getMessage("error.subres.method.uri.path.invalid", arg0, arg1);
- }
-
- /**
- * A sub-resource method, {0}, has an invalid URI path: {1}
- *
- */
- public static String ERROR_SUBRES_METHOD_URI_PATH_INVALID(Object arg0, Object arg1) {
- return localizer.localize(localizableERROR_SUBRES_METHOD_URI_PATH_INVALID(arg0, arg1));
- }
-
- public static Localizable localizableBAD_METHOD_CONSUMEMIME(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("bad.method.consumemime", arg0, arg1, arg2);
- }
-
- /**
- * Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on method "{2} of Web Resource.
- *
- */
- public static String BAD_METHOD_CONSUMEMIME(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableBAD_METHOD_CONSUMEMIME(arg0, arg1, arg2));
- }
-
- public static Localizable localizableILLEGAL_INITIAL_CAPACITY(Object arg0) {
- return messageFactory.getMessage("illegal.initial.capacity", arg0);
- }
-
- /**
- * Illegal initial capacity: {0}.
- *
- */
- public static String ILLEGAL_INITIAL_CAPACITY(Object arg0) {
- return localizer.localize(localizableILLEGAL_INITIAL_CAPACITY(arg0));
- }
-
- public static Localizable localizableNEW_AR_CREATED_BY_INTROSPECTION_MODELER(Object arg0) {
- return messageFactory.getMessage("new.ar.created.by.introspection.modeler", arg0);
- }
-
- /**
- * A new abstract resource created by IntrospectionModeler: {0}
- *
- */
- public static String NEW_AR_CREATED_BY_INTROSPECTION_MODELER(Object arg0) {
- return localizer.localize(localizableNEW_AR_CREATED_BY_INTROSPECTION_MODELER(arg0));
- }
-
- public static Localizable localizableOBJECT_NOT_A_WEB_RESOURCE(Object arg0) {
- return messageFactory.getMessage("object.not.a.webResource", arg0);
- }
-
- /**
- * Object, "{0}": is not a Web resource since it is not annotated with @Path.
- *
- */
- public static String OBJECT_NOT_A_WEB_RESOURCE(Object arg0) {
- return localizer.localize(localizableOBJECT_NOT_A_WEB_RESOURCE(arg0));
- }
-
- public static Localizable localizableAMBIGUOUS_PARAMETER(Object arg0, Object arg1) {
- return messageFactory.getMessage("ambiguous.parameter", arg0, arg1);
- }
-
- /**
- * Parameter {1} of {0} MUST be only one of a path, query, matrix or header parameter.
- *
- */
- public static String AMBIGUOUS_PARAMETER(Object arg0, Object arg1) {
- return localizer.localize(localizableAMBIGUOUS_PARAMETER(arg0, arg1));
- }
-
- public static Localizable localizableERROR_RES_URI_PATH_REQUIRED(Object arg0) {
- return messageFactory.getMessage("error.res.uri.path.required", arg0);
- }
-
- /**
- * A root resource class, {0}, MUST have a URI path.
- *
- */
- public static String ERROR_RES_URI_PATH_REQUIRED(Object arg0) {
- return localizer.localize(localizableERROR_RES_URI_PATH_REQUIRED(arg0));
- }
-
- public static Localizable localizableQUALITY_MORE_THAN_THREE(Object arg0) {
- return messageFactory.getMessage("quality.more.than.three", arg0);
- }
-
- /**
- * Quality value "{0}" has more than 3 digits after the decimal point.
- *
- */
- public static String QUALITY_MORE_THAN_THREE(Object arg0) {
- return localizer.localize(localizableQUALITY_MORE_THAN_THREE(arg0));
- }
-
- public static Localizable localizableBAD_CONSUMEMIME(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("bad.consumemime", arg0, arg1, arg2);
- }
-
- /**
- * Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource.
- *
- */
- public static String BAD_CONSUMEMIME(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableBAD_CONSUMEMIME(arg0, arg1, arg2));
- }
-
- public static Localizable localizableUNABLE_TO_WRITE_MIMEMULTIPART() {
- return messageFactory.getMessage("unable.to.write.mimemultipart");
- }
-
- /**
- * Unable to write MimeMultipart content.
- *
- */
- public static String UNABLE_TO_WRITE_MIMEMULTIPART() {
- return localizer.localize(localizableUNABLE_TO_WRITE_MIMEMULTIPART());
- }
-
- public static Localizable localizableNON_PUB_SUB_RES_METHOD(Object arg0) {
- return messageFactory.getMessage("non.pub.sub.res.method", arg0);
- }
-
- /**
- * A sub-resource method, {0}, MUST be public scoped otherwise the method is ignored
- *
- */
- public static String NON_PUB_SUB_RES_METHOD(Object arg0) {
- return localizer.localize(localizableNON_PUB_SUB_RES_METHOD(arg0));
- }
-
- public static Localizable localizablePROVIDER_COULD_NOT_BE_CREATED(Object arg0, Object arg1) {
- return messageFactory.getMessage("provider.could.not.be.created", arg0, arg1);
- }
-
- /**
- * Provider {0} could not be instantiated: {1}
- *
- */
- public static String PROVIDER_COULD_NOT_BE_CREATED(Object arg0, Object arg1) {
- return localizer.localize(localizablePROVIDER_COULD_NOT_BE_CREATED(arg0, arg1));
- }
-
- public static Localizable localizableBAD_MIME_TYPE(Object arg0) {
- return messageFactory.getMessage("bad.mime.type", arg0);
- }
-
- /**
- * The MIME type of the representation with value "{0}" could not be parsed.
- *
- */
- public static String BAD_MIME_TYPE(Object arg0) {
- return localizer.localize(localizableBAD_MIME_TYPE(arg0));
- }
-
- public static Localizable localizableAMBIGUOUS_RR_PATH(Object arg0, Object arg1) {
- return messageFactory.getMessage("ambiguous.rr.path", arg0, arg1);
- }
-
- /**
- * A root resource, {0}, has a non-unique URI template {1}
- *
- */
- public static String AMBIGUOUS_RR_PATH(Object arg0, Object arg1) {
- return localizer.localize(localizableAMBIGUOUS_RR_PATH(arg0, arg1));
- }
-
- public static Localizable localizableILLEGAL_LOAD_FACTOR(Object arg0) {
- return messageFactory.getMessage("illegal.load.factor", arg0);
- }
-
- /**
- * Illegal load factor: {0}.
- *
- */
- public static String ILLEGAL_LOAD_FACTOR(Object arg0) {
- return localizer.localize(localizableILLEGAL_LOAD_FACTOR(arg0));
- }
-
- public static Localizable localizableERROR_MARSHALLING_JAXB(Object arg0) {
- return messageFactory.getMessage("error.marshalling.jaxb", arg0);
- }
-
- /**
- * Error marshalling JAXB object of type "{0}".
- *
- */
- public static String ERROR_MARSHALLING_JAXB(Object arg0) {
- return localizer.localize(localizableERROR_MARSHALLING_JAXB(arg0));
- }
-
- public static Localizable localizableNOT_VALID_DYNAMICRESOLVINGMETHOD(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("not.valid.dynamicresolvingmethod", arg0, arg1, arg2);
- }
-
- /**
- * Method, {0}, annotated with URI template {1} of resource, {2}, is not recognized as valid Java method annotated with @Path.
- *
- */
- public static String NOT_VALID_DYNAMICRESOLVINGMETHOD(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableNOT_VALID_DYNAMICRESOLVINGMETHOD(arg0, arg1, arg2));
- }
-
- public static Localizable localizableRESOURCE_METHOD(Object arg0, Object arg1) {
- return messageFactory.getMessage("resource.method", arg0, arg1);
- }
-
- /**
- * Resource, {0}, with method, {1}
- *
- */
- public static String RESOURCE_METHOD(Object arg0, Object arg1) {
- return localizer.localize(localizableRESOURCE_METHOD(arg0, arg1));
- }
-
- public static Localizable localizableNO_WEBRESOURCECLASS_IN_WEBXML() {
- return messageFactory.getMessage("no.webresourceclass.in.webxml");
- }
-
- /**
- * No "webresourceclass" specified in web.xml.
- *
- */
- public static String NO_WEBRESOURCECLASS_IN_WEBXML() {
- return localizer.localize(localizableNO_WEBRESOURCECLASS_IN_WEBXML());
- }
-
- public static Localizable localizableILLEGAL_CONFIG_SYNTAX() {
- return messageFactory.getMessage("illegal.config.syntax");
- }
-
- /**
- * Illegal configuration-file syntax.
- *
- */
- public static String ILLEGAL_CONFIG_SYNTAX() {
- return localizer.localize(localizableILLEGAL_CONFIG_SYNTAX());
- }
-
- public static Localizable localizableBAD_ACCEPT_FIELD(Object arg0) {
- return messageFactory.getMessage("bad.accept.field", arg0);
- }
-
- /**
- * The HTTP header field "Accept" with value "{0}" could not be parsed.
- *
- */
- public static String BAD_ACCEPT_FIELD(Object arg0) {
- return localizer.localize(localizableBAD_ACCEPT_FIELD(arg0));
- }
-
- public static Localizable localizableERROR_SUBRES_LOC_HAS_ENTITY_PARAM(Object arg0) {
- return messageFactory.getMessage("error.subres.loc.has.entity.param", arg0);
- }
-
- /**
- * A sub-resource locator, {0}, can not have an entity parameter. Try to move the parameter to the corresponding resource method.
- *
- */
- public static String ERROR_SUBRES_LOC_HAS_ENTITY_PARAM(Object arg0) {
- return localizer.localize(localizableERROR_SUBRES_LOC_HAS_ENTITY_PARAM(arg0));
- }
-
- public static Localizable localizableROOT_RES_NO_PUBLIC_CTOR(Object arg0) {
- return messageFactory.getMessage("root.res.no.public.ctor", arg0);
- }
-
- /**
- * A root resource, {0}, MUST have a public constructor
- *
- */
- public static String ROOT_RES_NO_PUBLIC_CTOR(Object arg0) {
- return localizer.localize(localizableROOT_RES_NO_PUBLIC_CTOR(arg0));
- }
-
- public static Localizable localizableRESOURCE_MIMETYPE_NOT_IN_PRODUCE_MIME(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("resource.mimetype.not.in.produceMime", arg0, arg1, arg2);
- }
-
- /**
- * {0}, is returning a MIME type, "{1}", that is acceptable but not a member of @ProduceMime, {2}.
- *
- */
- public static String RESOURCE_MIMETYPE_NOT_IN_PRODUCE_MIME(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableRESOURCE_MIMETYPE_NOT_IN_PRODUCE_MIME(arg0, arg1, arg2));
- }
-
- public static Localizable localizableBAD_CLASS_PRODUCEMIME(Object arg0, Object arg1) {
- return messageFactory.getMessage("bad.class.producemime", arg0, arg1);
- }
-
- /**
- * Web resource, "{0}": MIME types "{1}" of @ProcudeMime could not be processed on Web resource.
- *
- */
- public static String BAD_CLASS_PRODUCEMIME(Object arg0, Object arg1) {
- return localizer.localize(localizableBAD_CLASS_PRODUCEMIME(arg0, arg1));
- }
-
- public static Localizable localizableNON_PUB_RES_METHOD(Object arg0) {
- return messageFactory.getMessage("non.pub.res.method", arg0);
- }
-
- /**
- * A resource method, {0}, MUST be public scoped otherwise the method is ignored
- *
- */
- public static String NON_PUB_RES_METHOD(Object arg0) {
- return localizer.localize(localizableNON_PUB_RES_METHOD(arg0));
- }
-
- public static Localizable localizableBYTE_ARRAY_CANNOT_BE_NULL() {
- return messageFactory.getMessage("byte.array.cannot.be.null");
- }
-
- /**
- * data parameter, of type byte[], cannot be null.
- *
- */
- public static String BYTE_ARRAY_CANNOT_BE_NULL() {
- return localizer.localize(localizableBYTE_ARRAY_CANNOT_BE_NULL());
- }
-
- public static Localizable localizableBAD_METHOD_PRODUCEMIME(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("bad.method.producemime", arg0, arg1, arg2);
- }
-
- /**
- * Web resource, "{0}": MIME types "{1}" of @ProduceMime could not be processed on method "{2} of Web Resource.
- *
- */
- public static String BAD_METHOD_PRODUCEMIME(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableBAD_METHOD_PRODUCEMIME(arg0, arg1, arg2));
- }
-
- public static Localizable localizableNO_ROOT_RES_IN_RES_CFG() {
- return messageFactory.getMessage("no.root.res.in.res.cfg");
- }
-
- /**
- * The ResourceConfig instance does not contain any root resource classes.
- *
- */
- public static String NO_ROOT_RES_IN_RES_CFG() {
- return localizer.localize(localizableNO_ROOT_RES_IN_RES_CFG());
- }
-
- public static Localizable localizableBAD_METHOD_HTTPMETHOD(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("bad.method.httpmethod", arg0, arg1, arg2);
- }
-
- /**
- * Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource.
- *
- */
- public static String BAD_METHOD_HTTPMETHOD(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableBAD_METHOD_HTTPMETHOD(arg0, arg1, arg2));
- }
-
- public static Localizable localizableDEFAULT_COULD_NOT_PROCESS_CONSTRUCTOR(Object arg0, Object arg1) {
- return messageFactory.getMessage("default.could.not.process.constructor", arg0, arg1);
- }
-
- /**
- * Default value, {0} could not be processed by constructor {1}.
- *
- */
- public static String DEFAULT_COULD_NOT_PROCESS_CONSTRUCTOR(Object arg0, Object arg1) {
- return localizer.localize(localizableDEFAULT_COULD_NOT_PROCESS_CONSTRUCTOR(arg0, arg1));
- }
-
- public static Localizable localizableFATAL_ISSUES_FOUND_AT_RES_CLASS(Object arg0) {
- return messageFactory.getMessage("fatal.issues.found.at.res.class", arg0);
- }
-
- /**
- * Fatal issues found at class {0}. See logs for more details.
- *
- */
- public static String FATAL_ISSUES_FOUND_AT_RES_CLASS(Object arg0) {
- return localizer.localize(localizableFATAL_ISSUES_FOUND_AT_RES_CLASS(arg0));
- }
-
- public static Localizable localizablePROVIDER_NOT_FOUND(Object arg0) {
- return messageFactory.getMessage("provider.not.found", arg0);
- }
-
- /**
- * Provider {0} not found.
- *
- */
- public static String PROVIDER_NOT_FOUND(Object arg0) {
- return localizer.localize(localizablePROVIDER_NOT_FOUND(arg0));
- }
-
- public static Localizable localizableERROR_SUBRES_LOC_RETURNS_VOID(Object arg0) {
- return messageFactory.getMessage("error.subres.loc.returns.void", arg0);
- }
-
- /**
- * A sub-resource locator, {0}, MUST return a non-void type.
- *
- */
- public static String ERROR_SUBRES_LOC_RETURNS_VOID(Object arg0) {
- return localizer.localize(localizableERROR_SUBRES_LOC_RETURNS_VOID(arg0));
- }
-
- public static Localizable localizableEXCEPTION_INVOKING_RESOURCE_METHOD() {
- return messageFactory.getMessage("exception.invoking.resource.method");
- }
-
- /**
- * Exception invoking Web resource method.
- *
- */
- public static String EXCEPTION_INVOKING_RESOURCE_METHOD() {
- return localizer.localize(localizableEXCEPTION_INVOKING_RESOURCE_METHOD());
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/impl/SpiMessages.java b/plugins/com.sun.jersey.source/com/sun/jersey/impl/SpiMessages.java
deleted file mode 100644
index 978819d8915..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/impl/SpiMessages.java
+++ /dev/null
@@ -1,126 +0,0 @@
-
-package com.sun.jersey.impl;
-
-import com.sun.jersey.localization.Localizable;
-import com.sun.jersey.localization.LocalizableMessageFactory;
-import com.sun.jersey.localization.Localizer;
-
-
-/**
- * Defines string formatting method for each constant in the resource file
- *
- */
-public final class SpiMessages {
-
- private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.jersey.impl.spi");
- private final static Localizer localizer = new Localizer();
-
- public static Localizable localizableILLEGAL_CONFIG_SYNTAX() {
- return messageFactory.getMessage("illegal.config.syntax");
- }
-
- /**
- * Illegal configuration-file syntax.
- *
- */
- public static String ILLEGAL_CONFIG_SYNTAX() {
- return localizer.localize(localizableILLEGAL_CONFIG_SYNTAX());
- }
-
- public static Localizable localizablePROVIDER_COULD_NOT_BE_CREATED(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("provider.could.not.be.created", arg0, arg1, arg2);
- }
-
- /**
- * The class {0} implementing provider {1} could not be instantiated: {2}
- *
- */
- public static String PROVIDER_COULD_NOT_BE_CREATED(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizablePROVIDER_COULD_NOT_BE_CREATED(arg0, arg1, arg2));
- }
-
- public static Localizable localizableTEMPLATE_NAME_TO_VALUE_NOT_NULL() {
- return messageFactory.getMessage("template.name.to.value.not.null");
- }
-
- /**
- * Template name to value map cannot be null.
- *
- */
- public static String TEMPLATE_NAME_TO_VALUE_NOT_NULL() {
- return localizer.localize(localizableTEMPLATE_NAME_TO_VALUE_NOT_NULL());
- }
-
- public static Localizable localizableILLEGAL_PROVIDER_CLASS_NAME(Object arg0) {
- return messageFactory.getMessage("illegal.provider.class.name", arg0);
- }
-
- /**
- * Illegal provider-class name: {0}.
- *
- */
- public static String ILLEGAL_PROVIDER_CLASS_NAME(Object arg0) {
- return localizer.localize(localizableILLEGAL_PROVIDER_CLASS_NAME(arg0));
- }
-
- public static Localizable localizableDEPENDENT_CLASS_OF_PROVIDER_FORMAT_ERROR(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("dependent.class.of.provider.format.error", arg0, arg1, arg2);
- }
-
- /**
- * {0}. A dependent class of the class {1} implementing the provider {2} is malformed. The provider implementation is ignored. Check if the malformed class is part of a stubbed jar that used for compiling only.
- *
- */
- public static String DEPENDENT_CLASS_OF_PROVIDER_FORMAT_ERROR(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableDEPENDENT_CLASS_OF_PROVIDER_FORMAT_ERROR(arg0, arg1, arg2));
- }
-
- public static Localizable localizableDEPENDENT_CLASS_OF_PROVIDER_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("dependent.class.of.provider.not.found", arg0, arg1, arg2);
- }
-
- /**
- * A dependent class, {0}, of the class {1} implementing the provider {2} is not found. The provider implementation is ignored.
- *
- */
- public static String DEPENDENT_CLASS_OF_PROVIDER_NOT_FOUND(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizableDEPENDENT_CLASS_OF_PROVIDER_NOT_FOUND(arg0, arg1, arg2));
- }
-
- public static Localizable localizableURITEMPLATE_CANNOT_BE_NULL() {
- return messageFactory.getMessage("uritemplate.cannot.be.null");
- }
-
- /**
- * URI template cannot be null.
- *
- */
- public static String URITEMPLATE_CANNOT_BE_NULL() {
- return localizer.localize(localizableURITEMPLATE_CANNOT_BE_NULL());
- }
-
- public static Localizable localizablePROVIDER_NOT_FOUND(Object arg0, Object arg1) {
- return messageFactory.getMessage("provider.not.found", arg0, arg1);
- }
-
- /**
- * The class {0} implementing the provider {1} is not found. The provider implementation is ignored.
- *
- */
- public static String PROVIDER_NOT_FOUND(Object arg0, Object arg1) {
- return localizer.localize(localizablePROVIDER_NOT_FOUND(arg0, arg1));
- }
-
- public static Localizable localizablePROVIDER_CLASS_COULD_NOT_BE_LOADED(Object arg0, Object arg1, Object arg2) {
- return messageFactory.getMessage("provider.class.could.not.be.loaded", arg0, arg1, arg2);
- }
-
- /**
- * The class {0} implementing provider {1} could not be loaded: {2}
- *
- */
- public static String PROVIDER_CLASS_COULD_NOT_BE_LOADED(Object arg0, Object arg1, Object arg2) {
- return localizer.localize(localizablePROVIDER_CLASS_COULD_NOT_BE_LOADED(arg0, arg1, arg2));
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/impl/api.properties b/plugins/com.sun.jersey.source/com/sun/jersey/impl/api.properties
deleted file mode 100644
index db08112d0a9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/impl/api.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-#
-# Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
-#
-# The contents of this file are subject to the terms of either the GNU
-# General Public License Version 2 only ("GPL") or the Common Development
-# and Distribution License("CDDL") (collectively, the "License"). You
-# may not use this file except in compliance with the License. You can
-# obtain a copy of the License at
-# http://glassfish.java.net/public/CDDL+GPL_1_1.html
-# or packager/legal/LICENSE.txt. See the License for the specific
-# language governing permissions and limitations under the License.
-#
-# When distributing the software, include this License Header Notice in each
-# file and include the License file at packager/legal/LICENSE.txt.
-#
-# GPL Classpath Exception:
-# Oracle designates this particular file as subject to the "Classpath"
-# exception as provided by Oracle in the GPL Version 2 section of the License
-# file that accompanied this code.
-#
-# Modifications:
-# If applicable, add the following below the License Header, with the fields
-# enclosed by brackets [] replaced by your own identifying information:
-# "Portions Copyright [year] [name of copyright owner]"
-#
-# Contributor(s):
-# If you wish your version of this file to be governed by only the CDDL or
-# only the GPL Version 2, indicate your decision by adding "[Contributor]
-# elects to include this software in this distribution under the [CDDL or GPL
-# Version 2] license." If you don't indicate a single choice of license, a
-# recipient has the option to distribute your version of this file under
-# either the CDDL, the GPL Version 2 or to extend the choice of license to
-# its licensees as provided above. However, if you add GPL Version 2 code
-# and therefore, elected the GPL Version 2 license, then the option applies
-# only if the new code is made subject to such option by the copyright
-# holder.
-#
-
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/impl/impl.properties b/plugins/com.sun.jersey.source/com/sun/jersey/impl/impl.properties
deleted file mode 100644
index 2ecf85a841a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/impl/impl.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-error.marshalling.jaxb=Error marshalling JAXB object of type "{0}".
-error.unmarshalling.jaxb=Error unmarshalling JAXB object of type "{0}".
-unable.to.write.mimemultipart=Unable to write MimeMultipart content.
-resource.method=Resource, {0}, with method, {1}
-resource.not.acceptable={0}, is returning a MIME type, "{1}", that is not acceptable.
-resource.mimetype.not.in.produceMime={0}, is returning a MIME type, "{1}", that is acceptable but not a member of @ProduceMime, {2}.
-nested.error=NESTED ERROR: {0}.
-failed.to.create.web.resource=Failed to create Web resource: {0}.
-default.could.not.process.method=Default value, {0} could not be processed by method {1}.
-default.could.not.process.constructor=Default value, {0} could not be processed by constructor {1}.
-exception.invoking.resource.method=Exception invoking Web resource method.
-illegal.initial.capacity=Illegal initial capacity: {0}.
-illegal.load.factor=Illegal load factor: {0}.
-error.processing.method=Error processing resource method, {0}, for ResourceMethodDispatchProvider, {1}.
-generic.type.not.supported=Generic type, {0}, not support for parameter {1}.
-not.valid.httpmethod=Method, {0}, annotated with {1} of resource, {2}, is not recognized as valid resource method.
-not.valid.dynamicresolvingmethod=Method, {0}, annotated with URI template {1} of resource, {2}, is not recognized as valid Java method annotated with @Path.
-quality.more.than.three=Quality value "{0}" has more than 3 digits after the decimal point.
-quality.greater.than.one=Quality value "{0}" is greater than 1.
-object.not.a.webResource=Object, "{0}": is not a Web resource since it is not annotated with @Path.
-bad.uritemplate=Web resource, "{0}": URI template "{1}" of @Path could not be processed on Web resource.
-bad.class.consumemime=Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on Web resource.
-bad.class.producemime=Web resource, "{0}": MIME types "{1}" of @ProcudeMime could not be processed on Web resource.
-bad.method.httpmethod=Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource.
-bad.consumemime=Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource.
-bad.method.consumemime=Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on method "{2} of Web Resource.
-bad.method.producemime=Web resource, "{0}": MIME types "{1}" of @ProduceMime could not be processed on method "{2} of Web Resource.
-illegal.config.syntax=Illegal configuration-file syntax.
-illegal.provider.class.name=Illegal provider-class name: {0}.
-provider.not.found=Provider {0} not found.
-provider.could.not.be.created=Provider {0} could not be instantiated: {1}
-no.webresourceclass.in.webxml=No "webresourceclass" specified in web.xml.
-byte.array.cannot.be.null=data parameter, of type byte[], cannot be null.
-bad.content.type=The HTTP header field "Content-Type" with value "{0}" could not be parsed.
-bad.mime.type=The MIME type of the representation with value "{0}" could not be parsed.
-bad.accept.field=The HTTP header field "Accept" with value "{0}" could not be parsed.
-error.no.sub.res.method.locator.found=A resource class, {0}, does not have any resource method, sub-resource method, or sub-resource locator.
-error.res.uri.path.required=A root resource class, {0}, MUST have a URI path.
-error.res.uri.path.invalid=A root resource class, {0}, has an invalid URI path: {1}.
-error.subres.loc.uri.path.invalid=A sub-resource locator, {0}, has an invalid URI path: {1}
-error.subres.loc.has.entity.param=A sub-resource locator, {0}, can not have an entity parameter. Try to move the parameter to the corresponding resource method.
-error.subres.method.uri.path.invalid=A sub-resource method, {0}, has an invalid URI path: {1}
-error.get.returns.void=A HTTP GET method, {0}, MUST return a non-void type.
-error.get.consumes.entity=A HTTP GET method, {0}, should not consume any entity.
-error.subres.loc.returns.void=A sub-resource locator, {0}, MUST return a non-void type.
-new.ar.created.by.introspection.modeler=A new abstract resource created by IntrospectionModeler: {0}
-ambiguous.parameter=Parameter {1} of {0} MUST be only one of a path, query, matrix or header parameter.
-non.pub.res.method=A resource method, {0}, MUST be public scoped otherwise the method is ignored
-non.pub.sub.res.method=A sub-resource method, {0}, MUST be public scoped otherwise the method is ignored
-non.pub.sub.res.loc=A sub-resource locator, {0}, MUST be public scoped otherwise the method is ignored
-fatal.issues.found.at.res.class=Fatal issues found at class {0}. See logs for more details.
-web.app.already.initiated=Web application is already initiated.
-no.root.res.in.res.cfg=The ResourceConfig instance does not contain any root resource classes.
-root.res.no.public.ctor=A root resource, {0}, MUST have a public constructor
-ambiguous.ctors=A root resource, {0}, has ambiguous constructors to use for initialization
-ambiguous.srls=A resource, {0}, has ambiguous sub-resource locator for URI template {1}, which matches with template {2}
-ambiguous.rms.in=A resource, {0}, has ambiguous resource method for HTTP method {1} and input mime-type: {2}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {3} and {4}) are {5} and {6}. This could cause an error for conflicting output types!
-ambiguous.rms.out=A resource, {0}, has ambiguous resource method for HTTP method {1} and output mime-type: {2}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {3} and {4}) are {5} and {6}
-ambiguous.srms.in=A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and input mime-type: {3}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {4} and {5}) are {6} and {7}. This could cause an error for conflicting output types!
-ambiguous.srms.out=A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and output mime-type: {3}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {4} and {5}) are {6} and {7}
-multiple.http.method.designators=A (sub-)resource method, {0}, should have only one HTTP method designator. It currently has the following designators defined: {1}
-ambiguous.rr.path=A root resource, {0}, has a non-unique URI template {1}
-sub.res.method.treated.as.res.method=A sub-resource method, {0}, with URI template, "{1}", is treated as a resource method \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/impl/spi.properties b/plugins/com.sun.jersey.source/com/sun/jersey/impl/spi.properties
deleted file mode 100644
index f604f53b436..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/impl/spi.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-uritemplate.cannot.be.null=URI template cannot be null.
-template.name.to.value.not.null=Template name to value map cannot be null.
-illegal.config.syntax=Illegal configuration-file syntax.
-illegal.provider.class.name=Illegal provider-class name: {0}.
-provider.could.not.be.created=The class {0} implementing provider {1} could not be instantiated: {2}
-provider.class.could.not.be.loaded=The class {0} implementing provider {1} could not be loaded: {2}
-provider.not.found=The class {0} implementing the provider {1} is not found. The provider implementation is ignored.
-dependent.class.of.provider.not.found=A dependent class, {0}, of the class {1} implementing the provider {2} is not found. The provider implementation is ignored.
-dependent.class.of.provider.format.error={0}. A dependent class of the class {1} implementing the provider {2} is malformed. The provider implementation is ignored. Check if the malformed class is part of a stubbed jar that used for compiling only. \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONMarshaller.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONMarshaller.java
deleted file mode 100644
index 13dfab25716..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONMarshaller.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl;
-
-import com.sun.jersey.api.json.JSONConfigurated;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.api.json.JSONMarshaller;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.PropertyException;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.Charset;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class BaseJSONMarshaller implements JSONMarshaller, JSONConfigurated {
-
- private static final Charset UTF8 = Charset.forName("UTF-8");
-
- protected final Marshaller jaxbMarshaller;
-
- protected JSONConfiguration jsonConfig;
-
- public BaseJSONMarshaller(JAXBContext jaxbContext, JSONConfiguration jsonConfig) throws JAXBException {
- this(jaxbContext.createMarshaller(), jsonConfig);
- }
-
- public BaseJSONMarshaller(Marshaller jaxbMarshaller, JSONConfiguration jsonConfig) {
- this.jsonConfig = jsonConfig;
- this.jaxbMarshaller = jaxbMarshaller;
- }
-
- // JSONConfigurated
-
- public JSONConfiguration getJSONConfiguration() {
- return jsonConfig;
- }
-
- // JSONMarshaller
-
- public void marshallToJSON(Object o, OutputStream outputStream) throws JAXBException {
- if (outputStream == null) {
- throw new IllegalArgumentException("The output stream is null");
- }
-
- marshallToJSON(o, new OutputStreamWriter(outputStream, UTF8));
- }
-
- public void marshallToJSON(Object o, Writer writer) throws JAXBException {
- if (o == null) {
- throw new IllegalArgumentException("The JAXB element is null");
- }
-
- if (writer == null) {
- throw new IllegalArgumentException("The writer is null");
- }
-
- jaxbMarshaller.marshal(o, getXMLStreamWrtier(writer));
- }
-
- private XMLStreamWriter getXMLStreamWrtier(Writer writer) throws JAXBException {
- try {
- return Stax2JsonFactory.createWriter(writer, jsonConfig);
- } catch (IOException ex) {
- throw new JAXBException(ex);
- }
- }
-
- public void setProperty(String key, Object value) throws PropertyException {
- // do nothing
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONUnmarshaller.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONUnmarshaller.java
deleted file mode 100644
index c06f27d5be1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BaseJSONUnmarshaller.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl;
-
-import com.sun.jersey.api.json.JSONConfigurated;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.api.json.JSONUnmarshaller;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class BaseJSONUnmarshaller implements JSONUnmarshaller, JSONConfigurated {
-
- private static final Charset UTF8 = Charset.forName("UTF-8");
-
- protected final Unmarshaller jaxbUnmarshaller;
-
- protected final JSONConfiguration jsonConfig;
-
-
- public BaseJSONUnmarshaller(JAXBContext jaxbContext, JSONConfiguration jsonConfig) throws JAXBException {
- this(jaxbContext.createUnmarshaller(), jsonConfig);
- }
-
- public BaseJSONUnmarshaller(Unmarshaller jaxbUnmarshaller, JSONConfiguration jsonConfig) {
- this.jaxbUnmarshaller = jaxbUnmarshaller;
- this.jsonConfig = jsonConfig;
- }
-
-
- // JSONConfigurated
-
- public JSONConfiguration getJSONConfiguration() {
- return jsonConfig;
- }
-
-
- // JSONUnmarshaller
-
- public <T> T unmarshalFromJSON(InputStream inputStream, Class<T> expectedType) throws JAXBException {
- return unmarshalFromJSON(new InputStreamReader(inputStream, UTF8), expectedType);
- }
-
- public <T> T unmarshalFromJSON(Reader reader, Class<T> expectedType) throws JAXBException {
- if (jsonConfig.isRootUnwrapping() || !expectedType.isAnnotationPresent(XmlRootElement.class)) {
- return unmarshalJAXBElementFromJSON(reader, expectedType).getValue();
- } else {
- return (T) jaxbUnmarshaller.unmarshal(createXmlStreamReader(reader, expectedType));
- }
- }
-
- public <T> JAXBElement<T> unmarshalJAXBElementFromJSON(InputStream inputStream, Class<T> declaredType) throws JAXBException {
- return unmarshalJAXBElementFromJSON(new InputStreamReader(inputStream, UTF8), declaredType);
- }
-
- public <T> JAXBElement<T> unmarshalJAXBElementFromJSON(Reader reader, Class<T> declaredType) throws JAXBException {
- return jaxbUnmarshaller.unmarshal(createXmlStreamReader(reader, declaredType), declaredType);
- }
-
- private XMLStreamReader createXmlStreamReader(Reader reader, Class expectedType) throws JAXBException {
- try {
- return Stax2JsonFactory.createReader(reader, jsonConfig,
- jsonConfig.isRootUnwrapping() ? JSONHelper.getRootElementName(expectedType) : null);
- } catch (XMLStreamException ex) {
- throw new UnmarshalException("Error creating JSON-based XMLStreamReader", ex);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BufferingInputOutputStream.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BufferingInputOutputStream.java
deleted file mode 100644
index 07094c1af1b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/BufferingInputOutputStream.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.LinkedList;
-import java.util.Queue;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class BufferingInputOutputStream extends OutputStream {
-
- private final Queue<byte[]> buffers = new LinkedList<byte[]>();
-
- @Override
- public void write(int b) throws IOException {
- byte[] buffer = new byte[1];
- buffer[0] = (byte) b;
- buffers.add(buffer);
- }
-
- @Override
- public void write(byte[] b) throws IOException {
- buffers.add(b);
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- if (len > 0) {
- byte[] buffer = new byte[len];
- System.arraycopy(b, off, buffer, 0, len);
- buffers.add(buffer);
- }
- }
-
- public byte[] nextBytes() {
- return buffers.poll();
- }
-
- public int available() {
- if (buffers.isEmpty()) {
- return 0;
- } else {
- return buffers.peek().length;
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/FilteringInputStream.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/FilteringInputStream.java
deleted file mode 100644
index 22cf2668be0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/FilteringInputStream.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public abstract class FilteringInputStream extends InputStream {
-
- private byte[] currentBuffer;
- private int cursor;
-
- protected abstract byte[] nextBytes() throws IOException;
-
-
- @Override
- public int available() throws IOException {
-
- if (currentBuffer == null) {
- return 0;
- }
-
- return currentBuffer.length - cursor;
- }
-
-
- @Override
- public synchronized void mark(int readlimit) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean markSupported() {
- return false;
- }
-
-
- private void getNextBytesIfNothingAvailable() throws IOException {
- if (available() < 1) {
- currentBuffer = nextBytes();
- cursor = 0;
- }
-
- }
-
-
- public int read() throws IOException {
-
- getNextBytesIfNothingAvailable();
-
- if((currentBuffer == null) || (currentBuffer.length == 0)) {
- return -1;
- }
-
- return currentBuffer[cursor++];
- }
-
-
- @Override
- public int read(byte[] b) throws IOException {
- return this.read(b, 0, b.length);
- }
-
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
-
- getNextBytesIfNothingAvailable();
-
- if (currentBuffer == null) {
- return -1;
- }
-
- int availableBytes = currentBuffer.length - cursor;
-
- if (len >= availableBytes) {
- System.arraycopy(currentBuffer, cursor, b, off, availableBytes);
- currentBuffer = null;
- return availableBytes;
- } else {
- System.arraycopy(currentBuffer, cursor, b, off, len);
- cursor += len;
- return len;
- }
- }
-
-
- @Override
- public synchronized void reset() throws IOException {
- throw new IOException();
- }
-
- @Override
- public long skip(long n) throws IOException {
- return super.skip(n);
- }
-
- @Override
- public String toString() {
- return super.toString();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/ImplMessages.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/ImplMessages.java
deleted file mode 100644
index 92fa7000a85..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/ImplMessages.java
+++ /dev/null
@@ -1,114 +0,0 @@
-
-package com.sun.jersey.json.impl;
-
-import com.sun.jersey.localization.Localizable;
-import com.sun.jersey.localization.LocalizableMessageFactory;
-import com.sun.jersey.localization.Localizer;
-
-
-/**
- * Defines string formatting method for each constant in the resource file
- *
- */
-public final class ImplMessages {
-
- private final static LocalizableMessageFactory messageFactory = new LocalizableMessageFactory("com.sun.jersey.json.impl.impl");
- private final static Localizer localizer = new Localizer();
-
- public static Localizable localizableERROR_JAXB_RI_2_1_12_MISSING() {
- return messageFactory.getMessage("error.jaxb.ri.2.1.12.missing");
- }
-
- /**
- * NATURAL JSON notation configured, but at least JAXB RI 2.1.12 is needed when XML attributes are in use. Please add jaxb-impl-2.1.12 to your classpath!
- *
- */
- public static String ERROR_JAXB_RI_2_1_12_MISSING() {
- return localizer.localize(localizableERROR_JAXB_RI_2_1_12_MISSING());
- }
-
- public static Localizable localizableERROR_WRITING_JSON_ARRAY() {
- return messageFactory.getMessage("error.writing.json.array");
- }
-
- /**
- * Error writing JSON array.
- *
- */
- public static String ERROR_WRITING_JSON_ARRAY() {
- return localizer.localize(localizableERROR_WRITING_JSON_ARRAY());
- }
-
- public static Localizable localizableERROR_JAXB_RI_2_1_10_MISSING() {
- return messageFactory.getMessage("error.jaxb.ri.2.1.10.missing");
- }
-
- /**
- * NATURAL JSON notation configured, but JAXB RI 2.1.10 not found. For the recent builds to get this working correctly, you need even at least JAXB version 2.1.12. Please add it to your classpath!
- *
- */
- public static String ERROR_JAXB_RI_2_1_10_MISSING() {
- return localizer.localize(localizableERROR_JAXB_RI_2_1_10_MISSING());
- }
-
- public static Localizable localizableERROR_WRITING_JSON_OBJECT() {
- return messageFactory.getMessage("error.writing.json.object");
- }
-
- /**
- * Error writing JSON object.
- *
- */
- public static String ERROR_WRITING_JSON_OBJECT() {
- return localizer.localize(localizableERROR_WRITING_JSON_OBJECT());
- }
-
- public static Localizable localizableERROR_PARSING_JSON_ARRAY() {
- return messageFactory.getMessage("error.parsing.json.array");
- }
-
- /**
- * Error parsing JSON array.
- *
- */
- public static String ERROR_PARSING_JSON_ARRAY() {
- return localizer.localize(localizableERROR_PARSING_JSON_ARRAY());
- }
-
- public static Localizable localizableERROR_PARSING_JSON_OBJECT() {
- return messageFactory.getMessage("error.parsing.json.object");
- }
-
- /**
- * Error parsing JSON object.
- *
- */
- public static String ERROR_PARSING_JSON_OBJECT() {
- return localizer.localize(localizableERROR_PARSING_JSON_OBJECT());
- }
-
- public static Localizable localizableERROR_JSONP_MSG_BODY_WRITER_NOT_FOUND(Object arg0, Object arg1) {
- return messageFactory.getMessage("error.jsonp.msg.body.writer.not.found", arg0, arg1);
- }
-
- /**
- * A message body writer for Java type, {0}, and MIME media type, {1}, was not found.
- *
- */
- public static String ERROR_JSONP_MSG_BODY_WRITER_NOT_FOUND(Object arg0, Object arg1) {
- return localizer.localize(localizableERROR_JSONP_MSG_BODY_WRITER_NOT_FOUND(arg0, arg1));
- }
-
- public static Localizable localizableERROR_NONGE_JSONP_MSG_BODY_WRITER_NOT_FOUND(Object arg0, Object arg1) {
- return messageFactory.getMessage("error.nonge.jsonp.msg.body.writer.not.found", arg0, arg1);
- }
-
- /**
- * A message body writer for Java type, {0}, and MIME media type, {1}, was not found. If you want to serialize a parametrized type, you might want to use GenericEntity
- *
- */
- public static String ERROR_NONGE_JSONP_MSG_BODY_WRITER_NOT_FOUND(Object arg0, Object arg1) {
- return localizer.localize(localizableERROR_NONGE_JSONP_MSG_BODY_WRITER_NOT_FOUND(arg0, arg1));
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONHelper.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONHelper.java
deleted file mode 100644
index 39b96f4b013..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONHelper.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- *
- * @author japod
- */
-public final class JSONHelper {
-
- // just to make clear no instances are meant to be created
- private JSONHelper() {
- }
-
- /**
- * calculating local name of an appropriate XML element,
- * pretty much the same way as it is done by JAXB 2.1 impl
- * (for situations when we want to pretend the element was present
- * in an incoming stream amd all we have is the type information)
- * TODO: work out with JAXB guys a better way of doing it,
- * probably we could take it from an existing JAXBContext?
- */
- public static final String getRootElementName(Class<Object> clazz) {
- XmlRootElement e = clazz.getAnnotation(XmlRootElement.class);
- if (e == null) {
- return getVariableName(clazz.getSimpleName());
- }
- if ("##default".equals(e.name())) {
- return getVariableName(clazz.getSimpleName());
- } else {
- return e.name();
- }
- }
-
-
- private static final String getVariableName(String baseName) {
- return NameUtil.toMixedCaseName(NameUtil.toWordList(baseName), false);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONMarshallerImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONMarshallerImpl.java
deleted file mode 100644
index 9db410d1c4b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONMarshallerImpl.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.api.json.JSONMarshaller;
-import org.w3c.dom.Node;
-import org.xml.sax.ContentHandler;
-
-import javax.xml.bind.*;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentMarshaller;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.Result;
-import javax.xml.validation.Schema;
-import java.io.File;
-import java.io.OutputStream;
-import java.io.Writer;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public final class JSONMarshallerImpl extends BaseJSONMarshaller implements Marshaller {
-
- public JSONMarshallerImpl(JAXBContext jaxbContext, JSONConfiguration jsonConfig) throws JAXBException {
- super(jaxbContext, jsonConfig);
- }
-
- // Marshaller
- public void marshal(Object jaxbObject, Result result) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, result);
- }
-
- public void marshal(Object jaxbObject, OutputStream os) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, os);
- }
-
- public void marshal(Object jaxbObject, File file) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, file);
- }
-
- public void marshal(Object jaxbObject, Writer writer) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, writer);
- }
-
- public void marshal(Object jaxbObject, ContentHandler handler) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, handler);
- }
-
- public void marshal(Object jaxbObject, Node node) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, node);
- }
-
- public void marshal(Object jaxbObject, XMLStreamWriter writer) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, writer);
- }
-
- public void marshal(Object jaxbObject, XMLEventWriter writer) throws JAXBException {
- jaxbMarshaller.marshal(jaxbObject, writer);
- }
-
- public Node getNode(Object jaxbObject) throws JAXBException {
- return jaxbMarshaller.getNode(jaxbObject);
- }
-
- public void setProperty(String name, Object value) throws PropertyException {
- if(name == null)
- throw new IllegalArgumentException("Name can't be null.");
-
- if(name.equals(JSONMarshaller.FORMATTED)) {
- if(!(value instanceof Boolean)) {
- throw new PropertyException("property " + name + " must be an instance of type " +
- "boolean, not " + value.getClass().getName());
- }
-
- jsonConfig = JSONConfiguration.createJSONConfigurationWithFormatted(jsonConfig, (Boolean)value);
- } else {
- jaxbMarshaller.setProperty(name, value);
- }
- }
-
- public Object getProperty(String key) throws PropertyException {
- return jaxbMarshaller.getProperty(key);
- }
-
- public void setEventHandler(ValidationEventHandler handler) throws JAXBException {
- jaxbMarshaller.setEventHandler(handler);
- }
-
- public ValidationEventHandler getEventHandler() throws JAXBException {
- return jaxbMarshaller.getEventHandler();
- }
-
- public void setAdapter(XmlAdapter adapter) {
- jaxbMarshaller.setAdapter(adapter);
- }
-
- public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
- jaxbMarshaller.setAdapter(type, adapter);
- }
-
- public <A extends XmlAdapter> A getAdapter(Class<A> type) {
- return jaxbMarshaller.getAdapter(type);
- }
-
- public void setAttachmentMarshaller(AttachmentMarshaller marshaller) {
- jaxbMarshaller.setAttachmentMarshaller(marshaller);
- }
-
- public AttachmentMarshaller getAttachmentMarshaller() {
- return jaxbMarshaller.getAttachmentMarshaller();
- }
-
- public void setSchema(Schema schema) {
- jaxbMarshaller.setSchema(schema);
- }
-
- public Schema getSchema() {
- return jaxbMarshaller.getSchema();
- }
-
- public void setListener(Listener listener) {
- jaxbMarshaller.setListener(listener);
- }
-
- public Listener getListener() {
- return jaxbMarshaller.getListener();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONTransformer.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONTransformer.java
deleted file mode 100644
index e7c001f5f29..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONTransformer.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-/**
- *
- * @author ps23762
- */
-final class JSONTransformer {
- @SuppressWarnings("unchecked")
- static <T> Map<String, T> asMap(String jsonObjectVal) throws JSONException {
- if (null == jsonObjectVal) {
- return null;
- }
- Map<String, T> result = new HashMap<String, T>();
-
- JSONObject sourceMap = new JSONObject(jsonObjectVal);
- Iterator<String> keyIterator = sourceMap.keys();
- while (keyIterator.hasNext()) {
- String key = keyIterator.next();
- result.put(key, (T)sourceMap.get(key));
- }
- return result;
- }
-
-
- @SuppressWarnings("unchecked")
- static <T> Collection<T> asCollection(String jsonArrayVal) throws JSONException {
- if (null == jsonArrayVal) {
- return null;
- }
- Collection<T> result = new LinkedList<T>();
-
- JSONArray arrayVal = new JSONArray(jsonArrayVal);
- for (int i = 0; i < arrayVal.length(); i++) {
- result.add((T)arrayVal.get(i));
- }
- return result;
- }
-
- static String asJsonArray(Collection<? extends Object> collection) {
- return (null == collection) ? "[]" : (new JSONArray(collection)).toString();
- }
-
- static String asJsonObject(Map map) {
- return (null == map) ? "{}" : (new JSONObject(map)).toString();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONUnmarshallerImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONUnmarshallerImpl.java
deleted file mode 100644
index f49231c9bb9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JSONUnmarshallerImpl.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URL;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.PropertyException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.UnmarshallerHandler;
-import javax.xml.bind.ValidationEventHandler;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-import javax.xml.bind.attachment.AttachmentUnmarshaller;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.Source;
-import javax.xml.validation.Schema;
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class JSONUnmarshallerImpl extends BaseJSONUnmarshaller implements Unmarshaller {
-
- public JSONUnmarshallerImpl(JAXBContext jaxbContext, JSONConfiguration jsonConfig) throws JAXBException {
- super (jaxbContext, jsonConfig);
- }
-
- // Unmarshaller
-
- public Object unmarshal(File file) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(file);
- }
-
- public Object unmarshal(InputStream inputStream) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(inputStream);
- }
-
- public Object unmarshal(Reader reader) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(reader);
- }
-
- public Object unmarshal(URL url) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(url);
- }
-
- public Object unmarshal(InputSource inputSource) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(inputSource);
- }
-
- public Object unmarshal(Node node) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(node);
- }
-
- public <T> JAXBElement<T> unmarshal(Node node, Class<T> type) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(node, type);
- }
-
- public Object unmarshal(Source source) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(source);
- }
-
- public <T> JAXBElement<T> unmarshal(Source source, Class<T> type) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(source, type);
- }
-
- public Object unmarshal(XMLStreamReader xmlStreamReader) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(xmlStreamReader);
- }
-
- public <T> JAXBElement<T> unmarshal(XMLStreamReader xmlStreamReader, Class<T> type) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(xmlStreamReader, type);
- }
-
- public Object unmarshal(XMLEventReader xmlEventReader) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(xmlEventReader);
- }
-
- public <T> JAXBElement<T> unmarshal(XMLEventReader xmlEventReader, Class<T> type) throws JAXBException {
- return this.jaxbUnmarshaller.unmarshal(xmlEventReader, type);
- }
-
- public UnmarshallerHandler getUnmarshallerHandler() {
- return this.jaxbUnmarshaller.getUnmarshallerHandler();
- }
-
- public void setValidating(boolean validating) throws JAXBException {
- this.jaxbUnmarshaller.setValidating(validating);
- }
-
- public boolean isValidating() throws JAXBException {
- return this.jaxbUnmarshaller.isValidating();
- }
-
- public void setEventHandler(ValidationEventHandler validationEventHandler) throws JAXBException {
- this.jaxbUnmarshaller.setEventHandler(validationEventHandler);
- }
-
- public ValidationEventHandler getEventHandler() throws JAXBException {
- return this.jaxbUnmarshaller.getEventHandler();
- }
-
- public void setProperty(String key, Object value) throws PropertyException {
- this.jaxbUnmarshaller.setProperty(key, value);
- }
-
- public Object getProperty(String key) throws PropertyException {
- return this.jaxbUnmarshaller.getProperty(key);
- }
-
- public void setSchema(Schema schema) {
- this.jaxbUnmarshaller.setSchema(schema);
- }
-
- public Schema getSchema() {
- return this.jaxbUnmarshaller.getSchema();
- }
-
- public void setAdapter(XmlAdapter xmlAdapter) {
- this.jaxbUnmarshaller.setAdapter(xmlAdapter);
- }
-
- public <A extends XmlAdapter> void setAdapter(Class<A> type, A adapter) {
- this.jaxbUnmarshaller.setAdapter(type, adapter);
- }
-
- public <A extends XmlAdapter> A getAdapter(Class<A> type) {
- return this.jaxbUnmarshaller.getAdapter(type);
- }
-
- public void setAttachmentUnmarshaller(AttachmentUnmarshaller attachmentUnmarshaller) {
- this.jaxbUnmarshaller.setAttachmentUnmarshaller(attachmentUnmarshaller);
- }
-
- public AttachmentUnmarshaller getAttachmentUnmarshaller() {
- return this.jaxbUnmarshaller.getAttachmentUnmarshaller();
- }
-
- public void setListener(Listener listener) {
- this.jaxbUnmarshaller.setListener(listener);
- }
-
- public Listener getListener() {
- return this.jaxbUnmarshaller.getListener();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.java
deleted file mode 100644
index 37edb4efdc6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import org.codehaus.jackson.JsonEncoding;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonToken;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class JsonRootEatingInputStreamFilter extends FilteringInputStream {
-
- private JsonParser jsonParser;
- private JsonGenerator jsonGenerator;
- private int depth;
- private BufferingInputOutputStream buffers;
-
- public JsonRootEatingInputStreamFilter(InputStream inputStream) throws IOException {
- JsonFactory jsonFactory = new JsonFactory();
- this.jsonParser = jsonFactory.createJsonParser(inputStream);
- this.buffers = new BufferingInputOutputStream();
- this.jsonGenerator = jsonFactory.createJsonGenerator(this.buffers, JsonEncoding.UTF8);
- this.depth = 0;
- }
-
- protected byte[] nextBytes() throws IOException {
- if (!jsonParser.hasCurrentToken()) {
- jsonParser.nextToken();
- }
-
- final JsonToken token = jsonParser.getCurrentToken();
-
- if ((depth == 0) && (token == JsonToken.START_OBJECT)) {
- jsonParser.nextToken();
- return nextBytes();
- }
-
- if ((depth == 0) && (token == JsonToken.FIELD_NAME)) {
- depth++;
- jsonParser.nextToken();
- return nextBytes();
- }
-
- if ((depth == 1) && ((token == JsonToken.END_OBJECT) || (token == JsonToken.END_ARRAY))) {
- jsonParser.nextToken();
- return null;
- }
-
- jsonGenerator.copyCurrentEvent(jsonParser);
- jsonGenerator.flush();
- jsonParser.nextToken();
-
- if ((token == JsonToken.START_ARRAY) || (token == JsonToken.START_OBJECT)) {
- depth++;
- } else if ((token == JsonToken.END_ARRAY) || (token == JsonToken.END_OBJECT)) {
- depth--;
- }
-
- return buffers.nextBytes();
- }
-
- @Override
- public int available() throws IOException {
- return super.available()/* + buffers.available()*/;
- }
-
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/NameUtil.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/NameUtil.java
deleted file mode 100644
index cb7920e54fc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/NameUtil.java
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-
-/**
- * Methods that convert strings into various formats.
- *
- * <p>
- * What JAX-RPC name binding tells us is that even such basic method
- * like "isLetter" can be different depending on the situation.
- *
- * For this reason, a whole lot of methods are made non-static,
- * even though they look like they should be static.
- */
-class NameUtil {
-
- protected static boolean isPunct(char c) {
- return c == '-' || c == '.' || c == ':' || c == '_' || c == '\u00b7' || c == '\u0387' || c == '\u06dd' || c == '\u06de';
- }
-
- protected static boolean isDigit(char c) {
- return c >= '0' && c <= '9' || Character.isDigit(c);
- }
-
- protected static boolean isUpper(char c) {
- return c >= 'A' && c <= 'Z' || Character.isUpperCase(c);
- }
-
- protected static boolean isLower(char c) {
- return c >= 'a' && c <= 'z' || Character.isLowerCase(c);
- }
-
- protected boolean isLetter(char c) {
- return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || Character.isLetter(c);
- }
-
- /**
- * Capitalizes the first character of the specified string,
- * and de-capitalize the rest of characters.
- */
- protected static String capitalize(String s) {
- if (!isLower(s.charAt(0))) {
- return s;
- }
- StringBuilder sb = new StringBuilder(s.length());
- sb.append(Character.toUpperCase(s.charAt(0)));
- sb.append(s.substring(1).toLowerCase());
- return sb.toString();
- }
-
- // Precondition: s[start] is not punctuation
- private static int nextBreak(String s, int start) {
- int n = s.length();
-
- char c1 = s.charAt(start);
- int t1 = classify(c1);
-
- for (int i = start + 1; i < n; i++) {
- // shift (c1,t1) into (c0,t0)
- // char c0 = c1; --- conceptually, but c0 won't be used
- int t0 = t1;
-
- c1 = s.charAt(i);
- t1 = classify(c1);
-
- switch (actionTable[t0 * 5 + t1]) {
- case ACTION_CHECK_PUNCT:
- if (isPunct(c1)) {
- return i;
- }
- break;
- case ACTION_CHECK_C2:
- if (i < n - 1) {
- char c2 = s.charAt(i + 1);
- if (isLower(c2)) {
- return i;
- }
- }
- break;
- case ACTION_BREAK:
- return i;
- }
- }
- return -1;
- }
-
- // the 5-category classification that we use in this code
- // to find work breaks
- static protected final int UPPER_LETTER = 0;
- static protected final int LOWER_LETTER = 1;
- static protected final int OTHER_LETTER = 2;
- static protected final int DIGIT = 3;
- static protected final int OTHER = 4;
- /**
- * Look up table for actions.
- * type0*5+type1 would yield the action to be taken.
- */
- private static final byte[] actionTable = new byte[5 * 5];
-
- // action constants. see nextBreak for the meaning
- static private final byte ACTION_CHECK_PUNCT = 0;
- static private final byte ACTION_CHECK_C2 = 1;
- static private final byte ACTION_BREAK = 2;
- static private final byte ACTION_NOBREAK = 3;
-
- /**
- * Decide the action to be taken given
- * the classification of the preceding character 't0' and
- * the classification of the next character 't1'.
- */
- private static byte decideAction(int t0, int t1) {
- if (t0 == OTHER && t1 == OTHER) {
- return ACTION_CHECK_PUNCT;
- }
- if (!xor(t0 == DIGIT, t1 == DIGIT)) {
- return ACTION_BREAK;
- }
- if (t0 == LOWER_LETTER && t1 != LOWER_LETTER) {
- return ACTION_BREAK;
- }
- if (!xor(t0 <= OTHER_LETTER, t1 <= OTHER_LETTER)) {
- return ACTION_BREAK;
- }
- if (!xor(t0 == OTHER_LETTER, t1 == OTHER_LETTER)) {
- return ACTION_BREAK;
- }
-
- if (t0 == UPPER_LETTER && t1 == UPPER_LETTER) {
- return ACTION_CHECK_C2;
- }
-
- return ACTION_NOBREAK;
- }
-
- private static boolean xor(boolean x, boolean y) {
- return (x && y) || (!x && !y);
- }
-
-
- static {
- // initialize the action table
- for (int t0 = 0; t0 < 5; t0++) {
- for (int t1 = 0; t1 < 5; t1++) {
- actionTable[t0 * 5 + t1] = decideAction(t0, t1);
- }
- }
- }
-
- /**
- * Classify a character into 5 categories that determine the word break.
- */
- protected static int classify(char c0) {
- switch (Character.getType(c0)) {
- case Character.UPPERCASE_LETTER:
- return UPPER_LETTER;
- case Character.LOWERCASE_LETTER:
- return LOWER_LETTER;
- case Character.TITLECASE_LETTER:
- case Character.MODIFIER_LETTER:
- case Character.OTHER_LETTER:
- return OTHER_LETTER;
- case Character.DECIMAL_DIGIT_NUMBER:
- return DIGIT;
- default:
- return OTHER;
- }
- }
-
- /**
- * Tokenizes a string into words and capitalizes the first
- * character of each word.
- *
- * <p>
- * This method uses a change in character type as a splitter
- * of two words. For example, "abc100ghi" will be splitted into
- * {"Abc", "100","Ghi"}.
- */
- protected static List<String> toWordList(String s) {
- ArrayList<String> ss = new ArrayList<String>();
- int n = s.length();
- for (int i = 0; i < n;) {
-
- // Skip punctuation
- while (i < n) {
- if (!isPunct(s.charAt(i))) {
- break;
- }
- i++;
- }
- if (i >= n) {
- break;
- }
-
- // Find next break and collect word
- int b = nextBreak(s, i);
- String w = (b == -1) ? s.substring(i) : s.substring(i, b);
- ss.add(escape(capitalize(w)));
- if (b == -1) {
- break;
- }
- i = b;
- }
-
-// we can't guarantee a valid Java identifier anyway,
-// so there's not much point in rejecting things in this way.
-// if (ss.size() == 0)
-// throw new IllegalArgumentException("Zero-length identifier");
- return ss;
- }
-
- protected static String toMixedCaseName(List<String> ss, boolean startUpper) {
- StringBuilder sb = new StringBuilder();
- if (!ss.isEmpty()) {
- sb.append(startUpper ? ss.get(0) : ss.get(0).toLowerCase());
- for (int i = 1; i < ss.size(); i++) {
- sb.append(ss.get(i));
- }
- }
- return sb.toString();
- }
-
- protected static String toMixedCaseVariableName(String[] ss,
- boolean startUpper,
- boolean cdrUpper) {
- if (cdrUpper) {
- for (int i = 1; i < ss.length; i++) {
- ss[i] = capitalize(ss[i]);
- }
- }
- StringBuilder sb = new StringBuilder();
- if (ss.length > 0) {
- sb.append(startUpper ? ss[0] : ss[0].toLowerCase());
- for (int i = 1; i < ss.length; i++) {
- sb.append(ss[i]);
- }
- }
- return sb.toString();
- }
-
- /**
- * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
- *
- * @return
- * Always return a string but there's no guarantee that
- * the generated code is a valid Java identifier.
- */
- protected static String toConstantName(String s) {
- return toConstantName(toWordList(s));
- }
-
- /**
- * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
- *
- * @return
- * Always return a string but there's no guarantee that
- * the generated code is a valid Java identifier.
- */
- protected static String toConstantName(List<String> ss) {
- StringBuilder sb = new StringBuilder();
- if (!ss.isEmpty()) {
- sb.append(ss.get(0).toUpperCase());
- for (int i = 1; i < ss.size(); i++) {
- sb.append('_');
- sb.append(ss.get(i).toUpperCase());
- }
- }
- return sb.toString();
- }
-
- /**
- * Escapes characters is the given string so that they can be
- * printed by only using US-ASCII characters.
- *
- * The escaped characters will be appended to the given
- * StringBuffer.
- *
- * @param sb
- * StringBuffer that receives escaped string.
- * @param s
- * String to be escaped. <code>s.substring(start)</code>
- * will be escaped and copied to the string buffer.
- */
- protected static void escape(StringBuilder sb, String s, int start) {
- int n = s.length();
- for (int i = start; i < n; i++) {
- char c = s.charAt(i);
- if (Character.isJavaIdentifierPart(c)) {
- sb.append(c);
- } else {
- sb.append('_');
- if (c <= '\u000f') {
- sb.append("000");
- } else if (c <= '\u00ff') {
- sb.append("00");
- } else if (c <= '\u0fff') {
- sb.append('0');
- }
- sb.append(Integer.toString(c, 16));
- }
- }
- }
-
- /**
- * Escapes characters that are unusable as Java identifiers
- * by replacing unsafe characters with safe characters.
- */
- private static String escape(String s) {
- int n = s.length();
- for (int i = 0; i < n; i++) {
- if (!Character.isJavaIdentifierPart(s.charAt(i))) {
- StringBuilder sb = new StringBuilder(s.substring(0, i));
- escape(sb, s, i);
- return sb.toString();
- }
- }
- return s;
- }
-
- /**
- * Checks if a given string is usable as a Java identifier.
- */
- protected static boolean isJavaIdentifier(String s) {
- if (s.length() == 0) {
- return false;
- }
- if (reservedKeywords.contains(s)) {
- return false;
- }
-
- if (!Character.isJavaIdentifierStart(s.charAt(0))) {
- return false;
- }
-
- for (int i = 1; i < s.length(); i++) {
- if (!Character.isJavaIdentifierPart(s.charAt(i))) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Checks if the given string is a valid Java package name.
- */
- protected static boolean isJavaPackageName(String s) {
- while (s.length() != 0) {
- int idx = s.indexOf('.');
- if (idx == -1) {
- idx = s.length();
- }
- if (!isJavaIdentifier(s.substring(0, idx))) {
- return false;
- }
-
- s = s.substring(idx);
- if (s.length() != 0) {
- s = s.substring(1); // remove '.'
- }
- }
- return true;
- }
- /** All reserved keywords of Java. */
- private static HashSet<String> reservedKeywords = new HashSet<String>();
-
-
- static {
- // see http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- String[] words = new String[]{
- "abstract",
- "boolean",
- "break",
- "byte",
- "case",
- "catch",
- "char",
- "class",
- "const",
- "continue",
- "default",
- "do",
- "double",
- "else",
- "extends",
- "final",
- "finally",
- "float",
- "for",
- "goto",
- "if",
- "implements",
- "import",
- "instanceof",
- "int",
- "interface",
- "long",
- "native",
- "new",
- "package",
- "private",
- "protected",
- "public",
- "return",
- "short",
- "static",
- "strictfp",
- "super",
- "switch",
- "synchronized",
- "this",
- "throw",
- "throws",
- "transient",
- "try",
- "void",
- "volatile",
- "while",
- // technically these are not reserved words but they cannot be used as identifiers.
- "true",
- "false",
- "null",
- // and I believe assert is also a new keyword
- "assert",
- // and 5.0 keywords
- "enum"
- };
- for (String word : words) {
- reservedKeywords.add(word);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/RootElementWrapper.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/RootElementWrapper.java
deleted file mode 100644
index 07b63bf014e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/RootElementWrapper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.SequenceInputStream;
-import java.io.UnsupportedEncodingException;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class RootElementWrapper {
-
- public static InputStream wrapInput(InputStream inputStream, String rootName) throws UnsupportedEncodingException {
- SequenceInputStream sis = new SequenceInputStream(new ByteArrayInputStream(String.format("{\"%s\":", rootName).getBytes("UTF-8")), inputStream);
- return new SequenceInputStream(sis, new ByteArrayInputStream("}".getBytes("UTF-8")));
- }
-
- public static InputStream unwrapInput(InputStream inputStream) throws IOException {
- return new JsonRootEatingInputStreamFilter(inputStream);
- }
-
- public static OutputStream unwrapOutput(OutputStream outputStream) throws IOException {
- throw new UnsupportedOperationException("to be implemented yet");
- }
-
- public static OutputStream wrapOutput(OutputStream outputStream) throws IOException {
- throw new UnsupportedOperationException("to be implemented yet");
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/Stax2JsonFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/Stax2JsonFactory.java
deleted file mode 100644
index 66f5b8e47ba..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/Stax2JsonFactory.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.ReaderWriter;
-import com.sun.jersey.json.impl.writer.*;
-import com.sun.jersey.json.impl.reader.Jackson2StaxReader;
-import com.sun.jersey.json.impl.reader.JacksonRootAddingParser;
-import com.sun.jersey.json.impl.reader.JsonXmlStreamReader;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.Writer;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jettison.badgerfish.BadgerFishXMLStreamReader;
-import org.codehaus.jettison.badgerfish.BadgerFishXMLStreamWriter;
-import org.codehaus.jettison.json.JSONObject;
-import org.codehaus.jettison.json.JSONTokener;
-import org.codehaus.jettison.mapped.Configuration;
-import org.codehaus.jettison.mapped.MappedNamespaceConvention;
-import org.codehaus.jettison.mapped.MappedXMLStreamReader;
-import org.codehaus.jettison.mapped.MappedXMLStreamWriter;
-
-/**
- *
- * @author japod
- */
-public class Stax2JsonFactory {
-
- private Stax2JsonFactory() {
- }
-
- public static XMLStreamWriter createWriter(Writer writer, JSONConfiguration config) throws IOException {
- return createWriter(writer, config, false);
- }
-
- public static XMLStreamWriter createWriter(Writer writer, JSONConfiguration config, boolean writingList) throws IOException {
- switch (config.getNotation()) {
- case NATURAL:
- final JsonGenerator rawGenerator = new JsonFactory().createJsonGenerator(writer);
- if (config.isHumanReadableFormatting()) {
- rawGenerator.useDefaultPrettyPrinter();
- }
- final JsonGenerator bodyGenerator = writingList ? JacksonArrayWrapperGenerator.createArrayWrapperGenerator(rawGenerator, config.isRootUnwrapping() ? 0 : 1) : rawGenerator;
- if (config.isRootUnwrapping()) {
- return new Stax2JacksonWriter(JacksonRootStrippingGenerator.createRootStrippingGenerator(bodyGenerator, writingList ? 2 : 1), config);
- } else {
- return new Stax2JacksonWriter(bodyGenerator, config);
- }
- case MAPPED:
- return JsonXmlStreamWriter.createWriter(writer, config);
- case BADGERFISH:
- return new BadgerFishXMLStreamWriter(writer);
- case MAPPED_JETTISON:
- Configuration jmConfig;
- if (null == config.getXml2JsonNs()) {
- jmConfig = new Configuration();
- } else {
- jmConfig = new Configuration(config.getXml2JsonNs());
- }
- return new MappedXMLStreamWriter(new MappedNamespaceConvention(jmConfig), writer);
- default:
- return null;
- }
- }
-
- public static XMLStreamReader createReader(Reader reader, JSONConfiguration config, String rootName) throws XMLStreamException {
- return createReader(reader, config, rootName, false);
- }
-
-
- public static XMLStreamReader createReader(Reader reader, JSONConfiguration config, String rootName, boolean readingList) throws XMLStreamException {
-
- Reader nonEmptyReader = ensureNonEmptyReader(reader);
-
- switch (config.getNotation()) {
- case NATURAL:
- try {
- final JsonParser rawParser = new JsonFactory().createJsonParser(nonEmptyReader);
- final JsonParser nonListParser = config.isRootUnwrapping() ? JacksonRootAddingParser.createRootAddingParser(rawParser, rootName) : rawParser;
- if (!readingList) {
- return new Jackson2StaxReader(nonListParser, config);
- } else {
- return new Jackson2StaxReader(JacksonRootAddingParser.createRootAddingParser(nonListParser, "jsonArrayRootElement"), config);
- }
- } catch (Exception ex) {
- throw new XMLStreamException(ex);
- }
- case MAPPED:
- try {
- return new JsonXmlStreamReader(nonEmptyReader, rootName, config);
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- case MAPPED_JETTISON:
- try {
- Configuration jmConfig;
- if (null == config.getXml2JsonNs()) {
- jmConfig = new Configuration();
- } else {
- jmConfig = new Configuration(config.getXml2JsonNs());
- }
- return new MappedXMLStreamReader(
- new JSONObject(new JSONTokener(ReaderWriter.readFromAsString(nonEmptyReader))),
- new MappedNamespaceConvention(jmConfig));
- } catch (Exception ex) {
- throw new XMLStreamException(ex);
- }
- case BADGERFISH:
- try {
- return new BadgerFishXMLStreamReader(new JSONObject(new JSONTokener(ReaderWriter.readFromAsString(nonEmptyReader))));
- } catch (Exception ex) {
- throw new XMLStreamException(ex);
- }
- }
- // This should not occur
- throw new IllegalArgumentException("Unknown JSON config");
- }
-
- private static Reader ensureNonEmptyReader(Reader reader) throws XMLStreamException {
- try {
- Reader mr = reader.markSupported() ? reader : new BufferedReader(reader);
- mr.mark(1);
- if (mr.read() == -1) {
- throw new XMLStreamException("JSON expression can not be empty!");
- }
- mr.reset();
- return mr;
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/impl.properties b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/impl.properties
deleted file mode 100644
index 68ec9f3a495..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/impl.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-error.parsing.json.object=Error parsing JSON object.
-error.parsing.json.array=Error parsing JSON array.
-error.writing.json.object=Error writing JSON object.
-error.writing.json.array=Error writing JSON array.
-error.nonge.jsonp.msg.body.writer.not.found=A message body writer for Java type, {0}, and MIME media type, {1}, was not found. If you want to serialize a parametrized type, you might want to use GenericEntity
-error.jsonp.msg.body.writer.not.found=A message body writer for Java type, {0}, and MIME media type, {1}, was not found.
-error.jaxb.ri.2.1.10.missing=NATURAL JSON notation configured, but JAXB RI 2.1.10 not found. For the recent builds to get this working correctly, you need even at least JAXB version 2.1.12. Please add it to your classpath!
-error.jaxb.ri.2.1.12.missing=NATURAL JSON notation configured, but at least JAXB RI 2.1.12 is needed when XML attributes are in use. Please add jaxb-impl-2.1.12 to your classpath! \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.java
deleted file mode 100644
index b3927676879..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.provider.entity;
-
-import com.sun.jersey.json.impl.ImplMessages;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-
-/**
- *
- * @author japod
- */
-public class JSONArrayProvider extends JSONLowLevelProvider<JSONArray>{
-
- @Produces("application/json")
- @Consumes("application/json")
- public static final class App extends JSONArrayProvider {
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends JSONArrayProvider {
- @Override
- protected boolean isSupported(MediaType m) {
- return m.getSubtype().endsWith("+json");
- }
- }
-
- JSONArrayProvider() {
- super(JSONArray.class);
- }
-
- @Override
- public JSONArray readFrom(
- Class<JSONArray> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- return new JSONArray(readFromAsString(entityStream, mediaType));
- } catch (JSONException je) {
- throw new WebApplicationException(
- new Exception(ImplMessages.ERROR_PARSING_JSON_ARRAY(), je),
- 400);
- }
- }
-
- @Override
- public void writeTo(
- JSONArray t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- OutputStreamWriter writer = new OutputStreamWriter(entityStream,
- getCharset(mediaType));
- t.write(writer);
- writer.write("\n");
- writer.flush();
- } catch (JSONException je) {
- throw new WebApplicationException(
- new Exception(ImplMessages.ERROR_WRITING_JSON_ARRAY(), je),
- 500);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.java
deleted file mode 100644
index dd4f9f4f64f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.provider.entity;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.api.json.JSONJAXBContext;
-import com.sun.jersey.api.json.JSONMarshaller;
-import com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.nio.charset.Charset;
-
-/**
- *
- * @author japod
- */
-public class JSONJAXBElementProvider extends AbstractJAXBElementProvider {
-
- boolean jacksonEntityProviderTakesPrecedence = false;
-
- JSONJAXBElementProvider(Providers ps) {
- super(ps);
- }
-
- JSONJAXBElementProvider(Providers ps, MediaType mt) {
- super(ps, mt);
- }
-
- @Context @Override
- public void setConfiguration(FeaturesAndProperties fp) {
- super.setConfiguration(fp);
- jacksonEntityProviderTakesPrecedence = fp.getFeature(JSONConfiguration.FEATURE_POJO_MAPPING);
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return !jacksonEntityProviderTakesPrecedence && super.isReadable(type, genericType, annotations, mediaType);
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return !jacksonEntityProviderTakesPrecedence && super.isWriteable(type, genericType, annotations, mediaType);
- }
-
- @Produces("application/json")
- @Consumes("application/json")
- public static final class App extends JSONJAXBElementProvider {
- public App(@Context Providers ps) { super(ps , MediaType.APPLICATION_JSON_TYPE); }
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends JSONJAXBElementProvider {
- public General(@Context Providers ps) { super(ps); }
-
- @Override
- protected boolean isSupported(MediaType m) {
- return m.getSubtype().endsWith("+json");
- }
- }
-
- @Override
- protected final JAXBElement<?> readFrom(Class<?> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException {
- final Charset c = getCharset(mediaType);
-
- return JSONJAXBContext.getJSONUnmarshaller(u).
- unmarshalJAXBElementFromJSON(new InputStreamReader(entityStream, c), type);
- }
-
- @Override
- protected final void writeTo(JAXBElement<?> t, MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException {
-
- JSONMarshaller jsonMarshaller = JSONJAXBContext.getJSONMarshaller(m);
- if(isFormattedOutput())
- jsonMarshaller.setProperty(JSONMarshaller.FORMATTED, true);
- jsonMarshaller.marshallToJSON(t, new OutputStreamWriter(entityStream, c));
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.java
deleted file mode 100644
index 13e11ea4374..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.provider.entity;
-
-import com.sun.jersey.api.json.JSONConfigurated;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.provider.jaxb.AbstractListElementProvider;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import com.sun.jersey.json.impl.JSONHelper;
-import com.sun.jersey.json.impl.Stax2JsonFactory;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.nio.charset.Charset;
-import java.util.Collection;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class JSONListElementProvider extends AbstractListElementProvider {
-
- boolean jacksonEntityProviderTakesPrecedence = false;
-
- JSONListElementProvider(Providers ps) {
- super(ps);
- }
-
- JSONListElementProvider(Providers ps, MediaType mt) {
- super(ps, mt);
- }
-
- @Context @Override
- public void setConfiguration(FeaturesAndProperties fp) {
- super.setConfiguration(fp);
- jacksonEntityProviderTakesPrecedence = fp.getFeature(JSONConfiguration.FEATURE_POJO_MAPPING);
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return !jacksonEntityProviderTakesPrecedence && super.isReadable(type, genericType, annotations, mediaType);
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return !jacksonEntityProviderTakesPrecedence && super.isWriteable(type, genericType, annotations, mediaType);
- }
-
- @Produces("application/json")
- @Consumes("application/json")
- public static final class App extends JSONListElementProvider {
- public App(@Context Providers ps) { super(ps , MediaType.APPLICATION_JSON_TYPE); }
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends JSONListElementProvider {
- public General(@Context Providers ps) { super(ps); }
-
- @Override
- protected boolean isSupported(MediaType m) {
- return !jacksonEntityProviderTakesPrecedence && m.getSubtype().endsWith("+json");
- }
- }
-
- @Override
- public final void writeList(Class<?> elementType, Collection<?> t, MediaType mediaType, Charset c, Marshaller m, OutputStream entityStream) throws JAXBException, IOException {
- final OutputStreamWriter osw = new OutputStreamWriter(entityStream, c);
-
- JSONConfiguration origJsonConfig = JSONConfiguration.DEFAULT;
- if (m instanceof JSONConfigurated) {
- origJsonConfig = ((JSONConfigurated)m).getJSONConfiguration();
- }
-
- final JSONConfiguration unwrappingJsonConfig =
- JSONConfiguration.createJSONConfigurationWithRootUnwrapping(origJsonConfig, true);
-
- final XMLStreamWriter jxsw = Stax2JsonFactory.createWriter(osw, unwrappingJsonConfig, true);
- final String invisibleRootName = getRootElementName(elementType);
- final String elementName = getElementName(elementType);
-
- try {
- if (!origJsonConfig.isRootUnwrapping()) {
- osw.append(String.format("{\"%s\":", elementName));
- osw.flush();
- }
- jxsw.writeStartDocument();
- jxsw.writeStartElement(invisibleRootName);
- for (Object o : t) {
- m.marshal(o, jxsw);
- }
- jxsw.writeEndElement();
- jxsw.writeEndDocument();
- jxsw.flush();
- if (!origJsonConfig.isRootUnwrapping()) {
- osw.append("}");
- osw.flush();
- }
- } catch (XMLStreamException ex) {
- Logger.getLogger(JSONListElementProvider.class.getName()).log(Level.SEVERE, null, ex);
- throw new JAXBException(ex.getMessage(), ex);
- }
- }
-
- @Override
- protected final XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller u, InputStream entityStream) throws XMLStreamException {
- JSONConfiguration c = JSONConfiguration.DEFAULT;
- final Charset charset = getCharset(mediaType);
- if (u instanceof JSONConfigurated) {
- c = ((JSONConfigurated) u).getJSONConfiguration();
- }
- return Stax2JsonFactory.createReader(new InputStreamReader(entityStream, charset), c, JSONHelper.getRootElementName((Class)elementType), true);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.java
deleted file mode 100644
index fd7b0ac1df6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.provider.entity;
-
-
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.MediaType;
-
-/**
- *
- * @author japod
- */
-public abstract class JSONLowLevelProvider<T> extends AbstractMessageReaderWriterProvider<T>{
-
- private final Class<T> c;
-
- // JavaRebel needs this ctor
- protected JSONLowLevelProvider(Class<T> c) {
- this.c = c;
- }
-
- public boolean isReadable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return (type == c) && isSupported(mediaType);
- }
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[], MediaType mediaType) {
- return (type == c) && isSupported(mediaType);
- }
-
- protected boolean isSupported(MediaType m) {
- return true;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.java
deleted file mode 100644
index 2d848b2ee7c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.provider.entity;
-
-
-import com.sun.jersey.json.impl.ImplMessages;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-/**
- *
- * @author japod
- */
-public class JSONObjectProvider extends JSONLowLevelProvider<JSONObject>{
-
- @Produces("application/json")
- @Consumes("application/json")
- public static final class App extends JSONObjectProvider {
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends JSONObjectProvider {
- @Override
- protected boolean isSupported(MediaType m) {
- return m.getSubtype().endsWith("+json");
- }
- }
-
- JSONObjectProvider() {
- super(JSONObject.class);
- }
-
- public JSONObject readFrom(
- Class<JSONObject> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException {
- try {
- return new JSONObject(readFromAsString(entityStream, mediaType));
- } catch (JSONException je) {
- throw new WebApplicationException(
- new Exception(ImplMessages.ERROR_PARSING_JSON_OBJECT(), je),
- 400);
- }
- }
-
- public void writeTo(
- JSONObject t,
- Class<?> type,
- Type genericType,
- Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- try {
- OutputStreamWriter writer = new OutputStreamWriter(entityStream,
- getCharset(mediaType));
- t.write(writer);
- writer.flush();
- } catch (JSONException je) {
- throw new WebApplicationException(
- new Exception(ImplMessages.ERROR_WRITING_JSON_OBJECT(), je),
- 500);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.java
deleted file mode 100644
index 591575bedf7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.provider.entity;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.api.json.JSONJAXBContext;
-import com.sun.jersey.api.json.JSONMarshaller;
-import com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.nio.charset.Charset;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com, Jakub.Podlesak@Sun.COM
- */
-public class JSONRootElementProvider extends AbstractRootElementProvider {
-
- boolean jacksonEntityProviderTakesPrecedence = false;
-
- JSONRootElementProvider(Providers ps) {
- super(ps);
- }
-
- JSONRootElementProvider(Providers ps, MediaType mt) {
- super(ps, mt);
- }
-
- @Context @Override
- public void setConfiguration(FeaturesAndProperties fp) {
- super.setConfiguration(fp);
- jacksonEntityProviderTakesPrecedence = fp.getFeature(JSONConfiguration.FEATURE_POJO_MAPPING);
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return !jacksonEntityProviderTakesPrecedence && super.isReadable(type, genericType, annotations, mediaType);
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return !jacksonEntityProviderTakesPrecedence && super.isWriteable(type, genericType, annotations, mediaType);
- }
-
- @Produces("application/json")
- @Consumes("application/json")
- public static final class App extends JSONRootElementProvider {
-
- public App(@Context Providers ps) {
- super(ps, MediaType.APPLICATION_JSON_TYPE);
- }
- }
-
- @Produces("*/*")
- @Consumes("*/*")
- public static final class General extends JSONRootElementProvider {
-
- public General(@Context Providers ps) {
- super(ps);
- }
-
- @Override
- protected boolean isSupported(MediaType m) {
- return !jacksonEntityProviderTakesPrecedence && m.getSubtype().endsWith("+json");
- }
- }
-
- @Override
- protected final Object readFrom(Class<Object> type, MediaType mediaType,
- Unmarshaller u, InputStream entityStream)
- throws JAXBException {
- final Charset c = getCharset(mediaType);
-
- return JSONJAXBContext.getJSONUnmarshaller(u).
- unmarshalFromJSON(new InputStreamReader(entityStream, c), type);
- }
-
- @Override
- protected void writeTo(Object t, MediaType mediaType, Charset c,
- Marshaller m, OutputStream entityStream)
- throws JAXBException {
- JSONMarshaller jsonMarshaller = JSONJAXBContext.getJSONMarshaller(m);
- if(isFormattedOutput())
- jsonMarshaller.setProperty(JSONMarshaller.FORMATTED, true);
- jsonMarshaller.marshallToJSON(t, new OutputStreamWriter(entityStream, c));
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.java
deleted file mode 100644
index 07b5aa90636..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-
-package com.sun.jersey.json.impl.provider.entity;
-
-import com.sun.jersey.api.json.JSONWithPadding;
-import com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider;
-import com.sun.jersey.json.impl.ImplMessages;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.GenericEntity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM, Paul.Sandoz@Sun.COM
- */
-public class JSONWithPaddingProvider extends AbstractMessageReaderWriterProvider<JSONWithPadding> {
-
- private static final Logger LOGGER = Logger.getLogger(JSONWithPaddingProvider.class.getName());
-
- private final Map<String, Set<String>> javascriptTypes;
-
- @Context MessageBodyWorkers bodyWorker;
-
-
- public JSONWithPaddingProvider() {
- javascriptTypes = new HashMap<String, Set<String>>();
- // application/javascript, application/x-javascript, text/ecmascript, application/ecmascript, text/jscript
- javascriptTypes.put("application", new HashSet<String>(Arrays.asList("x-javascript", "ecmascript", "javascript")));
- javascriptTypes.put("text", new HashSet<String>(Arrays.asList("ecmascript", "jscript")));
- }
-
- private boolean isJavascript(MediaType m) {
- Set<String> subtypes = javascriptTypes.get(m.getType());
- if (subtypes == null) return false;
-
- return subtypes.contains(m.getSubtype());
- }
-
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return false;
- }
-
- @Override
- public JSONWithPadding readFrom(Class<JSONWithPadding> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
- throw new UnsupportedOperationException("Not supported by design.");
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return type == JSONWithPadding.class;
- }
-
- @Override
- public void writeTo(JSONWithPadding t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
- Object jsonEntity = t.getJsonSource();
- Type entityGenericType = jsonEntity.getClass();
- Class<?> entityType = jsonEntity.getClass();
-
- final boolean genericEntityUsed = jsonEntity instanceof GenericEntity;
-
- if (genericEntityUsed) {
- GenericEntity ge = (GenericEntity)jsonEntity;
- jsonEntity = ge.getEntity();
- entityGenericType = ge.getType();
- entityType = ge.getRawType();
- }
-
- final boolean isJavaScript = isJavascript(mediaType);
- final MediaType workerMediaType = isJavaScript ? MediaType.APPLICATION_JSON_TYPE : mediaType;
-
- MessageBodyWriter bw = bodyWorker.getMessageBodyWriter(entityType, entityGenericType, annotations, workerMediaType);
- if (bw == null) {
- if (!genericEntityUsed) {
- LOGGER.severe(ImplMessages.ERROR_NONGE_JSONP_MSG_BODY_WRITER_NOT_FOUND(jsonEntity, workerMediaType));
- } else {
- LOGGER.severe(ImplMessages.ERROR_JSONP_MSG_BODY_WRITER_NOT_FOUND(jsonEntity, workerMediaType));
- }
- throw new WebApplicationException(500);
- }
-
-
- if (isJavaScript) {
- entityStream.write(t.getCallbackName().getBytes());
- entityStream.write('(');
- }
-
- bw.writeTo(jsonEntity, entityType, entityGenericType, annotations, workerMediaType, httpHeaders, entityStream);
-
- if (isJavaScript) {
- entityStream.write(')');
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.java
deleted file mode 100644
index f28abe064ff..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.provider.entity;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentInjector;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Providers;
-import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
-import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
-
-/**
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public class JacksonProviderProxy implements MessageBodyReader<Object>, MessageBodyWriter<Object> {
-
- JacksonJsonProvider pojoProvider = new JacksonJsonProvider();
- JacksonJaxbJsonProvider jaxbProvider = new JacksonJaxbJsonProvider();
-
- boolean jacksonEntityProviderFeatureSet = false;
-
- @Context
- public void setFeaturesAndProperties(FeaturesAndProperties fp) {
- jacksonEntityProviderFeatureSet = fp.getFeature(JSONConfiguration.FEATURE_POJO_MAPPING);
- }
-
- private static class ProvidersInjectableProviderContext implements InjectableProviderContext {
-
- final Providers p;
- final Injectable i;
-
- private ProvidersInjectableProviderContext(final Providers p) {
- this.p = p;
- this.i = new Injectable() {
-
- @Override
- public Object getValue() {
- return p;
- }
- };
- }
-
- @Override
- public boolean isAnnotationRegistered(Class<? extends Annotation> ac, Class<?> cc) {
- return ac == Context.class;
- }
-
- @Override
- public boolean isInjectableProviderRegistered(Class<? extends Annotation> ac, Class<?> cc, ComponentScope s) {
- return isAnnotationRegistered(ac, cc);
- }
-
- @Override
- public <A extends Annotation, C> Injectable getInjectable(Class<? extends Annotation> ac, ComponentContext ic, A a, C c, ComponentScope s) {
- return (c == Providers.class) ? i : null;
- }
-
- @Override
- public <A extends Annotation, C> Injectable getInjectable(Class<? extends Annotation> ac, ComponentContext ic, A a, C c, List<ComponentScope> ls) {
- return (c == Providers.class) ? i : null;
- }
-
- @Override
- public <A extends Annotation, C> InjectableScopePair getInjectableWithScope(Class<? extends Annotation> ac, ComponentContext ic, A a, C c, List<ComponentScope> ls) {
- return (c == Providers.class) ? new InjectableScopePair(i, ls.get(0)) : null;
- }
-
- }
-
- @Context
- public void setProviders(Providers p) {
- new ComponentInjector<JacksonJsonProvider>(new ProvidersInjectableProviderContext(p), JacksonJsonProvider.class).inject(pojoProvider);
- new ComponentInjector<JacksonJaxbJsonProvider>(new ProvidersInjectableProviderContext(p), JacksonJaxbJsonProvider.class).inject(jaxbProvider);
- }
-
- @Override
- public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return jacksonEntityProviderFeatureSet &&
- (jaxbProvider.isReadable(type, genericType, annotations, mediaType) || pojoProvider.isReadable(type, genericType, annotations, mediaType));
- }
-
- @Override
- public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
- return jaxbProvider.isReadable(type, genericType, annotations, mediaType) ?
- jaxbProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream) :
- pojoProvider.readFrom(type, genericType, annotations, mediaType, httpHeaders, entityStream);
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return jacksonEntityProviderFeatureSet &&
- (jaxbProvider.isWriteable(type, genericType, annotations, mediaType) || pojoProvider.isWriteable(type, genericType, annotations, mediaType));
- }
-
- @Override
- public long getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return jaxbProvider.isWriteable(type, genericType, annotations, mediaType) ?
- jaxbProvider.getSize(t, type, genericType, annotations, mediaType) :
- pojoProvider.getSize(t, type, genericType, annotations, mediaType);
- }
-
- @Override
- public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
- if (jaxbProvider.isWriteable(type, genericType, annotations, mediaType)) {
- jaxbProvider.writeTo(t, type, genericType, annotations, mediaType, httpHeaders, entityStream);
- } else {
- pojoProvider.writeTo(t, type, genericType, annotations, mediaType, httpHeaders, entityStream);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/CharactersEvent.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/CharactersEvent.java
deleted file mode 100644
index 12f4cfb54b0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/CharactersEvent.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- *
- * @author japod
- */
-public class CharactersEvent extends JsonReaderXmlEvent {
-
- public CharactersEvent(String text, Location location) {
- this.text = text;
- this.location = location;
- }
-
- @Override
- public boolean isCharacters() {
- return true;
- }
-
- @Override
- public int getEventType() {
- return XMLStreamConstants.CHARACTERS;
- }
-
- @Override
- public String toString() {
- return "CharactersEvent(" + text + ")";
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndDocumentEvent.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndDocumentEvent.java
deleted file mode 100644
index 7a1f2368d4c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndDocumentEvent.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- *
- * @author japod
- */
-public class EndDocumentEvent extends JsonReaderXmlEvent {
-
- public EndDocumentEvent(Location location) {
- this.location = location;
- }
-
- @Override
- public boolean isEndDocument() {
- return true;
- }
-
- @Override
- public int getEventType() {
- return XMLStreamConstants.END_DOCUMENT;
- }
-
- @Override
- public String toString() {
- return "EndDocumentEvent()";
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndElementEvent.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndElementEvent.java
deleted file mode 100644
index fe5dae99221..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/EndElementEvent.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- *
- * @author japod
- */
-public class EndElementEvent extends JsonReaderXmlEvent {
-
- public EndElementEvent(QName name, Location location) {
- this.name = name;
- this.location = location;
- }
-
- @Override
- public boolean isEndElement() {
- return true;
- }
-
- @Override
- public int getEventType() {
- return XMLStreamConstants.END_ELEMENT;
- }
-
- @Override
- public String toString() {
- return "EndElementEvent(" + name + ")";
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/Jackson2StaxReader.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/Jackson2StaxReader.java
deleted file mode 100644
index 5082b3a8642..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/Jackson2StaxReader.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.reader;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.json.impl.ImplMessages;
-import com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import org.codehaus.jackson.JsonParser;
-
-/**
- *
- * @author japod
- */
-public class Jackson2StaxReader implements XMLStreamReader {
-
- private static class ProcessingInfo {
-
- QName name;
- boolean isArray;
- boolean isFirstElement;
-
- ProcessingInfo(QName name, boolean isArray, boolean isFirstElement) {
- this.name = name;
- this.isArray = isArray;
- this.isFirstElement = isFirstElement;
- }
- }
- JsonParser parser;
- final Queue<JsonReaderXmlEvent> eventQueue = new LinkedList<JsonReaderXmlEvent>();
- final List<ProcessingInfo> processingStack = new ArrayList<ProcessingInfo>();
- final JsonNamespaceContext namespaceContext = new JsonNamespaceContext();
-
-
- private boolean properJAXBVersion = true;
- private final boolean attrsWithPrefix;
-
- final Collection<String> elemsExpected = new HashSet<String>();
- final Map<String, QName> qNamesOfExpElems = new HashMap<String, QName>();
-
- final Collection<String> attrsExpected = new HashSet<String>();
- final Map<String, QName> qNamesOfExpAttrs = new HashMap<String, QName>();
-
- static <T> T pop(List<T> stack) {
- return stack.remove(stack.size() - 1);
- }
-
- static <T> T peek(List<T> stack) {
- return (stack.size() > 0) ? stack.get(stack.size() - 1) : null;
- }
-
- static <T> T peek2nd(List<T> stack) {
- return (stack.size() > 1) ? stack.get(stack.size() - 2) : null;
- }
-
- public Jackson2StaxReader(JsonParser parser) throws XMLStreamException {
- this(parser, JSONConfiguration.DEFAULT);
- }
-
- public Jackson2StaxReader(JsonParser parser, JSONConfiguration config) throws XMLStreamException {
- this.attrsWithPrefix = config.isUsingPrefixesAtNaturalAttributes();
- this.parser = parser;
- try {
- readNext();
- } catch (IOException ex) {
- Logger.getLogger(Jackson2StaxReader.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- public Object getProperty(String name) throws IllegalArgumentException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- private void readNext() throws IOException {
- readNext(false);
- }
- final static Collection<org.codehaus.jackson.JsonToken> valueTokens = new HashSet<org.codehaus.jackson.JsonToken>() {
-
- {
- add(org.codehaus.jackson.JsonToken.VALUE_FALSE);
- add(org.codehaus.jackson.JsonToken.VALUE_TRUE);
- add(org.codehaus.jackson.JsonToken.VALUE_NULL);
- add(org.codehaus.jackson.JsonToken.VALUE_STRING);
- add(org.codehaus.jackson.JsonToken.VALUE_NUMBER_FLOAT);
- add(org.codehaus.jackson.JsonToken.VALUE_NUMBER_INT);
- }
- };
-
- private QName getQNameForTagLocName(final String localName) {
- return getQNameForLocName(localName, qNamesOfExpElems);
- }
-
- private QName getQNameForLocName(final String localName, final Map<String, QName> qNamesMap) {
- final QName result = qNamesMap.get(localName);
- if (result != null) {
- return result;
- } else {
- return new QName(localName);
- }
- }
-
- private void readNext(boolean lookingForAttributes) throws IOException {
- if (!lookingForAttributes) {
- eventQueue.poll();
- }
- while (eventQueue.isEmpty() || lookingForAttributes) {
- org.codehaus.jackson.JsonToken jtok;
- // TODO: ask Jackson to take care of DOS
- while (true) {
- parser.nextToken();
- jtok = parser.getCurrentToken();
- final ProcessingInfo pi = peek(processingStack);
- switch (jtok) {
- case FIELD_NAME:
- // start tag
- String currentName = parser.getCurrentName();
- if (attrsWithPrefix && currentName.startsWith("@")) {
- currentName = currentName.substring(1);
- }
- boolean currentIsAttribute = !("$".equals(currentName)) && properJAXBVersion ? attrsExpected.contains(currentName) : !elemsExpected.contains(currentName);
- if (lookingForAttributes && currentIsAttribute) {
- parser.nextToken();
- if (valueTokens.contains(parser.getCurrentToken())) {
- eventQueue.peek().addAttribute(getQNameForLocName(currentName, qNamesOfExpAttrs), parser.getText());
- } else {
- System.out.println(String.format("CurrentName=%s", currentName));
- throw new IOException("Not an attribute, expected primitive value!");
- }
- } else { // non attribute
- lookingForAttributes = false; // stop seeking attributes
- if (!("$".equals(currentName))) {
- final QName currentQName = getQNameForTagLocName(currentName);
- eventQueue.add(new StartElementEvent(currentQName, new StaxLocation(parser.getCurrentLocation())));
- processingStack.add(new ProcessingInfo(currentQName, false, true));
- return;
- } else {
- parser.nextToken();
- if (valueTokens.contains(parser.getCurrentToken())) {
- eventQueue.add(new CharactersEvent(parser.getText(), new StaxLocation(parser.getCurrentLocation())));
- return;
- } else {
- throw new IOException("Not a xml value, expected primitive value!");
- }
- }
- }
- break;
- case START_OBJECT:
- if (pi == null) {
- eventQueue.add(new StartDocumentEvent(new StaxLocation(0, 0, 0)));
- return;
- }
- if (pi.isArray && !pi.isFirstElement) {
- eventQueue.add(new StartElementEvent(pi.name, new StaxLocation(parser.getCurrentLocation())));
- return;
- } else {
- pi.isFirstElement = false;
- }
- break;
- case END_OBJECT:
- lookingForAttributes = false;
- // end tag
- eventQueue.add(new EndElementEvent(pi.name, new StaxLocation(parser.getCurrentLocation())));
- if (!pi.isArray) {
- pop(processingStack);
- }
- if (processingStack.isEmpty()) {
- eventQueue.add(new EndDocumentEvent(new StaxLocation(parser.getCurrentLocation())));
- }
- return;
- case VALUE_FALSE:
- case VALUE_NULL:
- case VALUE_NUMBER_FLOAT:
- case VALUE_NUMBER_INT:
- case VALUE_TRUE:
- case VALUE_STRING:
- if (!pi.isFirstElement) {
- eventQueue.add(new StartElementEvent(pi.name, new StaxLocation(parser.getCurrentLocation())));
- } else {
- pi.isFirstElement = false;
- }
- if (jtok != jtok.VALUE_NULL) {
- eventQueue.add(new CharactersEvent(parser.getText(), new StaxLocation(parser.getCurrentLocation())));
- }
- eventQueue.add(new EndElementEvent(pi.name, new StaxLocation(parser.getCurrentLocation())));
- if (!pi.isArray) {
- pop(processingStack);
- }
- if (processingStack.isEmpty()) {
- eventQueue.add(new EndDocumentEvent(new StaxLocation(parser.getCurrentLocation())));
- }
- lookingForAttributes = false;
- return;
- case START_ARRAY:
- peek(processingStack).isArray = true;
- break;
- case END_ARRAY :
- pop(processingStack);
- lookingForAttributes = false;
- }
- }
- }
- }
-
- public void require(int arg0, String arg1, String arg2) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getElementText() throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public int next() throws XMLStreamException {
- try {
- readNext();
- return eventQueue.peek().getEventType();
- } catch (IOException ex) {
- Logger.getLogger(JsonXmlStreamReader.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- public int nextTag() throws XMLStreamException {
- int eventType = next();
- while ((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
- || (eventType == XMLStreamConstants.CDATA && isWhiteSpace()) // skip whitespace
- || eventType == XMLStreamConstants.SPACE || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION || eventType == XMLStreamConstants.COMMENT) {
- eventType = next();
- }
- if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
- throw new XMLStreamException("expected start or end tag", getLocation());
- }
- return eventType;
- }
-
- public boolean hasNext() throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void close() throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getNamespaceURI(
- String arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean isStartElement() {
- return eventQueue.peek().isStartElement();
- }
-
- public boolean isEndElement() {
- return eventQueue.peek().isEndElement();
- }
-
- public boolean isCharacters() {
- return eventQueue.peek().isCharacters();
- }
-
- public boolean isWhiteSpace() {
- return false;
- }
-
- public String getAttributeValue(
- String namespaceURI, String localName) {
- return eventQueue.peek().getAttributeValue(namespaceURI, localName);
- }
-
- public int getAttributeCount() {
- try {
-
- if (!eventQueue.peek().attributesChecked) {
-
- elemsExpected.clear();
- qNamesOfExpElems.clear();
- attrsExpected.clear();
- qNamesOfExpAttrs.clear();
-
- final UnmarshallingContext uctx = UnmarshallingContext.getInstance();
-
- if (uctx != null) {
- try {
- Collection<QName> currExpElems = uctx.getCurrentExpectedElements();
- for (QName n : currExpElems) {
- String nu = n.getNamespaceURI();
- if (nu != null && (nu.equals("\u0000"))) {
- elemsExpected.add("$");
- qNamesOfExpElems.put("$", null);
- } else {
- elemsExpected.add(n.getLocalPart());
- qNamesOfExpElems.put(n.getLocalPart(), n);
- }
- }
- } catch (NullPointerException npe) {
- // TODO: need to check what could be done in JAXB in order to prevent the npe
- // thrown from com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext#1206
- }
-
- if (properJAXBVersion) {
- try {
- Collection<QName> currExpAttrs = uctx.getCurrentExpectedAttributes();
- for (QName n : currExpAttrs) {
- attrsExpected.add(n.getLocalPart());
- qNamesOfExpAttrs.put(n.getLocalPart(), n);
- }
- } catch (NullPointerException npe) {
- // thrown from com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext
- } catch (NoSuchMethodError nsme) {
- // thrown when JAXB version is less than 2.1.12
- properJAXBVersion = false;
- Logger.getLogger(Jackson2StaxReader.class.getName()).log(Level.SEVERE, ImplMessages.ERROR_JAXB_RI_2_1_12_MISSING(), nsme);
- }
- }
- }
-
- readNext(true);
- eventQueue.peek().attributesChecked = true;
- }
- } catch (IOException ex) {
- Logger.getLogger(Jackson2StaxReader.class.getName()).log(Level.SEVERE, null, ex);
- }
- return eventQueue.peek().getAttributeCount();
- }
-
- public QName getAttributeName(
- int index) {
- return eventQueue.peek().getAttributeName(index);
- }
-
- public String getAttributeNamespace(
- int index) {
- return eventQueue.peek().getAttributeNamespace(index);
- }
-
- public String getAttributeLocalName(
- int index) {
- return eventQueue.peek().getAttributeLocalName(index);
- }
-
- public String getAttributePrefix(
- int index) {
- return eventQueue.peek().getAttributePrefix(index);
- }
-
- public String getAttributeType(
- int index) {
- return eventQueue.peek().getAttributeType(index);
- }
-
- public String getAttributeValue(
- int index) {
- return eventQueue.peek().getAttributeValue(index);
- }
-
- public boolean isAttributeSpecified(int index) {
- return eventQueue.peek().isAttributeSpecified(index);
- }
-
- public int getNamespaceCount() {
- return this.namespaceContext.getNamespaceCount();
- }
-
- public String getNamespacePrefix(int idx) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getNamespaceURI(int idx) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public NamespaceContext getNamespaceContext() {
- return this.namespaceContext;
- }
-
- public int getEventType() {
- return eventQueue.peek().getEventType();
- }
-
- public String getText() {
- return eventQueue.peek().getText();
- }
-
- public char[] getTextCharacters() {
- return eventQueue.peek().getTextCharacters();
- }
-
- public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
- return eventQueue.peek().getTextCharacters(sourceStart, target, targetStart, length);
- }
-
- public int getTextStart() {
- return eventQueue.peek().getTextStart();
- }
-
- public int getTextLength() {
- return eventQueue.peek().getTextLength();
- }
-
- public String getEncoding() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean hasText() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public Location getLocation() {
- return eventQueue.peek().getLocation();
- }
-
- public QName getName() {
- return eventQueue.peek().getName();
- }
-
- public String getLocalName() {
- return eventQueue.peek().getLocalName();
- }
-
- public boolean hasName() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getNamespaceURI() {
- return eventQueue.peek().getName().getNamespaceURI();
- }
-
- public String getPrefix() {
- return eventQueue.peek().getPrefix();
- }
-
- public String getVersion() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean isStandalone() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean standaloneSet() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getCharacterEncodingScheme() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getPITarget() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getPIData() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.java
deleted file mode 100644
index 273edcb1366..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import org.codehaus.jackson.Base64Variant;
-import org.codehaus.jackson.JsonLocation;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.JsonStreamContext;
-import org.codehaus.jackson.JsonToken;
-import org.codehaus.jackson.ObjectCodec;
-import org.codehaus.jackson.type.TypeReference;
-
-/**
- *
- * @author japod
- */
-public class JacksonRootAddingParser extends JsonParser {
-
- enum State { START, AFTER_SO, AFTER_FN, INNER, END };
-
- String rootName;
- JsonParser parser;
- State state;
- boolean isClosed = false;
-
- public static JsonParser createRootAddingParser(JsonParser parser, String rootName) {
- return new JacksonRootAddingParser(parser, rootName);
- }
-
- private JacksonRootAddingParser(){}
-
- private JacksonRootAddingParser(JsonParser parser, String rootName) {
- this.parser = parser;
- this.state = State.START;
- this.rootName = rootName;
- }
-
- @Override
- public void enableFeature(Feature feature) {
- parser.enableFeature(feature);
- }
-
- @Override
- public void disableFeature(Feature feature) {
- parser.disableFeature(feature);
- }
-
- @Override
- public void setFeature(Feature feature, boolean isSet) {
- parser.setFeature(feature, isSet);
- }
-
- @Override
- public JsonToken nextValue() throws IOException, JsonParseException {
- JsonToken result = nextToken();
- while (!result.isScalarValue()) {
- result = nextToken();
- }
- return result;
- }
-
- @Override
- public boolean isClosed() {
- return isClosed;
- }
-
- @Override
- public byte getByteValue() throws IOException, JsonParseException {
- return parser.getByteValue();
- }
-
- @Override
- public short getShortValue() throws IOException, JsonParseException {
- return parser.getShortValue();
- }
-
- @Override
- public BigInteger getBigIntegerValue() throws IOException, JsonParseException {
- return parser.getBigIntegerValue();
- }
-
- @Override
- public float getFloatValue() throws IOException, JsonParseException {
- return parser.getFloatValue();
- }
-
- @Override
- public byte[] getBinaryValue(Base64Variant base64Variant) throws IOException, JsonParseException {
- return parser.getBinaryValue(base64Variant);
- }
-
- @Override
- public <T> T readValueAs(Class<T> type) throws IOException, JsonProcessingException {
- return parser.readValueAs(type);
- }
-
- @Override
- public <T> T readValueAs(TypeReference<?> typeRef) throws IOException, JsonProcessingException {
- return (T)parser.readValueAs(typeRef);
- }
-
- @Override
- public JsonNode readValueAsTree() throws IOException, JsonProcessingException {
- return parser.readValueAsTree();
- }
-
- @Override
- public JsonStreamContext getParsingContext() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public JsonToken nextToken() throws IOException, JsonParseException {
- switch (state) {
- case START :
- state = State.AFTER_SO;
- _currToken = JsonToken.START_OBJECT;
- return _currToken;
- case AFTER_SO :
- state = State.AFTER_FN;
- _currToken = JsonToken.FIELD_NAME;
- return _currToken;
- case AFTER_FN :
- state = State.INNER;
- case INNER :
- _currToken = parser.nextToken();
- if (_currToken == null) {
- state = State.END;
- _currToken = JsonToken.END_OBJECT;
- }
- return _currToken;
- case END :
- default :
- _currToken = null;
- return _currToken;
- }
- }
-
- @Override
- public JsonParser skipChildren() throws IOException, JsonParseException {
- return parser.skipChildren();
- }
-
- @Override
- public String getCurrentName() throws IOException, JsonParseException {
- switch (state) {
- case START :
- return null;
- case AFTER_SO :
- return null;
- case AFTER_FN :
- return rootName;
- case INNER :
- return parser.getCurrentName();
- default:
- return null;
- }
- }
-
- @Override
- public void close() throws IOException {
- parser.close();
- }
-
- @Override
- public JsonLocation getTokenLocation() {
- return parser.getTokenLocation();
- }
-
- @Override
- public JsonLocation getCurrentLocation() {
- return parser.getCurrentLocation();
- }
-
- @Override
- public String getText() throws IOException, JsonParseException {
- return parser.getText();
- }
-
- @Override
- public char[] getTextCharacters() throws IOException, JsonParseException {
- return parser.getTextCharacters();
- }
-
- @Override
- public int getTextLength() throws IOException, JsonParseException {
- return parser.getTextLength();
- }
-
- @Override
- public int getTextOffset() throws IOException, JsonParseException {
- return parser.getTextOffset();
- }
-
- @Override
- public Number getNumberValue() throws IOException, JsonParseException {
- return parser.getNumberValue();
- }
-
- @Override
- public NumberType getNumberType() throws IOException, JsonParseException {
- return parser.getNumberType();
- }
-
- @Override
- public int getIntValue() throws IOException, JsonParseException {
- return parser.getIntValue();
- }
-
- @Override
- public long getLongValue() throws IOException, JsonParseException {
- return parser.getLongValue();
- }
-
- @Override
- public double getDoubleValue() throws IOException, JsonParseException {
- return parser.getDoubleValue();
- }
-
- @Override
- public BigDecimal getDecimalValue() throws IOException, JsonParseException {
- return parser.getDecimalValue();
- }
-
- @Override
- public ObjectCodec getCodec() {
- return parser.getCodec();
- }
-
- @Override
- public void setCodec(ObjectCodec c) {
- parser.setCodec(c);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonLexer.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonLexer.java
deleted file mode 100644
index 7612b49d72d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonLexer.java
+++ /dev/null
@@ -1,743 +0,0 @@
-/* The following code was generated by JFlex 1.4.3 on 6/24/11 12:28 PM */
-
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2007-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.reader;
-
-/**
- * This class is a scanner generated by
- * <a href="http://www.jflex.de/">JFlex</a> 1.4.3
- * on 6/24/11 12:28 PM from the specification file
- * <tt>/export/home/jerseyrobot/autowork/jersey/jersey-json/src/main/jflex/json.flex</tt>
- */
-class JsonLexer {
-
- /** This character denotes the end of file */
- public static final int YYEOF = -1;
-
- /** initial size of the lookahead buffer */
- private static final int ZZ_BUFFERSIZE = 16384;
-
- /** lexical states */
- public static final int STRING = 2;
- public static final int YYINITIAL = 0;
-
- /**
- * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
- * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
- * at the beginning of a line
- * l is of the form l = 2*k, k a non negative integer
- */
- private static final int ZZ_LEXSTATE[] = {
- 0, 0, 1, 1
- };
-
- /**
- * Translates characters to character classes
- */
- private static final String ZZ_CMAP_PACKED =
- "\10\0\2\1\1\31\2\0\1\31\22\0\1\1\1\0\1\27\10\0"+
- "\1\7\1\10\1\2\1\5\1\32\1\3\11\4\1\11\6\0\4\34"+
- "\1\6\1\34\24\0\1\12\1\30\1\13\3\0\1\23\1\33\2\34"+
- "\1\21\1\22\5\0\1\24\1\0\1\26\3\0\1\17\1\25\1\16"+
- "\1\20\5\0\1\14\1\0\1\15\uff82\0";
-
- /**
- * Translates characters to character classes
- */
- private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
-
- /**
- * Translates DFA states to action switch labels.
- */
- private static final int [] ZZ_ACTION = zzUnpackAction();
-
- private static final String ZZ_ACTION_PACKED_0 =
- "\2\0\1\1\1\0\2\2\1\3\1\4\1\5\1\6"+
- "\1\7\1\10\3\0\1\11\1\12\1\13\6\0\1\14"+
- "\1\15\1\0\1\16\1\17\1\20\1\21\1\22\1\23"+
- "\1\2\1\0\1\2\4\0\1\24\1\0\1\25\1\0"+
- "\1\26\1\0\1\27";
-
- private static int [] zzUnpackAction() {
- int [] result = new int[47];
- int offset = 0;
- offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackAction(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- do result[j++] = value; while (--count > 0);
- }
- return j;
- }
-
-
- /**
- * Translates a state to a row index in the transition table
- */
- private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
-
- private static final String ZZ_ROWMAP_PACKED_0 =
- "\0\0\0\35\0\72\0\127\0\164\0\221\0\72\0\72"+
- "\0\72\0\72\0\72\0\72\0\256\0\313\0\350\0\72"+
- "\0\u0105\0\72\0\u0122\0\u013f\0\u015c\0\u0179\0\u0196\0\u01b3"+
- "\0\72\0\72\0\u01d0\0\72\0\72\0\72\0\72\0\72"+
- "\0\72\0\u01ed\0\u020a\0\u020a\0\u0227\0\u0244\0\u0261\0\u027e"+
- "\0\72\0\u029b\0\72\0\u02b8\0\72\0\u02d5\0\72";
-
- private static int [] zzUnpackRowMap() {
- int [] result = new int[47];
- int offset = 0;
- offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackRowMap(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int high = packed.charAt(i++) << 16;
- result[j++] = high | packed.charAt(i++);
- }
- return j;
- }
-
- /**
- * The transition table of the DFA
- */
- private static final int [] ZZ_TRANS = zzUnpackTrans();
-
- private static final String ZZ_TRANS_PACKED_0 =
- "\1\0\1\3\1\4\1\5\1\6\3\0\1\7\1\10"+
- "\1\11\1\12\1\13\1\14\1\15\3\0\1\16\3\0"+
- "\1\17\1\20\1\0\1\3\3\0\27\21\1\22\1\23"+
- "\1\0\3\21\40\0\1\5\1\6\35\0\1\24\1\25"+
- "\12\0\1\25\16\0\2\6\1\24\1\25\12\0\1\25"+
- "\32\0\1\26\40\0\1\27\31\0\1\30\14\0\27\21"+
- "\3\0\3\21\16\0\1\31\1\32\1\33\1\0\1\34"+
- "\3\0\1\35\1\36\1\37\1\0\1\40\1\41\4\0"+
- "\2\42\32\0\1\43\2\44\2\0\1\43\45\0\1\45"+
- "\40\0\1\46\34\0\1\47\13\0\2\50\1\0\1\50"+
- "\12\0\3\50\7\0\2\50\3\0\2\42\1\0\1\25"+
- "\12\0\1\25\16\0\2\44\51\0\1\51\40\0\1\52"+
- "\33\0\1\53\13\0\2\54\1\0\1\54\12\0\3\54"+
- "\7\0\2\54\21\0\1\55\16\0\2\56\1\0\1\56"+
- "\12\0\3\56\7\0\2\56\3\0\2\57\1\0\1\57"+
- "\12\0\3\57\7\0\2\57";
-
- private static int [] zzUnpackTrans() {
- int [] result = new int[754];
- int offset = 0;
- offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackTrans(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- value--;
- do result[j++] = value; while (--count > 0);
- }
- return j;
- }
-
-
- /* error codes */
- private static final int ZZ_UNKNOWN_ERROR = 0;
- private static final int ZZ_NO_MATCH = 1;
- private static final int ZZ_PUSHBACK_2BIG = 2;
-
- /* error messages for the codes above */
- private static final String ZZ_ERROR_MSG[] = {
- "Unkown internal scanner error",
- "Error: could not match input",
- "Error: pushback value was too large"
- };
-
- /**
- * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
- */
- private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
-
- private static final String ZZ_ATTRIBUTE_PACKED_0 =
- "\2\0\1\11\1\0\2\1\6\11\3\0\1\11\1\1"+
- "\1\11\6\0\2\11\1\0\6\11\1\1\1\0\1\1"+
- "\4\0\1\11\1\0\1\11\1\0\1\11\1\0\1\11";
-
- private static int [] zzUnpackAttribute() {
- int [] result = new int[47];
- int offset = 0;
- offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
- return result;
- }
-
- private static int zzUnpackAttribute(String packed, int offset, int [] result) {
- int i = 0; /* index in packed string */
- int j = offset; /* index in unpacked array */
- int l = packed.length();
- while (i < l) {
- int count = packed.charAt(i++);
- int value = packed.charAt(i++);
- do result[j++] = value; while (--count > 0);
- }
- return j;
- }
-
- /** the input device */
- private java.io.Reader zzReader;
-
- /** the current state of the DFA */
- private int zzState;
-
- /** the current lexical state */
- private int zzLexicalState = YYINITIAL;
-
- /** this buffer contains the current text to be matched and is
- the source of the yytext() string */
- private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
-
- /** the textposition at the last accepting state */
- private int zzMarkedPos;
-
- /** the current text position in the buffer */
- private int zzCurrentPos;
-
- /** startRead marks the beginning of the yytext() string in the buffer */
- private int zzStartRead;
-
- /** endRead marks the last character in the buffer, that has been read
- from input */
- private int zzEndRead;
-
- /** number of newlines encountered up to the start of the matched text */
- private int yyline;
-
- /** the number of characters up to the start of the matched text */
- private int yychar;
-
- /**
- * the number of characters from the last newline up to the start of the
- * matched text
- */
- private int yycolumn;
-
- /**
- * zzAtBOL == true <=> the scanner is currently at the beginning of a line
- */
- private boolean zzAtBOL = true;
-
- /** zzAtEOF == true <=> the scanner is at the EOF */
- private boolean zzAtEOF;
-
- /** denotes if the user-EOF-code has already been executed */
- private boolean zzEOFDone;
-
- /* user code: */
- StringBuffer string = new StringBuffer();
- public int getCharOffset() { return yychar; }
- public int getLineNumber() { return yyline; }
- public int getColumn() { return yycolumn; }
-
-
- /**
- * Creates a new scanner
- * There is also a java.io.InputStream version of this constructor.
- *
- * @param in the java.io.Reader to read input from.
- */
- JsonLexer(java.io.Reader in) {
- this.zzReader = in;
- }
-
- /**
- * Creates a new scanner.
- * There is also java.io.Reader version of this constructor.
- *
- * @param in the java.io.Inputstream to read input from.
- */
- JsonLexer(java.io.InputStream in) {
- this(new java.io.InputStreamReader(in));
- }
-
- /**
- * Unpacks the compressed character translation table.
- *
- * @param packed the packed character translation table
- * @return the unpacked character translation table
- */
- private static char [] zzUnpackCMap(String packed) {
- char [] map = new char[0x10000];
- int i = 0; /* index in packed string */
- int j = 0; /* index in unpacked array */
- while (i < 92) {
- int count = packed.charAt(i++);
- char value = packed.charAt(i++);
- do map[j++] = value; while (--count > 0);
- }
- return map;
- }
-
-
- /**
- * Refills the input buffer.
- *
- * @return <code>false</code>, iff there was new input.
- *
- * @exception java.io.IOException if any I/O-Error occurs
- */
- private boolean zzRefill() throws java.io.IOException {
-
- /* first: make room (if you can) */
- if (zzStartRead > 0) {
- System.arraycopy(zzBuffer, zzStartRead,
- zzBuffer, 0,
- zzEndRead-zzStartRead);
-
- /* translate stored positions */
- zzEndRead-= zzStartRead;
- zzCurrentPos-= zzStartRead;
- zzMarkedPos-= zzStartRead;
- zzStartRead = 0;
- }
-
- /* is the buffer big enough? */
- if (zzCurrentPos >= zzBuffer.length) {
- /* if not: blow it up */
- char newBuffer[] = new char[zzCurrentPos*2];
- System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
- zzBuffer = newBuffer;
- }
-
- /* finally: fill the buffer with new input */
- int numRead = zzReader.read(zzBuffer, zzEndRead,
- zzBuffer.length-zzEndRead);
-
- if (numRead > 0) {
- zzEndRead+= numRead;
- return false;
- }
- // unlikely but not impossible: read 0 characters, but not at end of stream
- if (numRead == 0) {
- int c = zzReader.read();
- if (c == -1) {
- return true;
- } else {
- zzBuffer[zzEndRead++] = (char) c;
- return false;
- }
- }
-
- // numRead < 0
- return true;
- }
-
-
- /**
- * Closes the input stream.
- */
- public final void yyclose() throws java.io.IOException {
- zzAtEOF = true; /* indicate end of file */
- zzEndRead = zzStartRead; /* invalidate buffer */
-
- if (zzReader != null)
- zzReader.close();
- }
-
-
- /**
- * Resets the scanner to read from a new input stream.
- * Does not close the old reader.
- *
- * All internal variables are reset, the old input stream
- * <b>cannot</b> be reused (internal buffer is discarded and lost).
- * Lexical state is set to <tt>ZZ_INITIAL</tt>.
- *
- * @param reader the new input stream
- */
- public final void yyreset(java.io.Reader reader) {
- zzReader = reader;
- zzAtBOL = true;
- zzAtEOF = false;
- zzEOFDone = false;
- zzEndRead = zzStartRead = 0;
- zzCurrentPos = zzMarkedPos = 0;
- yyline = yychar = yycolumn = 0;
- zzLexicalState = YYINITIAL;
- }
-
-
- /**
- * Returns the current lexical state.
- */
- public final int yystate() {
- return zzLexicalState;
- }
-
-
- /**
- * Enters a new lexical state
- *
- * @param newState the new lexical state
- */
- public final void yybegin(int newState) {
- zzLexicalState = newState;
- }
-
-
- /**
- * Returns the text matched by the current regular expression.
- */
- public final String yytext() {
- return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
- }
-
-
- /**
- * Returns the character at position <tt>pos</tt> from the
- * matched text.
- *
- * It is equivalent to yytext().charAt(pos), but faster
- *
- * @param pos the position of the character to fetch.
- * A value from 0 to yylength()-1.
- *
- * @return the character at position pos
- */
- public final char yycharat(int pos) {
- return zzBuffer[zzStartRead+pos];
- }
-
-
- /**
- * Returns the length of the matched text region.
- */
- public final int yylength() {
- return zzMarkedPos-zzStartRead;
- }
-
-
- /**
- * Reports an error that occured while scanning.
- *
- * In a wellformed scanner (no or only correct usage of
- * yypushback(int) and a match-all fallback rule) this method
- * will only be called with things that "Can't Possibly Happen".
- * If this method is called, something is seriously wrong
- * (e.g. a JFlex bug producing a faulty scanner etc.).
- *
- * Usual syntax/scanner level error handling should be done
- * in error fallback rules.
- *
- * @param errorCode the code of the errormessage to display
- */
- private void zzScanError(int errorCode) {
- String message;
- try {
- message = ZZ_ERROR_MSG[errorCode];
- }
- catch (ArrayIndexOutOfBoundsException e) {
- message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
- }
-
- throw new Error(message);
- }
-
-
- /**
- * Pushes the specified amount of characters back into the input stream.
- *
- * They will be read again by then next call of the scanning method
- *
- * @param number the number of characters to be read again.
- * This number must not be greater than yylength()!
- */
- public void yypushback(int number) {
- if ( number > yylength() )
- zzScanError(ZZ_PUSHBACK_2BIG);
-
- zzMarkedPos -= number;
- }
-
-
- /**
- * Resumes scanning until the next regular expression is matched,
- * the end of input is encountered or an I/O-Error occurs.
- *
- * @return the next token
- * @exception java.io.IOException if any I/O-Error occurs
- */
- public JsonToken yylex() throws java.io.IOException {
- int zzInput;
- int zzAction;
-
- // cached fields:
- int zzCurrentPosL;
- int zzMarkedPosL;
- int zzEndReadL = zzEndRead;
- char [] zzBufferL = zzBuffer;
- char [] zzCMapL = ZZ_CMAP;
-
- int [] zzTransL = ZZ_TRANS;
- int [] zzRowMapL = ZZ_ROWMAP;
- int [] zzAttrL = ZZ_ATTRIBUTE;
-
- while (true) {
- zzMarkedPosL = zzMarkedPos;
-
- yychar+= zzMarkedPosL-zzStartRead;
-
- boolean zzR = false;
- for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL;
- zzCurrentPosL++) {
- switch (zzBufferL[zzCurrentPosL]) {
- case '\u000B':
- case '\u000C':
- case '\u0085':
- case '\u2028':
- case '\u2029':
- yyline++;
- zzR = false;
- break;
- case '\r':
- yyline++;
- zzR = true;
- break;
- case '\n':
- if (zzR)
- zzR = false;
- else {
- yyline++;
- }
- break;
- default:
- zzR = false;
- }
- }
-
- if (zzR) {
- // peek one character ahead if it is \n (if we have counted one line too much)
- boolean zzPeek;
- if (zzMarkedPosL < zzEndReadL)
- zzPeek = zzBufferL[zzMarkedPosL] == '\n';
- else if (zzAtEOF)
- zzPeek = false;
- else {
- boolean eof = zzRefill();
- zzEndReadL = zzEndRead;
- zzMarkedPosL = zzMarkedPos;
- zzBufferL = zzBuffer;
- if (eof)
- zzPeek = false;
- else
- zzPeek = zzBufferL[zzMarkedPosL] == '\n';
- }
- if (zzPeek) yyline--;
- }
- zzAction = -1;
-
- zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
-
- zzState = ZZ_LEXSTATE[zzLexicalState];
-
-
- zzForAction: {
- while (true) {
-
- if (zzCurrentPosL < zzEndReadL)
- zzInput = zzBufferL[zzCurrentPosL++];
- else if (zzAtEOF) {
- zzInput = YYEOF;
- break zzForAction;
- }
- else {
- // store back cached positions
- zzCurrentPos = zzCurrentPosL;
- zzMarkedPos = zzMarkedPosL;
- boolean eof = zzRefill();
- // get translated positions and possibly new buffer
- zzCurrentPosL = zzCurrentPos;
- zzMarkedPosL = zzMarkedPos;
- zzBufferL = zzBuffer;
- zzEndReadL = zzEndRead;
- if (eof) {
- zzInput = YYEOF;
- break zzForAction;
- }
- else {
- zzInput = zzBufferL[zzCurrentPosL++];
- }
- }
- int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
- if (zzNext == -1) break zzForAction;
- zzState = zzNext;
-
- int zzAttributes = zzAttrL[zzState];
- if ( (zzAttributes & 1) == 1 ) {
- zzAction = zzState;
- zzMarkedPosL = zzCurrentPosL;
- if ( (zzAttributes & 8) == 8 ) break zzForAction;
- }
-
- }
- }
-
- // store back cached position
- zzMarkedPos = zzMarkedPosL;
-
- switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
- case 23:
- { string.append(Character.toChars(Integer.parseInt(yytext().substring(2),16)));
- }
- case 24: break;
- case 15:
- { string.append('\n');
- }
- case 25: break;
- case 6:
- { return (new JsonToken(JsonToken.END_ARRAY, yytext(), yyline, yychar, yychar+1));
- }
- case 26: break;
- case 7:
- { return (new JsonToken(JsonToken.START_OBJECT, yytext(), yyline, yychar, yychar+1));
- }
- case 27: break;
- case 3:
- { return (new JsonToken(JsonToken.COMMA, yytext(), yyline, yychar, yychar+1));
- }
- case 28: break;
- case 4:
- { return (new JsonToken(JsonToken.COLON, yytext(), yyline, yychar, yychar+1));
- }
- case 29: break;
- case 19:
- { string.append('\b');
- }
- case 30: break;
- case 8:
- { return (new JsonToken(JsonToken.END_OBJECT, yytext(), yyline, yychar, yychar+1));
- }
- case 31: break;
- case 21:
- { return (new JsonToken(JsonToken.NULL, yytext(), yyline, yychar, yychar+yylength()));
- }
- case 32: break;
- case 18:
- { string.append('/');
- }
- case 33: break;
- case 17:
- { string.append('\\');
- }
- case 34: break;
- case 22:
- { return (new JsonToken(JsonToken.FALSE, yytext(), yyline, yychar, yychar+yylength()));
- }
- case 35: break;
- case 9:
- { string.setLength(0); yybegin(STRING);
- }
- case 36: break;
- case 11:
- { yybegin(YYINITIAL);
- return (new JsonToken(JsonToken.STRING, string.toString(), yyline, yychar, yychar+string.length()));
- }
- case 37: break;
- case 2:
- { return (new JsonToken(JsonToken.NUMBER, yytext(), yyline, yychar, yychar+yylength()));
- }
- case 38: break;
- case 20:
- { return (new JsonToken(JsonToken.TRUE, yytext(), yyline, yychar, yychar+yylength()));
- }
- case 39: break;
- case 13:
- { string.append('\r');
- }
- case 40: break;
- case 10:
- { string.append(yytext());
- }
- case 41: break;
- case 16:
- { string.append('\"');
- }
- case 42: break;
- case 14:
- { string.append('\f');
- }
- case 43: break;
- case 5:
- { return (new JsonToken(JsonToken.START_ARRAY, yytext(), yyline, yychar, yychar+1));
- }
- case 44: break;
- case 12:
- { string.append('\t');
- }
- case 45: break;
- case 1:
- {
- }
- case 46: break;
- default:
- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
- zzAtEOF = true;
- return null;
- }
- else {
- zzScanError(ZZ_NO_MATCH);
- }
- }
- }
- }
-
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonNamespaceContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonNamespaceContext.java
deleted file mode 100644
index d61a86557bb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonNamespaceContext.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import javax.xml.namespace.NamespaceContext;
-
-/**
- *
- * @author japod
- */
-public class JsonNamespaceContext implements NamespaceContext {
-
- static final String PrefixPREFIX = "ns";
-
- private final Map<String, String> ns2pMap = new HashMap<String, String>();
- private final Map<String, String> p2nsMap = new HashMap<String, String>();
- private int nsCount = 0;
-
- protected int getNamespaceCount() {
- return nsCount;
- }
-
- public String getNamespaceURI(String prefix) {
- if (p2nsMap.containsKey(prefix)) {
- return p2nsMap.get(prefix);
- }
- return null;
- }
-
- public String getPrefix(String namespaceURI) {
- if (ns2pMap.containsKey(namespaceURI)) {
- return ns2pMap.get(namespaceURI);
- } else {
- final String newPrefix = PrefixPREFIX + ++nsCount;
- ns2pMap.put(namespaceURI, newPrefix);
- p2nsMap.put(newPrefix, namespaceURI);
- return newPrefix;
- }
- }
-
- public Iterator getPrefixes(String namespaceURI) {
- return p2nsMap.keySet().iterator();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.java
deleted file mode 100644
index 75134f189dd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.NoSuchElementException;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
-
-/**
- *
- * @author japod
- */
-public abstract class JsonReaderXmlEvent {
-
- public static class Attribute {
- QName name;
- String value;
-
- public Attribute(QName name, String value) {
- this.name = name;
- this.value = value;
- }
- }
-
- Location location;
- QName name;
- String text;
- List<Attribute> attributes;
- boolean attributesChecked;
-
- public abstract int getEventType();
-
- public boolean isAttribute() {
- return false;
- }
-
- public boolean isCharacters() {
- return false;
- }
-
- public boolean isEndDocument() {
- return false;
- }
-
- public boolean isEndElement() {
- return false;
- }
-
- public boolean isEntityReference() {
- return false;
- }
-
- public boolean isNamespace() {
- return false;
- }
-
- public boolean isProcessingInstruction() {
- return false;
- }
-
- public boolean isStartDocument() {
- return false;
- }
-
- public boolean isStartElement() {
- return false;
- }
-
- public int getAttributeCount() {
- return (null != attributes) ? attributes.size() : 0;
- }
-
- public String getAttributeLocalName(int index) {
- return getAttributeName(index).getLocalPart();
- }
-
- public QName getAttributeName(int index) {
- if ((null == attributes) || (index >= attributes.size())) {
- throw new IndexOutOfBoundsException();
- }
- return attributes.get(index).name;
- }
-
- public String getAttributePrefix(int index) {
- return getAttributeName(index).getPrefix();
- }
-
- public String getAttributeType(int index) {
- return null;
- }
-
- public String getAttributeNamespace(int index) {
- return getAttributeName(index).getNamespaceURI();
- }
-
- public String getAttributeValue(int index) {
- if ((null == attributes) || (index >= attributes.size())) {
- throw new IndexOutOfBoundsException();
- }
- return attributes.get(index).value;
- }
-
- public String getAttributeValue(String namespaceURI, String localName) {
- if ((null == attributes) || (null == localName) || ("".equals(localName))) {
- throw new NoSuchElementException();
- }
- final QName askedFor = new QName(namespaceURI, localName);
- for (Attribute a : attributes) {
- if (askedFor.equals(a.name)) {
- return a.value;
- }
- }
- throw new NoSuchElementException();
- }
-
- public boolean isAttributeSpecified(int index) {
- return (null != attributes) && (attributes.size() >= index);
- }
-
- public String getText() {
- if (null != text) {
- return text;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public char[] getTextCharacters() {
- if (null != text) {
- return text.toCharArray();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
- if (null != text) {
- System.arraycopy(text.toCharArray(), sourceStart, target, targetStart, length);
- return length;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextStart() {
- if (null != text) {
- return 0;
- } else {
- throw new IllegalStateException();
- }
- }
-
- public int getTextLength() {
- if (null != text) {
- return text.length();
- } else {
- throw new IllegalStateException();
- }
- }
-
- public boolean hasName() {
- return null != name;
- }
-
- public QName getName() {
- if (null != name) {
- return name;
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
- public String getLocalName() {
- if (null != name) {
- return name.getLocalPart();
- } else {
- throw new UnsupportedOperationException();
- }
- }
-
- public String getPrefix() {
- if (null != name) {
- return name.getPrefix();
- } else {
- return null;
- }
- }
-
- public Location getLocation() {
- return location;
- }
-
- public void addAttribute(QName name, String value) {
- if (null == attributes) {
- attributes = new LinkedList<JsonReaderXmlEvent.Attribute>();
- }
- attributes.add(new Attribute(name, value));
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonToken.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonToken.java
deleted file mode 100644
index e979094e153..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonToken.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-/**
- *
- * @author japod
- */
-class JsonToken {
-
- public static final int START_OBJECT = 1;
- public static final int END_OBJECT = 2;
- public static final int START_ARRAY = 3;
- public static final int END_ARRAY = 4;
- public static final int COLON = 5;
- public static final int COMMA = 6;
- public static final int STRING = 7;
- public static final int NUMBER = 8;
- public static final int TRUE = 9;
- public static final int FALSE = 10;
- public static final int NULL = 11;
-
- public int tokenType;
- public String tokenText;
- public int line;
- public int charBegin;
- public int charEnd;
-
- JsonToken(int tokenType, String text, int line, int charBegin, int charEnd) {
- this.tokenType = tokenType;
- this.tokenText = text;
- this.line = line;
- this.charBegin = charBegin;
- this.charEnd = charEnd;
- }
-
- @Override
- public String toString() {
- return "(token|" + tokenType + "|" + tokenText + ")";
- }
-}
-
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.java
deleted file mode 100644
index 7beca60ba01..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.java
+++ /dev/null
@@ -1,729 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-/**
- *
- * @author japod
- */
-public class JsonXmlStreamReader implements XMLStreamReader {
-
-
- private enum LaState {
- START,
- END,
- AFTER_OBJ_START_BRACE,
- BEFORE_OBJ_NEXT_KV_PAIR,
- BEFORE_COLON_IN_KV_PAIR,
- BEFORE_VALUE_IN_KV_PAIR,
- AFTER_OBJ_KV_PAIR,
- AFTER_ARRAY_START_BRACE,
- BEFORE_NEXT_ARRAY_ELEM,
- AFTER_ARRAY_ELEM
- };
-
- private static final Logger LOGGER = Logger.getLogger(JsonXmlStreamReader.class.getName());
-
- boolean jsonRootUnwrapping;
- String rootElementName;
- char nsSeparator;
- CharSequence nsSeparatorAsSequence;
- final Map<String, String> revertedXml2JsonNs = new HashMap<String, String>();
- final Collection<String> attrAsElemNames = new LinkedList<String>();
-
- JsonLexer lexer;
- JsonToken lastToken;
-
- private static final class ProcessingState {
- String lastName;
- LaState state;
- JsonReaderXmlEvent eventToReadAttributesFor;
-
- ProcessingState() {
- this(LaState.START);
- }
-
- ProcessingState(LaState state) {
- this(state, null);
- }
-
- ProcessingState(LaState state, String name) {
- this.state = state;
- this.lastName = name;
- }
-
- @Override
- public String toString() {
- return String.format("{lastName:%s,laState:%s}", lastName, state);
- }
- }
-
- final Queue<JsonReaderXmlEvent> eventQueue = new LinkedList<JsonReaderXmlEvent>();
-
- List<ProcessingState> processingStack;
- int depth;
-
- public JsonXmlStreamReader(Reader reader, JSONConfiguration config) throws IOException {
- this(reader, config.isRootUnwrapping() ? "rootElement" : null, config);
- }
-
- public JsonXmlStreamReader(Reader reader, String rootElementName) throws IOException {
- this(reader, rootElementName, JSONConfiguration.DEFAULT);
- }
-
- public JsonXmlStreamReader(Reader reader, String rootElementName, JSONConfiguration config) throws IOException {
- this.jsonRootUnwrapping = (rootElementName != null);
- this.rootElementName = rootElementName;
- if (config.getAttributeAsElements() != null) {
- this.attrAsElemNames.addAll(config.getAttributeAsElements());
- }
- if (config.getXml2JsonNs() != null) {
- for (String uri : config.getXml2JsonNs().keySet())
- revertedXml2JsonNs.put(config.getXml2JsonNs().get(uri), uri);
- }
- nsSeparator = config.getNsSeparator();
- nsSeparatorAsSequence = new StringBuffer(1).append(nsSeparator);
- lexer = new JsonLexer(reader);
- depth = 0;
- processingStack = new ArrayList<ProcessingState>();
- processingStack.add(new ProcessingState());
- readNext();
- }
-
- void colon() throws IOException {
- JsonToken token = nextToken();
- if (token.tokenType != JsonToken.COLON) {
- throw new IOException("Colon expected instead of \"" + token.tokenText + "\"");
- }
- }
-
- JsonToken nextToken() throws IOException {
- JsonToken result = lexer.yylex();
- return result;
- }
-
- private void valueRead() {
- if (LaState.BEFORE_VALUE_IN_KV_PAIR == processingStack.get(depth).state) {
- processingStack.get(depth).state = LaState.AFTER_OBJ_KV_PAIR;
- } else if (LaState.BEFORE_NEXT_ARRAY_ELEM == processingStack.get(depth).state) {
- processingStack.get(depth).state = LaState.AFTER_ARRAY_ELEM;
- } else if (LaState.AFTER_ARRAY_START_BRACE == processingStack.get(depth).state) {
- processingStack.get(depth).state = LaState.AFTER_ARRAY_ELEM;
- }
- }
-
- private static final Set<Integer> valueTokenTypes = new HashSet<Integer>() {{
- add(JsonToken.FALSE); add(JsonToken.TRUE); add(JsonToken.NULL); add(JsonToken.NUMBER);add(JsonToken.STRING);}};
-
- private void readNext() throws IOException {
- readNext(false);
- }
-
- private void readNext(boolean checkAttributesOnly) throws IOException {
- if (!checkAttributesOnly) {
- eventQueue.poll();
- }
- //boolean attributesStarted = false;
- while (eventQueue.isEmpty() || checkAttributesOnly) {
- lastToken = nextToken();
- if ((null == lastToken) || (LaState.END == processingStack.get(depth).state)){
- if (jsonRootUnwrapping) {
- generateEEEvent(processingStack.get(depth).lastName);
- }
- eventQueue.add(new EndDocumentEvent(new StaxLocation(lexer)));
- break;
- }
- switch (processingStack.get(depth).state) {
- case START:
- if (0 == depth) {
- eventQueue.add(new StartDocumentEvent(new StaxLocation(lexer)));
- processingStack.get(depth).state = LaState.AFTER_OBJ_START_BRACE;
- if (jsonRootUnwrapping) {
- processingStack.get(depth).lastName = this.rootElementName;
- StartElementEvent event = generateSEEvent(processingStack.get(depth).lastName);
- processingStack.get(depth).eventToReadAttributesFor = event;
- }
- switch (lastToken.tokenType) {
- case JsonToken.START_OBJECT:
- processingStack.add(new ProcessingState(LaState.AFTER_OBJ_START_BRACE));
- depth++;
- break;
- case JsonToken.START_ARRAY:
- processingStack.add(new ProcessingState(LaState.AFTER_ARRAY_START_BRACE));
- depth++;
- break;
- case JsonToken.STRING:
- case JsonToken.NUMBER:
- case JsonToken.TRUE:
- case JsonToken.FALSE:
- case JsonToken.NULL:
- eventQueue.add(new CharactersEvent(lastToken.tokenText, new StaxLocation(lexer)));
- processingStack.get(depth).state = LaState.END;
- break;
- default:
- // TODO: handle problem
- }
- }
- // TODO: if JsonToken.START_OBJECT != lastToken then problem
- processingStack.get(depth).state = LaState.AFTER_OBJ_START_BRACE;
- break;
- case AFTER_OBJ_START_BRACE:
- switch (lastToken.tokenType) {
- case JsonToken.STRING:
- if (lastToken.tokenText.startsWith("@") || attrAsElemNames.contains(lastToken.tokenText)) { // eat attribute
- String attrName = lastToken.tokenText.startsWith("@") ? lastToken.tokenText : ("@" + lastToken.tokenText);
- colon();
- lastToken = nextToken();
- // TODO process attr value
- if (!valueTokenTypes.contains(lastToken.tokenType)) {
- throw new IOException("Attribute value expected instead of \"" + lastToken.tokenText + "\"");
- }
- if (null != processingStack.get(depth - 1).eventToReadAttributesFor) {
- processingStack.get(depth - 1).eventToReadAttributesFor.addAttribute(
- createQName(attrName.substring(1)), lastToken.tokenText);
- }
- lastToken = nextToken();
- switch (lastToken.tokenType) {
- case JsonToken.END_OBJECT:
- processingStack.remove(depth);
- depth--;
- valueRead();
- checkAttributesOnly = false;
- break;
- case JsonToken.COMMA:
- break;
- default:
- throw new IOException("\'\"\', or \'}\' expected instead of \"" + lastToken.tokenText + "\"");
- }
- } else { // non attribute
- StartElementEvent event =
- generateSEEvent(lastToken.tokenText);
- processingStack.get(depth).eventToReadAttributesFor = event;
- checkAttributesOnly = false;
- processingStack.get(depth).lastName = lastToken.tokenText;
- colon();
- processingStack.get(depth).state = LaState.BEFORE_VALUE_IN_KV_PAIR;
- }
- break;
- case JsonToken.END_OBJECT: // empty object/element
- generateEEEvent(processingStack.get(depth).lastName);
- checkAttributesOnly = false;
- processingStack.remove(depth);
- depth--;
- valueRead();
- break;
- default:
- // TODO: handle problem
- }
- break;
- case BEFORE_OBJ_NEXT_KV_PAIR:
- switch (lastToken.tokenType) {
- case JsonToken.STRING:
- StartElementEvent event =
- generateSEEvent(lastToken.tokenText);
- processingStack.get(depth).eventToReadAttributesFor = event;
- processingStack.get(depth).lastName = lastToken.tokenText;
- colon();
- processingStack.get(depth).state = LaState.BEFORE_VALUE_IN_KV_PAIR;
- break;
- default:
- // TODO: handle problem
- }
- break;
- case BEFORE_VALUE_IN_KV_PAIR:
- switch (lastToken.tokenType) {
- case JsonToken.START_OBJECT:
- processingStack.add(new ProcessingState(LaState.AFTER_OBJ_START_BRACE));
- depth++;
- break;
- case JsonToken.START_ARRAY:
- processingStack.add(new ProcessingState(LaState.AFTER_ARRAY_START_BRACE));
- depth++;
- break;
- case JsonToken.STRING:
- case JsonToken.NUMBER:
- case JsonToken.TRUE:
- case JsonToken.FALSE:
- eventQueue.add(new CharactersEvent(lastToken.tokenText, new StaxLocation(lexer)));
- processingStack.get(depth).state = LaState.AFTER_OBJ_KV_PAIR;
- break;
- case JsonToken.NULL:
- //TODO: optionally generate a fake xsi:nil attribute
-// if (!eventQueue.isEmpty()) {
-// eventQueue.peek().addAttribute(new QName("http://www.w3.org/2001/XMLSchema-instance", "nil"), "true");
-// }
- processingStack.get(depth).state = LaState.AFTER_OBJ_KV_PAIR;
- break;
- default:
- // TODO: handle problem
- }
- break; // AFTER_ARRAY_ELEM
- case AFTER_OBJ_KV_PAIR:
- switch (lastToken.tokenType) {
- case JsonToken.COMMA:
- processingStack.get(depth).state = LaState.BEFORE_OBJ_NEXT_KV_PAIR;
- generateEEEvent(processingStack.get(depth).lastName);
- break; // STRING
- case JsonToken.END_OBJECT: // empty object/element
- generateEEEvent(processingStack.get(depth).lastName);
- processingStack.remove(depth);
- depth--;
- valueRead();
- break; // END_OBJECT
- default:
- // TODO: handle problem
- }
- break; // AFTER_OBJ_KV_PAIR
- case AFTER_ARRAY_START_BRACE:
- switch (lastToken.tokenType) {
- case JsonToken.START_OBJECT:
- processingStack.add(new ProcessingState(LaState.AFTER_OBJ_START_BRACE));
- processingStack.get(depth).eventToReadAttributesFor = processingStack.get(depth - 1).eventToReadAttributesFor;
- depth++;
- break;
- case JsonToken.START_ARRAY:
- processingStack.add(new ProcessingState(LaState.AFTER_ARRAY_START_BRACE));
- depth++;
- break;
- case JsonToken.END_ARRAY:
- processingStack.remove(depth);
- depth--;
- valueRead();
- break;
- case JsonToken.STRING:
- eventQueue.add(new CharactersEvent(lastToken.tokenText, new StaxLocation(lexer)));
- processingStack.get(depth).state = LaState.AFTER_ARRAY_ELEM;
- break;
- default:
- // TODO: handle problem
- }
- break; // AFTER_ARRAY_ELEM
- case BEFORE_NEXT_ARRAY_ELEM:
- StartElementEvent event =
- generateSEEvent(processingStack.get(depth - 1).lastName);
- switch (lastToken.tokenType) {
- case JsonToken.START_OBJECT:
- processingStack.add(new ProcessingState(LaState.AFTER_OBJ_START_BRACE));
- processingStack.get(depth).eventToReadAttributesFor = event;
- depth++;
- break;
- case JsonToken.START_ARRAY:
- processingStack.add(new ProcessingState(LaState.AFTER_ARRAY_START_BRACE));
- depth++;
- break;
- case JsonToken.STRING:
- eventQueue.add(new CharactersEvent(lastToken.tokenText, new StaxLocation(lexer)));
- processingStack.get(depth).state = LaState.AFTER_ARRAY_ELEM;
- break;
- default:
- // TODO: handle problem
- }
- break; // BEFORE_NEXT_ARRAY_ELEM
- case AFTER_ARRAY_ELEM:
- switch (lastToken.tokenType) {
- case JsonToken.END_ARRAY:
- processingStack.remove(depth);
- depth--;
- valueRead();
- break;
- case JsonToken.COMMA:
- processingStack.get(depth).state = LaState.BEFORE_NEXT_ARRAY_ELEM;
- generateEEEvent(processingStack.get(depth - 1).lastName);
- break;
- default:
- // TODO: handle problem
- }
- break; // AFTER_ARRAY_ELEM
- }
- } // end while lastEvent null
- }
-
- public int getAttributeCount() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributeCount");
- assert !eventQueue.isEmpty();
- if (!eventQueue.peek().attributesChecked) {
- try {
- readNext(true);
- } catch (IOException e) {
- // TODO: handle it!!!
- }
- eventQueue.peek().attributesChecked = true;
- }
- int result = eventQueue.peek().getAttributeCount();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributeCount", result);
- return result;
- }
-
- public int getEventType() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getEventType");
- assert !eventQueue.isEmpty();
- int result = eventQueue.peek().getEventType();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getEventType", result);
- return result;
- }
-
- public int getNamespaceCount() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getNamespaceCount");
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getNamespaceCount", 0);
- return 0;
- }
-
- public int getTextLength() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getTextLength");
- assert !eventQueue.isEmpty();
- int result = eventQueue.peek().getTextLength();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getTextLength", result);
- return result;
- }
-
- public int getTextStart() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getTextStart");
- assert !eventQueue.isEmpty();
- int result = eventQueue.peek().getTextStart();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getTextStart", result);
- return result;
- }
-
- public int next() throws XMLStreamException {
- try {
- readNext();
- return eventQueue.peek().getEventType();
- } catch (IOException ex) {
- Logger.getLogger(JsonXmlStreamReader.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- public int nextTag() throws XMLStreamException {
- int eventType = next();
- while ((eventType == XMLStreamConstants.CHARACTERS && isWhiteSpace()) // skip whitespace
- || (eventType == XMLStreamConstants.CDATA && isWhiteSpace()) // skip whitespace
- || eventType == XMLStreamConstants.SPACE || eventType == XMLStreamConstants.PROCESSING_INSTRUCTION || eventType == XMLStreamConstants.COMMENT) {
- eventType = next();
- }
- if (eventType != XMLStreamConstants.START_ELEMENT && eventType != XMLStreamConstants.END_ELEMENT) {
- throw new XMLStreamException("expected start or end tag", getLocation());
- }
- return eventType;
- }
-
- public void close() throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean hasName() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean hasNext() throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean hasText() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean isCharacters() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "isCharacters");
- assert !eventQueue.isEmpty();
- boolean result = eventQueue.peek().isCharacters();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "isCharacters", result);
- return result;
- }
-
- public boolean isEndElement() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "isEndElement");
- assert !eventQueue.isEmpty();
- boolean result = eventQueue.peek().isEndElement();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "isEndElement", result);
- return result;
- }
-
- public boolean isStandalone() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public boolean isStartElement() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "isStartElement");
- assert !eventQueue.isEmpty();
- boolean result = eventQueue.peek().isStartElement();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "isStartElement", result);
- return result;
- }
-
- public boolean isWhiteSpace() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "isWhiteSpace");
- boolean result = false; // white space processed by lexer
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "isWhiteSpace", result);
- return result;
- }
-
- public boolean standaloneSet() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public char[] getTextCharacters() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getTextCharacters");
- assert !eventQueue.isEmpty();
- char[] result = eventQueue.peek().getTextCharacters();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getTextCharacters", result);
- return result;
- }
-
- public boolean isAttributeSpecified(int attribute) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "isAttributeSpecified");
- assert !eventQueue.isEmpty();
- boolean result = eventQueue.peek().isAttributeSpecified(attribute);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "isAttributeSpecified", result);
- return result;
- }
-
- public int getTextCharacters(int sourceStart, char[] target, int targetStart, int length) throws XMLStreamException {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getTextCharacters");
- assert !eventQueue.isEmpty();
- int result = eventQueue.peek().getTextCharacters(sourceStart, target, targetStart, length);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getTextCharacters", result);
- return result;
- }
-
- public String getCharacterEncodingScheme() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getElementText() throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getEncoding() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getLocalName() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getLocalName");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getLocalName();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getLocalName", result);
- return result;
- }
-
- public String getNamespaceURI() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getNamespaceURI");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getName().getNamespaceURI();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getNamespaceURI", result);
- return result;
- }
-
- public String getPIData() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getPITarget() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getPrefix() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getPrefix");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getPrefix();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getPrefix", result);
- return result;
- }
-
- public String getText() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getText");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getText();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getText", result);
- return result;
- }
-
- public String getVersion() {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getAttributeLocalName(int index) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributeLocalName");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getAttributeLocalName(index);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributeLocalName", result);
- return result;
- }
-
- public QName getAttributeName(int index) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributeName");
- assert !eventQueue.isEmpty();
- QName result = eventQueue.peek().getAttributeName(index);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributeName", result);
- return result;
- }
-
- public String getAttributeNamespace(int index) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributeNamespace");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getAttributeNamespace(index);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributeNamespace", result);
- return result;
- }
-
- public String getAttributePrefix(int index) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributePrefix");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getAttributePrefix(index);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributePrefix", result);
- return result;
- }
-
- public String getAttributeType(int index) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributeType");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getAttributeType(index);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributeType", result);
- return result;
- }
-
- public String getAttributeValue(int index) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributeValue");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getAttributeValue(index);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributeValue", result);
- return result;
- }
-
- public String getAttributeValue(String namespaceURI, String localName) {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getAttributeValue");
- assert !eventQueue.isEmpty();
- String result = eventQueue.peek().getAttributeValue(namespaceURI, localName);
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getAttributeValue", result);
- return result;
- }
-
- public String getNamespacePrefix(int arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getNamespaceURI(int arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public NamespaceContext getNamespaceContext() {
- // TODO: put/take it to/from processing stack
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getNamespaceContext");
- NamespaceContext result = new JsonNamespaceContext();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getNamespaceContext", result);
- return result;
- }
-
- public QName getName() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getName");
- assert !eventQueue.isEmpty();
- QName result = eventQueue.peek().getName();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getName");
- return result;
- }
-
- public Location getLocation() {
- LOGGER.entering(JsonXmlStreamReader.class.getName(), "getLocation");
- assert !eventQueue.isEmpty();
- Location result = eventQueue.peek().getLocation();
- LOGGER.exiting(JsonXmlStreamReader.class.getName(), "getLocation", result);
- return result;
- }
-
- public Object getProperty(String arg0) throws IllegalArgumentException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void require(int arg0, String arg1, String arg2) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getNamespaceURI(String arg0) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- private StartElementEvent generateSEEvent(String name) {
- StartElementEvent event = null;
- if (!"$".equals(name)) {
- event = new StartElementEvent(createQName(name), new StaxLocation(lexer));
- eventQueue.add(event);
- }
- return event;
- }
-
- private void generateEEEvent(String name) {
- if ((null != name) && !"$".equals(name)) {
- eventQueue.add(new EndElementEvent(createQName(name), new StaxLocation(lexer)));
- }
- }
-
- private QName createQName(String name) {
- if (revertedXml2JsonNs.isEmpty() || !name.contains(nsSeparatorAsSequence)) {
- return new QName(name);
- } else {
- int dotIndex = name.indexOf(nsSeparator);
- String prefix = name.substring(0, dotIndex);
- String suffix = name.substring(dotIndex + 1);
- return revertedXml2JsonNs.containsKey(prefix) ? new QName(revertedXml2JsonNs.get(prefix), suffix) : new QName(name);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartDocumentEvent.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartDocumentEvent.java
deleted file mode 100644
index 111aa461b71..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartDocumentEvent.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- *
- * @author japod
- */
-public class StartDocumentEvent extends JsonReaderXmlEvent {
-
- public StartDocumentEvent(Location location) {
- this.location = location;
- }
-
- @Override
- public boolean isStartDocument() {
- return true;
- }
-
- @Override
- public int getEventType() {
- return XMLStreamConstants.START_DOCUMENT;
- }
-
- @Override
- public String toString() {
- return "StartDocumentEvent()";
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartElementEvent.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartElementEvent.java
deleted file mode 100644
index e4529ebd8e3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StartElementEvent.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.reader;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamConstants;
-
-/**
- *
- * @author japod
- */
-public class StartElementEvent extends JsonReaderXmlEvent {
-
- public StartElementEvent(QName name, Location location) {
- this.name = name;
- this.location = location;
- }
-
- @Override
- public boolean isStartElement() {
- return true;
- }
-
- @Override
- public int getEventType() {
- return XMLStreamConstants.START_ELEMENT;
- }
-
- @Override
- public String toString() {
- return "StartElementEvent(" + name + ")";
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StaxLocation.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StaxLocation.java
deleted file mode 100644
index ddef8473043..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/reader/StaxLocation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.sun.jersey.json.impl.reader;
-
-import javax.xml.stream.Location;
-import org.codehaus.jackson.JsonLocation;
-
-class StaxLocation implements Location {
-
- int charOffset = -1;
- int column = -1;
- int line = -1;
-
- StaxLocation(final int charOffset, final int column, final int line) {
- super();
- this.charOffset = charOffset;
- this.column = column;
- this.line = line;
- }
-
- StaxLocation(final JsonLocation location) {
- this((int)location.getCharOffset(), location.getColumnNr(), location.getLineNr());
- }
-
- StaxLocation(final JsonLexer lexer) {
- this(lexer.getCharOffset(), lexer.getColumn(), lexer.getLineNumber());
- }
-
- public int getCharacterOffset() {
- return charOffset;
- }
-
- public int getColumnNumber() {
- return column;
- }
-
- public int getLineNumber() {
- return line;
- }
-
- public String getPublicId() {
- return null;
- }
-
- public String getSystemId() {
- return null;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.java
deleted file mode 100644
index 7ca5e75c496..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.writer;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- *
- * @author japod
- */
-public class A2EXmlStreamWriterProxy implements XMLStreamWriter {
-
- XMLStreamWriter underlyingWriter;
- List<String> attr2ElemNames;
-
- private class XmlAttribute {
-
- String prefix;
- String namespaceUri;
- String localName;
- String value;
-
- XmlAttribute(String prefix, String nsUri, String localName, String value) {
- this.prefix = prefix;
- this.namespaceUri = nsUri;
- this.localName = localName;
- this.value = value;
- }
- }
- List<XmlAttribute> unwrittenAttrs = null;
-
- public A2EXmlStreamWriterProxy(XMLStreamWriter writer, Collection<String> attr2ElemNames) {
- this.underlyingWriter = writer;
- this.attr2ElemNames = new LinkedList<String>();
- this.attr2ElemNames.addAll(attr2ElemNames);
-
- }
-
- private void flushUnwrittenAttrs() throws XMLStreamException {
- if (unwrittenAttrs != null) {
- for (XmlAttribute a : unwrittenAttrs) {
- underlyingWriter.writeStartElement(a.prefix, a.localName, a.namespaceUri);
- underlyingWriter.writeCharacters(a.value);
- underlyingWriter.writeEndElement();
- }
- unwrittenAttrs = null;
- }
- }
-
- public void writeStartElement(String arg0) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeStartElement(arg0);
- }
-
- public void writeStartElement(String arg0, String arg1) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeStartElement(arg0, arg1);
- }
-
- public void writeStartElement(String arg0, String arg1, String arg2) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeStartElement(arg0, arg1, arg2);
- }
-
- public void writeEmptyElement(String arg0, String arg1) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeEmptyElement(arg0, arg1);
- }
-
- public void writeEmptyElement(String arg0, String arg1, String arg2) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeEmptyElement(arg0, arg1, arg2);
- }
-
- public void writeEmptyElement(String arg0) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeEmptyElement(arg0);
- }
-
- public void writeEndElement() throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeEndElement();
- }
-
- public void writeEndDocument() throws XMLStreamException {
- underlyingWriter.writeEndDocument();
- }
-
- public void close() throws XMLStreamException {
- underlyingWriter.close();
- }
-
- public void flush() throws XMLStreamException {
- underlyingWriter.flush();
- }
-
- public void writeAttribute(String localName, String value) throws XMLStreamException {
- writeAttribute(null, null, localName, value);
- }
-
- public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
- writeAttribute(null, namespaceURI, localName, value);
- }
-
- public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
- if (!this.attr2ElemNames.contains(localName)) {
- underlyingWriter.writeAttribute(prefix, namespaceURI, localName, value);
- } else {
- if (unwrittenAttrs == null) {
- unwrittenAttrs = new LinkedList<XmlAttribute>();
- }
- unwrittenAttrs.add(new XmlAttribute(prefix, namespaceURI, localName, value));
- }
- }
-
- public void writeNamespace(String arg0, String arg1) throws XMLStreamException {
- underlyingWriter.writeNamespace(arg0, arg1);
- }
-
- public void writeDefaultNamespace(String arg0) throws XMLStreamException {
- underlyingWriter.writeDefaultNamespace(arg0);
- }
-
- public void writeComment(String arg0) throws XMLStreamException {
- underlyingWriter.writeComment(arg0);
- }
-
- public void writeProcessingInstruction(String arg0) throws XMLStreamException {
- underlyingWriter.writeProcessingInstruction(arg0);
- }
-
- public void writeProcessingInstruction(String arg0, String arg1) throws XMLStreamException {
- underlyingWriter.writeProcessingInstruction(arg0, arg1);
- }
-
- public void writeCData(String arg0) throws XMLStreamException {
- underlyingWriter.writeCData(arg0);
- }
-
- public void writeDTD(String arg0) throws XMLStreamException {
- underlyingWriter.writeDTD(arg0);
- }
-
- public void writeEntityRef(String arg0) throws XMLStreamException {
- underlyingWriter.writeEntityRef(arg0);
- }
-
- public void writeStartDocument() throws XMLStreamException {
- underlyingWriter.writeStartDocument();
- }
-
- public void writeStartDocument(String arg0) throws XMLStreamException {
- underlyingWriter.writeStartDocument(arg0);
- }
-
- public void writeStartDocument(String arg0, String arg1) throws XMLStreamException {
- underlyingWriter.writeStartDocument(arg0, arg1);
- }
-
- public void writeCharacters(String arg0) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeCharacters(arg0);
- }
-
- public void writeCharacters(char[] arg0, int arg1, int arg2) throws XMLStreamException {
- flushUnwrittenAttrs();
- underlyingWriter.writeCharacters(arg0, arg1, arg2);
- }
-
- public String getPrefix(String arg0) throws XMLStreamException {
- return underlyingWriter.getPrefix(arg0);
- }
-
- public void setPrefix(String arg0, String arg1) throws XMLStreamException {
- underlyingWriter.setPrefix(arg0, arg1);
- }
-
- public void setDefaultNamespace(String arg0) throws XMLStreamException {
- underlyingWriter.setDefaultNamespace(arg0);
- }
-
- public void setNamespaceContext(NamespaceContext arg0) throws XMLStreamException {
- underlyingWriter.setNamespaceContext(arg0);
- }
-
- public NamespaceContext getNamespaceContext() {
- return underlyingWriter.getNamespaceContext();
- }
-
- public Object getProperty(String arg0) throws IllegalArgumentException {
- return underlyingWriter.getProperty(arg0);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.java
deleted file mode 100644
index 4ee49810b24..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.writer;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import org.codehaus.jackson.Base64Variant;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.JsonStreamContext;
-import org.codehaus.jackson.JsonToken;
-import org.codehaus.jackson.ObjectCodec;
-
-/**
- *
- * @author japod
- */
-public class JacksonArrayWrapperGenerator extends JsonGenerator {
-
- private enum State { START, AFTER_NULL, IN_THE_MIDDLE };
-
- State state = State.START;
- int depth = 0;
- final JsonGenerator generator;
- private boolean isClosed = false;
- final int arrayDepth;
-
-
- private JacksonArrayWrapperGenerator() {
- this(null, 0);
- }
-
- private JacksonArrayWrapperGenerator(JsonGenerator generator) {
- this(generator, 0);
- }
-
- private JacksonArrayWrapperGenerator(final JsonGenerator generator, final int arrayDepth) {
- this.generator = generator;
- this.arrayDepth = arrayDepth;
- }
-
- public static JsonGenerator createArrayWrapperGenerator(JsonGenerator g) {
- return new JacksonArrayWrapperGenerator(g);
- }
-
- public static JsonGenerator createArrayWrapperGenerator(final JsonGenerator g, final int arrayDepth) {
- return new JacksonArrayWrapperGenerator(g, arrayDepth);
- }
-
- private void aboutToWriteANonNull() throws IOException {
- if (depth == arrayDepth) {
- if (state == State.START) {
- generator.writeStartArray();
- state = State.IN_THE_MIDDLE;
- } else if (state == State.AFTER_NULL) {
- generator.writeStartArray();
- generator.writeNull();
- state = State.IN_THE_MIDDLE;
- }
- }
- }
-
- @Override @Deprecated
- public void enableFeature(Feature feature) {
- generator.enableFeature(feature);
- }
-
- @Override
- public JsonGenerator enable(Feature feature) {
- return generator.enable(feature);
- }
-
- @Override @Deprecated
- public void disableFeature(Feature feature) {
- generator.disableFeature(feature);
- }
-
- @Override
- public JsonGenerator disable(Feature feature) {
- return generator.disable(feature);
- }
-
- @Override
- public void setFeature(Feature feature, boolean enabled) {
- generator.setFeature(feature, enabled);
- }
-
- @Override @Deprecated
- public boolean isFeatureEnabled(Feature feature) {
- return generator.isFeatureEnabled(feature);
- }
-
- @Override
- public boolean isEnabled(Feature f) {
- return generator.isEnabled(f);
- }
-
- @Override
- public JsonGenerator useDefaultPrettyPrinter() {
- return generator.useDefaultPrettyPrinter();
- }
-
- @Override
- public JsonGenerator setCodec(ObjectCodec codec) {
- return generator.setCodec(codec);
- }
-
- @Override
- public ObjectCodec getCodec() {
- return generator.getCodec();
- }
-
- @Override
- public void writeRawValue(String rawString) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRawValue(rawString);
- }
-
- @Override
- public void writeRawValue(String rawString, int startIndex, int length) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRawValue(rawString, startIndex, length);
- }
-
- @Override
- public void writeRawValue(char[] rawChars, int startIndex, int length) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRaw(rawChars, startIndex, length);
- }
-
- @Override
- public void writeNumber(BigInteger number) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeNumber(number);
-
- }
-
- @Override
- public void writeObject(Object o) throws IOException, JsonProcessingException {
- aboutToWriteANonNull();
- generator.writeObject(o);
- }
-
- @Override
- public void writeTree(JsonNode node) throws IOException, JsonProcessingException {
- aboutToWriteANonNull();
- generator.writeTree(node);
- }
-
- @Override
- public boolean isClosed() {
- return isClosed;
- }
-
- @Override
- public JsonStreamContext getOutputContext() {
- return generator.getOutputContext();
- }
-
- @Override
- public void writeStartArray() throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeStartArray();
- }
-
- @Override
- public void writeEndArray() throws IOException, JsonGenerationException {
- generator.writeEndArray();
- }
-
- @Override
- public void writeStartObject() throws IOException, JsonGenerationException {
- if (arrayDepth > 0 && depth == arrayDepth) {
- generator.writeStartArray();
- generator.writeStartObject();
- } else {
- aboutToWriteANonNull();
- generator.writeStartObject();
- }
- depth++;
- }
-
- @Override
- public void writeEndObject() throws IOException, JsonGenerationException {
- if (arrayDepth > 0 && depth == arrayDepth) {
- generator.writeEndObject();
- generator.writeEndArray();
- } else {
- generator.writeEndObject();
- }
- depth--;
- }
-
- @Override
- public void writeFieldName(String name) throws IOException, JsonGenerationException {
- generator.writeFieldName(name);
- }
-
- @Override
- public void writeString(String s) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeString(s);
- }
-
- @Override
- public void writeString(char[] text, int start, int length) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeString(text, start, length);
- }
-
- @Override
- public void writeRawUTF8String(byte[] bytes, int start, int length) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRawUTF8String(bytes, start, length);
- }
-
- @Override
- public void writeUTF8String(byte[] bytes, int start, int length) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeUTF8String(bytes, start, length);
- }
-
- @Override
- public void writeRaw(String raw) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRaw(raw);
- }
-
- @Override
- public void writeRaw(String raw, int start, int length) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRaw(raw, start, length);
- }
-
- @Override
- public void writeRaw(char[] raw, int start, int count) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRaw(raw, start, count);
- }
-
- @Override
- public void writeRaw(char c) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeRaw(c);
- }
-
- @Override
- public void writeBinary(Base64Variant variant, byte[] bytes, int start, int count) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeBinary(variant, bytes, start, count);
- }
-
- @Override
- public void writeNumber(int i) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeNumber(i);
- }
-
- @Override
- public void writeNumber(long l) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeNumber(l);
- }
-
- @Override
- public void writeNumber(double d) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeNumber(d);
- }
-
- @Override
- public void writeNumber(float f) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeNumber(f);
- }
-
- @Override
- public void writeNumber(BigDecimal bd) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeNumber(bd);
- }
-
- @Override
- public void writeNumber(String number) throws IOException, JsonGenerationException, UnsupportedOperationException {
- aboutToWriteANonNull();
- generator.writeNumber(number);
- }
-
- @Override
- public void writeBoolean(boolean b) throws IOException, JsonGenerationException {
- aboutToWriteANonNull();
- generator.writeBoolean(b);
- }
-
- @Override
- public void writeNull() throws IOException, JsonGenerationException {
- switch (state) {
- case START :
- state = State.AFTER_NULL;
- break;
- case AFTER_NULL :
- generator.writeStartArray();
- generator.writeNull();
- state = State.IN_THE_MIDDLE;
- default:
- generator.writeNull();
- }
- }
-
- @Override
- public void copyCurrentEvent(JsonParser parser) throws IOException, JsonProcessingException {
- if (JsonToken.VALUE_NULL != parser.getCurrentToken()) {
- aboutToWriteANonNull();
- generator.copyCurrentEvent(parser);
- } else {
- writeNull();
- }
- }
-
- @Override
- public void copyCurrentStructure(JsonParser parser) throws IOException, JsonProcessingException {
- generator.copyCurrentStructure(parser);
- }
-
- @Override
- public void flush() throws IOException {
- if (depth == arrayDepth) {
- switch (state) {
- case IN_THE_MIDDLE:
- generator.writeEndArray();
- break;
- case AFTER_NULL:
- case START:
- generator.writeStartArray();
- generator.writeEndArray();
- break;
- }
- }
- generator.flush();
- }
-
- @Override
- public void close() throws IOException {
- flush();
- generator.close();
- isClosed = true;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.java
deleted file mode 100644
index c4d15227fdc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.json.impl.writer;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import org.codehaus.jackson.Base64Variant;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.JsonStreamContext;
-import org.codehaus.jackson.ObjectCodec;
-
-/**
- *
- * @author japod
- */
-public class JacksonRootStrippingGenerator extends JsonGenerator {
-
- final JsonGenerator generator;
- int depth = 0;
- boolean isClosed = false;
- final int treshold;
-
- private JacksonRootStrippingGenerator() {
- this(null, 1);
- }
-
- private JacksonRootStrippingGenerator(JsonGenerator generator) {
- this(generator, 1);
- }
-
- private JacksonRootStrippingGenerator(final JsonGenerator generator, final int treshold) {
- this.generator = generator;
- this.treshold = treshold;
- }
-
- public static JsonGenerator createRootStrippingGenerator(JsonGenerator g) {
- return new JacksonRootStrippingGenerator(g);
- }
-
- public static JsonGenerator createRootStrippingGenerator(JsonGenerator g, int treshold) {
- return new JacksonRootStrippingGenerator(g, treshold);
- }
-
- @Override @Deprecated
- public void enableFeature(Feature feature) {
- generator.enableFeature(feature);
- }
-
- @Override
- public JsonGenerator enable(Feature feature) {
- return generator.enable(feature);
- }
-
- @Override @Deprecated
- public void disableFeature(Feature feature) {
- generator.disableFeature(feature);
- }
-
- @Override
- public JsonGenerator disable(Feature feature) {
- return generator.disable(feature);
- }
-
- @Override
- public void setFeature(Feature feature, boolean enabled) {
- generator.setFeature(feature, enabled);
- }
-
- @Override @Deprecated
- public boolean isFeatureEnabled(Feature feature) {
- return generator.isFeatureEnabled(feature);
- }
-
- @Override
- public boolean isEnabled(Feature f) {
- return generator.isEnabled(f);
- }
-
- @Override
- public JsonGenerator useDefaultPrettyPrinter() {
- return generator.useDefaultPrettyPrinter();
- }
-
- @Override
- public void writeStartArray() throws IOException, JsonGenerationException {
- generator.writeStartArray();
- }
-
- @Override
- public void writeEndArray() throws IOException, JsonGenerationException {
- generator.writeEndArray();
- }
-
- @Override
- public void writeStartObject() throws IOException, JsonGenerationException {
- if (depth > treshold-1) {
- generator.writeStartObject();
- }
- depth++;
- }
-
- @Override
- public void writeEndObject() throws IOException, JsonGenerationException {
- if (depth > treshold) {
- generator.writeEndObject();
- }
- depth--;
- }
-
- @Override
- public void writeFieldName(String name) throws IOException, JsonGenerationException {
- if (depth > treshold) {
- generator.writeFieldName(name);
- }
- }
-
- @Override
- public void writeString(String s) throws IOException, JsonGenerationException {
- generator.writeString(s);
- }
-
- @Override
- public void writeString(char[] text, int start, int length) throws IOException, JsonGenerationException {
- generator.writeString(text, start, length);
- }
-
- @Override
- public void writeRawUTF8String(byte[] bytes, int start, int length) throws IOException, JsonGenerationException {
- generator.writeRawUTF8String(bytes, start, length);
- }
-
- @Override
- public void writeUTF8String(byte[] bytes, int start, int length) throws IOException, JsonGenerationException {
- generator.writeUTF8String(bytes, start, length);
- }
-
- @Override
- public void writeRaw(String raw) throws IOException, JsonGenerationException {
- generator.writeRaw(raw);
- }
-
- @Override
- public void writeRaw(String raw, int start, int length) throws IOException, JsonGenerationException {
- generator.writeRaw(raw, start, length);
- }
-
- @Override
- public void writeRaw(char[] raw, int start, int count) throws IOException, JsonGenerationException {
- generator.writeRaw(raw, start, count);
- }
-
- @Override
- public void writeRaw(char c) throws IOException, JsonGenerationException {
- generator.writeRaw(c);
- }
-
- @Override
- public void writeBinary(Base64Variant variant, byte[] bytes, int start, int count) throws IOException, JsonGenerationException {
- generator.writeBinary(variant, bytes, start, count);
- }
-
- @Override
- public void writeNumber(int i) throws IOException, JsonGenerationException {
- generator.writeNumber(i);
- }
-
- @Override
- public void writeNumber(long l) throws IOException, JsonGenerationException {
- generator.writeNumber(l);
- }
-
- @Override
- public void writeNumber(double d) throws IOException, JsonGenerationException {
- generator.writeNumber(d);
- }
-
- @Override
- public void writeNumber(float f) throws IOException, JsonGenerationException {
- generator.writeNumber(f);
- }
-
- @Override
- public void writeNumber(BigDecimal bd) throws IOException, JsonGenerationException {
- generator.writeNumber(bd);
- }
-
- @Override
- public void writeNumber(String number) throws IOException, JsonGenerationException, UnsupportedOperationException {
- generator.writeNumber(number);
- }
-
- @Override
- public void writeBoolean(boolean b) throws IOException, JsonGenerationException {
- generator.writeBoolean(b);
- }
-
- @Override
- public void writeNull() throws IOException, JsonGenerationException {
- generator.writeNull();
- }
-
- @Override
- public void copyCurrentEvent(JsonParser parser) throws IOException, JsonProcessingException {
- generator.copyCurrentEvent(parser);
- }
-
- @Override
- public void copyCurrentStructure(JsonParser parser) throws IOException, JsonProcessingException {
- generator.copyCurrentStructure(parser);
- }
-
- @Override
- public void flush() throws IOException {
- generator.flush();
- }
-
- @Override
- public void close() throws IOException {
- generator.close();
- isClosed = true;
- }
-
- @Override
- public JsonGenerator setCodec(ObjectCodec codec) {
- return generator.setCodec(codec);
- }
-
- @Override
- public ObjectCodec getCodec() {
- return generator.getCodec();
- }
-
- @Override
- public void writeRawValue(String rawString) throws IOException, JsonGenerationException {
- generator.writeRawValue(rawString);
- }
-
- @Override
- public void writeRawValue(String rawString, int startIndex, int length) throws IOException, JsonGenerationException {
- generator.writeRawValue(rawString, startIndex, length);
- }
-
- @Override
- public void writeRawValue(char[] rawChars, int startIndex, int length) throws IOException, JsonGenerationException {
- generator.writeRawValue(rawChars, startIndex, length);
- }
-
- @Override
- public void writeNumber(BigInteger number) throws IOException, JsonGenerationException {
- generator.writeNumber(number);
- }
-
- @Override
- public void writeObject(Object o) throws IOException, JsonProcessingException {
- generator.writeObject(o);
- }
-
- @Override
- public void writeTree(JsonNode node) throws IOException, JsonProcessingException {
- generator.writeTree(node);
- }
-
- @Override
- public JsonStreamContext getOutputContext() {
- return generator.getOutputContext();
- }
-
- @Override
- public boolean isClosed() {
- return isClosed;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.java
deleted file mode 100644
index db721394337..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.writer;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import org.codehaus.jackson.Base64Variant;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.JsonStreamContext;
-import org.codehaus.jackson.ObjectCodec;
-
-/**
- *
- * @author japod
- */
-public class JacksonStringMergingGenerator extends JsonGenerator {
-
- JsonGenerator generator;
- boolean isClosed;
- String previousString;
-
- private JacksonStringMergingGenerator() {
- }
-
- private JacksonStringMergingGenerator(JsonGenerator generator) {
- this.generator = generator;
- }
-
- public static JacksonStringMergingGenerator createGenerator(JsonGenerator g) {
- return new JacksonStringMergingGenerator(g);
- }
-
- @Override @Deprecated
- public void enableFeature(Feature feature) {
- generator.enableFeature(feature);
- }
-
- @Override
- public JsonGenerator enable(Feature feature) {
- return generator.enable(feature);
- }
-
- @Override @Deprecated
- public void disableFeature(Feature feature) {
- generator.disableFeature(feature);
- }
-
- @Override
- public JsonGenerator disable(Feature feature) {
- return generator.disable(feature);
- }
-
- @Override
- public void setFeature(Feature feature, boolean enabled) {
- generator.setFeature(feature, enabled);
- }
-
- @Override @Deprecated
- public boolean isFeatureEnabled(Feature feature) {
- return generator.isFeatureEnabled(feature);
- }
-
- @Override
- public boolean isEnabled(Feature f) {
- return generator.isEnabled(f);
- }
-
- @Override
- public JsonGenerator useDefaultPrettyPrinter() {
- return generator.useDefaultPrettyPrinter();
- }
-
- @Override
- public void writeStartArray() throws IOException, JsonGenerationException {
- generator.writeStartArray();
- }
-
- @Override
- public void writeEndArray() throws IOException, JsonGenerationException {
- flushPreviousString();
- generator.writeEndArray();
- }
-
- @Override
- public void writeStartObject() throws IOException, JsonGenerationException {
- generator.writeStartObject();
- }
-
- @Override
- public void writeEndObject() throws IOException, JsonGenerationException {
- flushPreviousString();
- generator.writeEndObject();
- }
-
- @Override
- public void writeFieldName(String name) throws IOException, JsonGenerationException {
- flushPreviousString();
- generator.writeFieldName(name);
- }
-
- @Override
- public void writeString(String s) throws IOException, JsonGenerationException {
- generator.writeString(s);
- }
-
- public void writeStringToMerge(String s) throws IOException, JsonGenerationException {
- if (previousString == null) {
- previousString = s;
- } else {
- previousString += s;
- }
- }
-
- @Override
- public void writeString(char[] text, int start, int length) throws IOException, JsonGenerationException {
- generator.writeString(text, start, length);
- }
-
- @Override
- public void writeRawUTF8String(byte[] bytes, int start, int length) throws IOException, JsonGenerationException {
- generator.writeRawUTF8String(bytes, start, length);
- }
-
- @Override
- public void writeUTF8String(byte[] bytes, int start, int length) throws IOException, JsonGenerationException {
- generator.writeUTF8String(bytes, start, length);
- }
-
- @Override
- public void writeRaw(String raw) throws IOException, JsonGenerationException {
- generator.writeRaw(raw);
- }
-
- @Override
- public void writeRaw(String raw, int start, int length) throws IOException, JsonGenerationException {
- generator.writeRaw(raw, start, length);
- }
-
- @Override
- public void writeRaw(char[] raw, int start, int count) throws IOException, JsonGenerationException {
- generator.writeRaw(raw, start, count);
- }
-
- @Override
- public void writeRaw(char c) throws IOException, JsonGenerationException {
- generator.writeRaw(c);
- }
-
- @Override
- public void writeBinary(Base64Variant variant, byte[] bytes, int start, int count) throws IOException, JsonGenerationException {
- generator.writeBinary(variant, bytes, start, count);
- }
-
- @Override
- public void writeNumber(int i) throws IOException, JsonGenerationException {
- generator.writeNumber(i);
- }
-
- @Override
- public void writeNumber(long l) throws IOException, JsonGenerationException {
- generator.writeNumber(l);
- }
-
- @Override
- public void writeNumber(double d) throws IOException, JsonGenerationException {
- generator.writeNumber(d);
- }
-
- @Override
- public void writeNumber(float f) throws IOException, JsonGenerationException {
- generator.writeNumber(f);
- }
-
- @Override
- public void writeNumber(BigDecimal bd) throws IOException, JsonGenerationException {
- generator.writeNumber(bd);
- }
-
- @Override
- public void writeNumber(String number) throws IOException, JsonGenerationException, UnsupportedOperationException {
- generator.writeNumber(number);
- }
-
- @Override
- public void writeBoolean(boolean b) throws IOException, JsonGenerationException {
- generator.writeBoolean(b);
- }
-
- @Override
- public void writeNull() throws IOException, JsonGenerationException {
- generator.writeNull();
- }
-
- @Override
- public void copyCurrentEvent(JsonParser parser) throws IOException, JsonProcessingException {
- flushPreviousString();
- generator.copyCurrentEvent(parser);
- }
-
- @Override
- public void copyCurrentStructure(JsonParser parser) throws IOException, JsonProcessingException {
- flushPreviousString();
- generator.copyCurrentStructure(parser);
- }
-
- @Override
- public void flush() throws IOException {
- generator.flush();
- }
-
- @Override
- public void close() throws IOException {
- generator.close();
- isClosed = true;
- }
-
- @Override
- public JsonGenerator setCodec(ObjectCodec codec) {
- return generator.setCodec(codec);
- }
-
- @Override
- public ObjectCodec getCodec() {
- return generator.getCodec();
- }
-
- @Override
- public void writeRawValue(String rawString) throws IOException, JsonGenerationException {
- generator.writeRawValue(rawString);
- }
-
- @Override
- public void writeRawValue(String rawString, int startIndex, int length) throws IOException, JsonGenerationException {
- generator.writeRawValue(rawString, startIndex, length);
- }
-
- @Override
- public void writeRawValue(char[] rawChars, int startIndex, int length) throws IOException, JsonGenerationException {
- generator.writeRawValue(rawChars, startIndex, length);
- }
-
- @Override
- public void writeNumber(BigInteger number) throws IOException, JsonGenerationException {
- generator.writeNumber(number);
- }
-
- @Override
- public void writeObject(Object o) throws IOException, JsonProcessingException {
- generator.writeObject(o);
- }
-
- @Override
- public void writeTree(JsonNode node) throws IOException, JsonProcessingException {
- generator.writeTree(node);
- }
-
- @Override
- public JsonStreamContext getOutputContext() {
- return generator.getOutputContext();
- }
-
- @Override
- public boolean isClosed() {
- return isClosed;
- }
-
- private void flushPreviousString() throws IOException {
- if (previousString != null) {
- generator.writeString(previousString);
- previousString = null;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonEncoder.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonEncoder.java
deleted file mode 100644
index 91f5bc3ebac..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonEncoder.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.writer;
-
-import java.util.Formatter;
-
-/**
- *
- * @author japod
- */
-public class JsonEncoder {
-
- public static String encode(String text) {
- if ((null == text) || (text.length() == 0)) {
- return text;
- }
- Formatter formatter = new java.util.Formatter();
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < text.length(); i++) {
- char c = text.charAt(i);
- switch (c) {
- case '"':
- result.append("\\\"");
- break;
- case '\\':
- result.append("\\\\");
- break;
- case '\b':
- result.append("\\b");
- break;
- case '\f':
- result.append("\\f");
- break;
- case '\n':
- result.append("\\n");
- break;
- case '\r':
- result.append("\\r");
- break;
- case '\t':
- result.append("\\t");
- break;
- default:
- if (c < ' ') { // TODO: what about c > 255 ???
- result.append(formatter.format("\\u%04X", (int)c));
- } else {
- result.append(c);
- }
- }
- }
- return result.toString();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.java
deleted file mode 100644
index 72a93c45a10..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.writer;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- *
- * @author japod
- */
-public class JsonXmlStreamWriter implements XMLStreamWriter {
-
- private static class WriterAdapter {
-
- Writer writer;
- boolean isEmpty = true;
-
- WriterAdapter() {
- }
-
- WriterAdapter(Writer w) {
- writer = w;
- }
-
- void write(String s) throws IOException {
- assert null != writer;
- writer.write(s);
- isEmpty = false;
- }
-
- String getContent() {
- return null;
- }
- }
-
- private static final class StringWriterAdapter extends WriterAdapter {
-
- StringWriterAdapter() {
- writer = new StringWriter();
- }
-
- @Override
- String getContent() {
- return writer.toString();
- }
- }
-
- private static final class DummyWriterAdapter extends WriterAdapter {
-
- DummyWriterAdapter() {
- }
-
- @Override
- void write(String s) throws IOException {
- }
-
- @Override
- String getContent() {
- return null;
- }
- }
-
- private static final class ProcessingState {
-
- String lastName;
- String currentName;
- WriterAdapter lastElementWriter;
- Boolean lastWasPrimitive;
- boolean lastIsArray;
- boolean isNotEmpty = false;
- WriterAdapter writer;
-
- ProcessingState() {
- writer = new StringWriterAdapter();
- }
-
- ProcessingState(WriterAdapter w) {
- writer = w;
- }
-
- @Override
- public String toString() {
- return String.format("{currentName:%s, writer: \"%s\", lastName:%s, lastWriter: %s}", currentName, ((writer != null) ? writer.getContent() : null), lastName, ((lastElementWriter != null) ? lastElementWriter.getContent() : null));
- }
- }
- Writer mainWriter;
- boolean stripRoot;
- char nsSeparator;
- final List<ProcessingState> processingStack = new ArrayList<ProcessingState>();
- int depth;
- final Collection<String> arrayElementNames = new LinkedList<String>();
- final Collection<String> nonStringElementNames = new LinkedList<String>();
- final Map<String, String> xml2JsonNs = new HashMap<String, String>();
-
- private JsonXmlStreamWriter(Writer writer) {
- this(writer, JSONConfiguration.DEFAULT);
- }
-
- private JsonXmlStreamWriter(Writer writer, JSONConfiguration config) {
- this.mainWriter = writer;
- this.stripRoot = config.isRootUnwrapping();
- this.nsSeparator = config.getNsSeparator();
- if (null != config.getArrays()) {
- this.arrayElementNames.addAll(config.getArrays());
- }
- if (null != config.getNonStrings()) {
- this.nonStringElementNames.addAll(config.getNonStrings());
- }
- if (null != config.getXml2JsonNs()) {
- this.xml2JsonNs.putAll(config.getXml2JsonNs());
- }
- processingStack.add(createProcessingState());
- depth = 0;
- }
-
- public static XMLStreamWriter createWriter(Writer writer, JSONConfiguration config) {
- final Collection<String> attrsAsElems = config.getAttributeAsElements();
- if ((attrsAsElems != null) && !attrsAsElems.isEmpty()) {
- return new A2EXmlStreamWriterProxy(
- new JsonXmlStreamWriter(writer, config), attrsAsElems);
- } else {
- return new JsonXmlStreamWriter(writer, config);
- }
- }
-
- public void close() throws XMLStreamException {
- try {
- this.mainWriter.close();
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- public void flush() throws XMLStreamException {
- try {
- mainWriter.flush();
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- public void writeEndDocument() throws XMLStreamException {
- try {
- if (null != processingStack.get(depth).lastElementWriter) {
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- }
- if ((null == processingStack.get(depth).lastWasPrimitive) || !processingStack.get(depth).lastWasPrimitive) {
- processingStack.get(depth).writer.write("}");
- }
- pollStack();
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- public void writeEndElement() throws XMLStreamException {
- try {
- if (null != processingStack.get(depth).lastElementWriter) {
- if (processingStack.get(depth).lastIsArray) {
- processingStack.get(depth).writer.write(",");
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- processingStack.get(depth).writer.write("]");
- } else {
- if (isArrayElement(processingStack.get(depth).lastName)) { // one elem array
- processingStack.get(depth).writer.write(processingStack.get(depth).lastIsArray ? "," : "[");
- processingStack.get(depth).lastIsArray = true;
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- processingStack.get(depth).writer.write("]");
- } else {
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- }
- }
- }
- if (processingStack.get(depth).writer.isEmpty) {
- processingStack.get(depth).writer.write("null");
- } else if ((null == processingStack.get(depth).lastWasPrimitive) || !processingStack.get(depth).lastWasPrimitive) {
- processingStack.get(depth).writer.write("}");
- }
- processingStack.get(depth - 1).lastName = processingStack.get(depth - 1).currentName;
- processingStack.get(depth - 1).lastWasPrimitive = false;
- processingStack.get(depth - 1).lastElementWriter = processingStack.get(depth).writer;
- pollStack();
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- public void writeStartDocument() throws XMLStreamException {
- }
-
- public void writeCharacters(char[] text, int start, int length) throws XMLStreamException {
- writeCharacters(new String(text, start, length));
- }
-
- public void setDefaultNamespace(String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeCData(String data) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeCharacters(String text) throws XMLStreamException {
- if (processingStack.get(depth).isNotEmpty) {
- writeStartElement(null, "$", null);
- _writeCharacters(text);
- writeEndElement();
- } else {
- _writeCharacters(text);
- }
- }
-
- private void _writeCharacters(String text) throws XMLStreamException {
- try {
- if (isNonString(processingStack.get(depth - 1).currentName)) {
- processingStack.get(depth).writer.write(JsonEncoder.encode(text));
- } else {
- processingStack.get(depth).writer.write("\"" + JsonEncoder.encode(text) + "\"");
- }
- processingStack.get(depth).lastWasPrimitive = true;
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- public void writeComment(String data) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeDTD(String dtd) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeDefaultNamespace(String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeEmptyElement(String localName) throws XMLStreamException {
- writeEmptyElement(null, localName, null);
- }
-
- public void writeEntityRef(String name) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeProcessingInstruction(String target) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeStartDocument(String version) throws XMLStreamException {
- }
-
- public void writeStartElement(String localName) throws XMLStreamException {
- writeStartElement(null, localName, null);
- }
-
- public NamespaceContext getNamespaceContext() {
- return null;
- }
-
- public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public Object getProperty(String name) throws IllegalArgumentException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public String getPrefix(String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void setPrefix(String prefix, String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeAttribute(String localName, String value) throws XMLStreamException {
- writeAttribute(null, null, localName, value);
- }
-
- public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
- writeEmptyElement(null, localName, null);
- }
-
- public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
- // we do not want to deal with namespaces
- // the main goal of this writer is keep the produced json as simple as possible
- }
-
- public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeStartDocument(String encoding, String version) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
- writeStartElement(null, localName, namespaceURI);
- }
-
- public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
- writeAttribute(null, namespaceURI, localName, value);
- }
-
- public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
- writeStartElement(localName);
- writeEndElement();
- }
-
- private void pollStack() throws IOException {
- processingStack.remove(depth--);
- }
-
- private void printStack(String localName) {
- try {
- for (int d = 0; d <= depth; d++) {
- mainWriter.write("\n**" + d + ":" + processingStack.get(d));
- }
- mainWriter.write("\n*** [" + localName + "]");
- } catch (IOException ex) {
- Logger.getLogger(JsonXmlStreamWriter.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
-
- private boolean isArrayElement(String name) {
- if (null == name) {
- return false;
- }
- return arrayElementNames.contains(name);
- }
-
- private boolean isNonString(String name) {
- if (null == name) {
- return false;
- }
- return nonStringElementNames.contains(name);
- }
-
- private String getEffectiveName(String namespaceURI, String localName) {
- if ((namespaceURI != null) && xml2JsonNs.containsKey(namespaceURI)) {
- return String.format("%s%c%s", xml2JsonNs.get(namespaceURI), nsSeparator,localName);
- } else {
- return localName;
- }
- }
-
- public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
- String effectiveName = getEffectiveName(namespaceURI, localName);
- processingStack.get(depth).isNotEmpty = true;
- processingStack.get(depth).currentName = effectiveName;
- try {
- boolean isNextArrayElement = processingStack.get(depth).currentName.equals(processingStack.get(depth).lastName);
- if (!isNextArrayElement) {
- if (isArrayElement(processingStack.get(depth).lastName)) {
- processingStack.get(depth).writer.write(processingStack.get(depth).lastIsArray ? "," : "[");
- processingStack.get(depth).lastIsArray = true;
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- } else {
- // write previous elements from buffer
- if (null != processingStack.get(depth).lastElementWriter) {
- if (processingStack.get(depth).lastIsArray) {
- processingStack.get(depth).writer.write(",");
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- processingStack.get(depth).writer.write("]");
- } else {
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- }
- }
-
- processingStack.get(depth).lastIsArray = false;
- }
- if (null != processingStack.get(depth).lastName) {
- if (processingStack.get(depth).lastIsArray) {
- processingStack.get(depth).writer.write("]");
- processingStack.get(depth).lastIsArray = false;
- }
- processingStack.get(depth).writer.write(","); // next element at the same level
- }
- if (null == processingStack.get(depth).lastWasPrimitive) {
- processingStack.get(depth).writer.write("{"); // first sub-element
- }
- processingStack.get(depth).writer.write("\"" + effectiveName + "\":");
- } else { // next array element
- processingStack.get(depth).writer.write(processingStack.get(depth).lastIsArray ? "," : "["); // next element at the same level
- processingStack.get(depth).lastIsArray = true;
- processingStack.get(depth).writer.write(processingStack.get(depth).lastElementWriter.getContent());
- }
- depth++;
- processingStack.add(depth, createProcessingState());
- } catch (IOException ex) {
- throw new XMLStreamException(ex);
- }
- }
-
- public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
- writeStartElement(prefix, "@" + getEffectiveName(namespaceURI, localName), null);
- writeCharacters(value);
- writeEndElement();
- }
-
- private ProcessingState createProcessingState() {
- switch (depth) {
- case 0:
- return new ProcessingState(
- stripRoot ? new DummyWriterAdapter() : new WriterAdapter(mainWriter));
- case 1:
- return stripRoot ? new ProcessingState(new WriterAdapter(mainWriter)) : new ProcessingState();
- default:
- return new ProcessingState();
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.java b/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.java
deleted file mode 100644
index 2d13f2984aa..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.json.impl.writer;
-
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo;
-import com.sun.xml.bind.v2.model.runtime.RuntimeReferencePropertyInfo;
-import com.sun.xml.bind.v2.runtime.XMLSerializer;
-import com.sun.xml.bind.v2.runtime.property.Property;
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.JsonGenerator;
-
-/**
- *
- * @author japod
- */
-public class Stax2JacksonWriter implements XMLStreamWriter {
-
- private static class ProcessingInfo {
-
- RuntimePropertyInfo rpi;
- boolean isArray;
- Type t;
- ProcessingInfo lastUnderlyingPI;
- boolean startObjectWritten = false;
- boolean afterFN = false;
- String elementName;
-
- public ProcessingInfo(String elementName, RuntimePropertyInfo rpi, boolean isArray, Type t) {
- this.elementName = elementName;
- this.rpi = rpi;
- this.isArray = isArray;
- this.t = t;
- }
-
- public ProcessingInfo(ProcessingInfo pi) {
- this(pi.elementName, pi.rpi, pi.isArray, pi.t);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final ProcessingInfo other = (ProcessingInfo) obj;
- if (this.rpi != other.rpi && (this.rpi == null || !this.rpi.equals(other.rpi))) {
- return false;
- }
- if (this.isArray != other.isArray) {
- return false;
- }
- if (this.t != other.t && (this.t == null || !this.t.equals(other.t))) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- int hash = 5;
- hash = 47 * hash + (this.rpi != null ? this.rpi.hashCode() : 0);
- hash = 47 * hash + (this.isArray ? 1 : 0);
- hash = 47 * hash + (this.t != null ? this.t.hashCode() : 0);
- return hash;
- }
- }
-
- final private boolean attrsWithPrefix;
-
- final static String XML_SCHEMA_INSTANCE = "http://www.w3.org/2001/XMLSchema-instance";
-
- JacksonStringMergingGenerator generator;
- final List<ProcessingInfo> processingStack = new ArrayList<ProcessingInfo>();
- boolean writingAttr = false;
-
- static <T> T pop(List<T> stack) {
- return stack.remove(stack.size() - 1);
- }
-
- static <T> T peek(List<T> stack) {
- return (stack.size() > 0) ? stack.get(stack.size() - 1) : null;
- }
-
- static <T> T peek2nd(List<T> stack) {
- return (stack.size() > 1) ? stack.get(stack.size() - 2) : null;
- }
-
- public Stax2JacksonWriter(JsonGenerator generator) {
- this(generator, JSONConfiguration.DEFAULT);
- }
-
- public Stax2JacksonWriter(JsonGenerator generator, JSONConfiguration config) {
- this.attrsWithPrefix = config.isUsingPrefixesAtNaturalAttributes();
- this.generator = JacksonStringMergingGenerator.createGenerator(generator);
- }
-
- @Override
- public void writeStartElement(String localName) throws XMLStreamException {
- writeStartElement(null, localName, null);
- }
-
- @Override
- public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
- writeStartElement(null, localName, namespaceURI);
- }
-
- private void ensureStartObjectBeforeFieldName(ProcessingInfo pi) throws JsonGenerationException, IOException {
- if ((pi != null) && pi.afterFN) {
- generator.writeStartObject();
- peek2nd(processingStack).startObjectWritten = true;
- pi.afterFN = false;
- }
- }
-
- @Override
- public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
- try {
- pushPropInfo(localName);
- ProcessingInfo currentPI = peek(processingStack);
- ProcessingInfo parentPI = peek2nd(processingStack);
- if (!currentPI.isArray) {
- if ((parentPI != null) && (parentPI.lastUnderlyingPI != null) && (parentPI.lastUnderlyingPI.isArray)) {
- generator.writeEndArray();
- parentPI.afterFN = false;
- }
- ensureStartObjectBeforeFieldName(parentPI);
- generator.writeFieldName(localName);
- currentPI.afterFN = true;
- } else {
- if ((parentPI == null) || (!currentPI.equals(parentPI.lastUnderlyingPI))) {
- // not the same array, need to close the last array off?
- if ((parentPI != null) && (parentPI.lastUnderlyingPI != null) && (parentPI.lastUnderlyingPI.isArray)) {
- generator.writeEndArray();
- parentPI.afterFN = false;
- }
- // now start the new array
- ensureStartObjectBeforeFieldName(parentPI);
- generator.writeFieldName(localName);
- generator.writeStartArray();
- currentPI.afterFN = true;
- } else {
- // next array element
- currentPI.afterFN = true;
- }
- }
- } catch (IOException ex) {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
- static final Type[] _pt = new Type[]{
- byte.class, short.class, int.class, long.class, float.class, double.class, boolean.class, char.class,
- Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class, Boolean.class, Character.class,
- String.class
- };
- static final Type[] _pta = new Type[]{
- byte[].class, short[].class, int[].class, long[].class, float[].class, double[].class, boolean[].class, char[].class,
- Byte[].class, Short[].class, Integer[].class, Long[].class, Float[].class, Double[].class, Boolean[].class, Character[].class,
- String[].class
- };
- static final Type[] _nst = new Type[]{
- byte.class, short.class, int.class, long.class, float.class, double.class, boolean.class,
- Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class, Boolean.class, BigInteger.class, BigDecimal.class,
- };
- static final Set<Type> primitiveTypes = new HashSet<Type>() {
-
- {
- addAll(Arrays.asList(_pt));
- }
- };
- static final Set<Type> primitiveTypeArrays = new HashSet<Type>() {
-
- {
- addAll(Arrays.asList(_pta));
- }
- };
- static final Set<Type> nonStringTypes = new HashSet<Type>() {
-
- {
- addAll(Arrays.asList(_nst));
- }
- };
- static final Map<Type, Type> pta2pMap = new HashMap<Type, Type>() {
-
- {
- for (int i = 0; i < _pta.length; i++) {
- put(_pta[i], _pt[i]);
- }
- }
- };
-
- private void pushPropInfo(String elementName) {
- ProcessingInfo parentPI = peek(processingStack);
- // still the same array, no need to dig out runtime property info
- if ((elementName != null) && (parentPI != null) && (parentPI.lastUnderlyingPI != null) && (elementName.equals(parentPI.lastUnderlyingPI.elementName))) {
- processingStack.add(new ProcessingInfo(parentPI.lastUnderlyingPI));
- return;
- }
- final XMLSerializer xs = XMLSerializer.getInstance();
- final Property cp = (xs == null) ? null : xs.getCurrentProperty();
- final RuntimePropertyInfo ri = (cp == null) ? null : cp.getInfo();
- final Type rt = (ri == null) ? null : ri.getRawType();
- final String dn = (ri == null) ? null : ri.getName();
- // rt is null for root elements
- if (null == rt) {
- if (writingAttr) {
- // this should not happen:
- processingStack.add(new ProcessingInfo(elementName, ri, false, null));
- return;
- } else {
- processingStack.add(new ProcessingInfo(elementName, ri, false, null));
- return;
- }
- }
- if (primitiveTypes.contains(rt)) {
- processingStack.add(new ProcessingInfo(elementName, ri, false, rt));
- return;
- }
- // TODO: wildcard could still simulate an array by adding several elements of the same name
- if (ri.isCollection() && !isWildcardElement(ri)) { // another array
- if (!((parentPI != null) && (parentPI.isArray) && (parentPI.rpi == ri))) {
- // another array
- processingStack.add(new ProcessingInfo(elementName, ri, true, rt));
- return;
- }
- }
- // something else
- processingStack.add(new ProcessingInfo(elementName, ri, false, rt));
- return;
- }
-
- private boolean isWildcardElement(RuntimePropertyInfo ri) {
- return (ri instanceof RuntimeReferencePropertyInfo) && (((RuntimeReferencePropertyInfo)ri).getWildcard() != null);
- }
-
- @Override
- public void writeEmptyElement(String localName) throws XMLStreamException {
- writeEmptyElement(null, localName, null);
- }
-
- @Override
- public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
- writeEmptyElement(null, localName, namespaceURI);
- }
-
- @Override
- public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
- writeStartElement(prefix, localName, namespaceURI);
- writeEndElement();
- }
-
- private void cleanlyEndObject(ProcessingInfo pi) throws IOException {
- if (pi.startObjectWritten) {
- generator.writeEndObject();
- } else {
- if (pi.afterFN && pi.lastUnderlyingPI == null) {
- generator.writeNull();
- }
- }
- }
-
- @Override
- public void writeEndElement() throws XMLStreamException {
- try {
- ProcessingInfo removedPI = pop(processingStack);
- ProcessingInfo currentPI = peek(processingStack);
- if (currentPI != null) {
- currentPI.lastUnderlyingPI = removedPI;
- }
- // need to check first, if there was an array to be closed off
- if ((removedPI.lastUnderlyingPI != null) && (removedPI.lastUnderlyingPI.isArray)) {
- generator.writeEndArray();
- }
- cleanlyEndObject(removedPI);
- } catch (IOException ex) {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- @Override
- public void writeEndDocument() throws XMLStreamException {
- try {
- generator.writeEndObject();
- } catch (IOException ex) {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- @Override
- public void close() throws XMLStreamException {
- try {
- generator.close();
- } catch (IOException ex) {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- @Override
- public void flush() throws XMLStreamException {
- try {
- generator.flush();
- } catch (IOException ex) {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- @Override
- public void writeAttribute(String localName, String value) throws XMLStreamException {
- writeAttribute(null, null, localName, value);
- }
-
- @Override
- public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
- writeAttribute(null, namespaceURI, localName, value);
- }
-
- @Override
- public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
- writingAttr = true;
- writeStartElement(prefix, attrsWithPrefix ? ("@" + localName) : localName, namespaceURI);
- writingAttr = false;
- // a dirty hack, since jaxb ri is giving us wrong info on the actual attribute type in this case
- writeCharacters(value, "type".equals(localName) && XML_SCHEMA_INSTANCE.equals(namespaceURI));
- writeEndElement();
- }
-
- @Override
- public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
- // we do not want to deal with namespaces
- // the main goal of this writer is keep the produced json as simple as possible
- }
-
- @Override
- public void writeDefaultNamespace(String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void writeComment(String data) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void writeProcessingInstruction(String target) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void writeCData(String data) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void writeDTD(String dtd) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void writeEntityRef(String name) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void writeStartDocument() throws XMLStreamException {
- writeStartDocument(null, null);
- }
-
- @Override
- public void writeStartDocument(String version) throws XMLStreamException {
- writeStartDocument(null, version);
- }
-
- @Override
- public void writeStartDocument(String encoding, String version) throws XMLStreamException {
- try {
- generator.writeStartObject();
- } catch (IOException ex) {
- //JRA-18973: Log Socket exceptions that can happen quite often when browsers close connections pre-maturely at DEBUG level.
- // Also don't need to throw the exception further up but just swallow it here.
- if (ex instanceof java.net.SocketTimeoutException || ex instanceof java.net.SocketException) {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.FINE, "Socket excption", ex);
- } else {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.SEVERE, "IO exception", ex);
- throw new XMLStreamException(ex);
- }
- }
- }
-
- private void writeCharacters(String text, boolean forceString) throws XMLStreamException {
- try {
- ProcessingInfo currentPI = peek(processingStack);
- if (currentPI.startObjectWritten && !currentPI.afterFN) {
- generator.writeFieldName("$");
- }
- currentPI.afterFN = false;
- if (forceString || !nonStringTypes.contains(currentPI.t)) {
- if (!currentPI.isArray) {
- generator.writeStringToMerge(text);
- } else {
- generator.writeString(text);
- }
- } else {
- if ((boolean.class == currentPI.t) || (Boolean.class == currentPI.t)) {
- generator.writeBoolean(Boolean.parseBoolean(text));
- } else {
- generator.writeNumber(text);
- }
- }
- } catch (IOException ex) {
- Logger.getLogger(Stax2JacksonWriter.class.getName()).log(Level.SEVERE, null, ex);
- throw new XMLStreamException(ex);
- }
- }
-
- @Override
- public void writeCharacters(String text) throws XMLStreamException {
- writeCharacters(text, false);
- }
-
- @Override
- public void writeCharacters(char[] text, int start, int length) throws XMLStreamException {
- writeCharacters(new String(text, start, length));
- }
-
- @Override
- public String getPrefix(String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void setPrefix(String prefix, String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void setDefaultNamespace(String uri) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public NamespaceContext getNamespaceContext() {
- return null;
- }
-
- @Override
- public Object getProperty(String name) throws IllegalArgumentException {
- throw new UnsupportedOperationException("Not supported yet.");
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizable.java b/plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizable.java
deleted file mode 100644
index 9b66358c052..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizable.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.localization;
-
-/**
- * Localizable message.
- *
- * @author WS Development Team
- */
-public interface Localizable {
- /**
- * Gets the key in the resource bundle.
- *
- * @return
- * if this method returns {@link #NOT_LOCALIZABLE},
- * that means the message is not localizable, and
- * the first item of {@link #getArguments()} array
- * holds a String.
- */
- public String getKey();
-
- /**
- * Returns the arguments for message formatting.
- *
- * @return
- * can be an array of length 0 but never be null.
- */
- public Object[] getArguments();
- public String getResourceBundleName();
-
-
- /**
- * Special constant that represents a message that
- * is not localizable.
- *
- * <p>
- * Use of "new" is to create an unique instance.
- */
- public static final String NOT_LOCALIZABLE = new String("\u0000");
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessage.java b/plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessage.java
deleted file mode 100644
index cb15a86ae38..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessage.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.localization;
-
-/**
- * @author WS Development Team
- */
-public final class LocalizableMessage implements Localizable {
-
- private final String _bundlename;
- private final String _key;
- private final Object[] _args;
-
- public LocalizableMessage(String bundlename, String key, Object... args) {
- _bundlename = bundlename;
- _key = key;
- if(args==null)
- args = new Object[0];
- _args = args;
- }
-
- public String getKey() {
- return _key;
- }
-
- public Object[] getArguments() {
- return _args;
- }
-
- public String getResourceBundleName() {
- return _bundlename;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessageFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessageFactory.java
deleted file mode 100644
index 488c755c6da..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/localization/LocalizableMessageFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.localization;
-
-/**
- * @author WS Development Team
- */
-public class LocalizableMessageFactory {
-
- private final String _bundlename;
-
- public LocalizableMessageFactory(String bundlename) {
- _bundlename = bundlename;
- }
-
- public Localizable getMessage(String key, Object... args) {
- return new LocalizableMessage(_bundlename, key, args);
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizer.java b/plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizer.java
deleted file mode 100644
index 1d064b6ffe0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/localization/Localizer.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.localization;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * Localizes the {@link Localizable} into a message
- * by using a configured {@link Locale}.
- *
- * @author WS Development Team
- */
-public class Localizer {
-
- private final Locale _locale;
- private final HashMap _resourceBundles;
-
- public Localizer() {
- this(Locale.getDefault());
- }
-
- public Localizer(Locale l) {
- _locale = l;
- _resourceBundles = new HashMap();
- }
-
- public Locale getLocale() {
- return _locale;
- }
-
- public String localize(Localizable l) {
- String key = l.getKey();
- if (key == Localizable.NOT_LOCALIZABLE) {
- // this message is not localizable
- return (String) l.getArguments()[0];
- }
- String bundlename = l.getResourceBundleName();
-
- try {
- ResourceBundle bundle =
- (ResourceBundle) _resourceBundles.get(bundlename);
-
- if (bundle == null) {
- try {
- bundle = ResourceBundle.getBundle(bundlename, _locale);
- } catch (MissingResourceException e) {
- // work around a bug in the com.sun.enterprise.deployment.WebBundleArchivist:
- // all files with an extension different from .class (hence all the .properties files)
- // get copied to the top level directory instead of being in the package where they
- // are defined
- // so, since we can't find the bundle under its proper name, we look for it under
- // the top-level package
-
- int i = bundlename.lastIndexOf('.');
- if (i != -1) {
- String alternateBundleName =
- bundlename.substring(i + 1);
- try {
- bundle =
- ResourceBundle.getBundle(
- alternateBundleName,
- _locale);
- } catch (MissingResourceException e2) {
- // give up
- return getDefaultMessage(l);
- }
- }
- }
-
- _resourceBundles.put(bundlename, bundle);
- }
-
- if (bundle == null) {
- return getDefaultMessage(l);
- }
-
- if (key == null)
- key = "undefined";
-
- String msg;
- try {
- msg = bundle.getString(key);
- } catch (MissingResourceException e) {
- // notice that this may throw a MissingResourceException of its own (caught below)
- msg = bundle.getString("undefined");
- }
-
- // localize all arguments to the given localizable object
- Object[] args = l.getArguments();
- for (int i = 0; i < args.length; ++i) {
- if (args[i] instanceof Localizable)
- args[i] = localize((Localizable) args[i]);
- }
-
- String message = MessageFormat.format(msg, args);
- return message;
-
- } catch (MissingResourceException e) {
- return getDefaultMessage(l);
- }
-
- }
-
- private String getDefaultMessage(Localizable l) {
- String key = l.getKey();
- Object[] args = l.getArguments();
- StringBuilder sb = new StringBuilder();
- sb.append("[failed to localize] ");
- sb.append(key);
- if (args != null) {
- sb.append('(');
- for (int i = 0; i < args.length; ++i) {
- if (i != 0)
- sb.append(", ");
- sb.append(String.valueOf(args[i]));
- }
- sb.append(')');
- }
- return sb.toString();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPart.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPart.java
deleted file mode 100644
index c1feb748823..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPart.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import com.sun.jersey.core.header.ContentDisposition;
-import com.sun.jersey.core.header.ParameterizedHeader;
-import com.sun.jersey.core.util.UnmodifiableMultivaluedMap;
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.text.ParseException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Providers;
-
-/**
- * <p>A mutable model representing a body part nested inside a MIME MultiPart
- * entity.</p>
- */
-public class BodyPart {
-
-
- // ------------------------------------------------------------ Constructors
-
-
- /**
- * <p>Instantiate a new {@link BodyPart} with a <code>mediaType</code> of
- * <code>text/plain</code>.</p>
- */
- public BodyPart() {
- this(MediaType.TEXT_PLAIN_TYPE);
- }
-
-
- /**
- * <p>Instantiate a new {@link BodyPart} with the specified characteristics.</p>
- *
- * @param mediaType The {@link MediaType} for this body part
- */
- public BodyPart(MediaType mediaType) {
- setMediaType(mediaType);
- }
-
-
- /**
- * <p>Instantiate a new {@link BodyPart} with the specified characteristics.</p>
- *
- * @param entity The entity for this body part
- * @param mediaType The {@link MediaType} for this body part
- */
- public BodyPart(Object entity, MediaType mediaType) {
- setEntity(entity);
- setMediaType(mediaType);
- }
-
-
- // -------------------------------------------------------------- Properties
-
-
- private Object entity;
-
-
- /**
- * <p>Return the entity object to be unmarshalled from a request, or to be
- * marshalled on a response.</p>
- *
- * @exception IllegalStateException if this method is called on a
- * {@link MultiPart} instance; access the underlying {@link BodyPart}s instead
- */
- public Object getEntity() {
- return this.entity;
- }
-
-
- /**
- * <p>Set the entity object to be unmarshalled from a request, or to be
- * marshalled on a response.</p>
- *
- * @param entity The new entity object
- *
- * @exception IllegalStateException if this method is called on a
- * {@link MultiPart} instance; access the underlying {@link BodyPart}s instead
- */
- public void setEntity(Object entity) {
- this.entity = entity;
- }
-
-
- private MultivaluedMap<String,String> headers = new HeadersMap();
-
-
- /**
- * <p>Return a mutable map of HTTP header value(s) for this {@link BodyPart},
- * keyed by the header name. Key comparisons in the returned map must be
- * case-insensitive.</p>
- *
- * <p>Note that, per the MIME specifications, only headers that match
- * <code>Content-*</code> should be included on a {@link BodyPart}.</p>
- */
- public MultivaluedMap<String, String> getHeaders() {
- return this.headers;
- }
-
-
- /**
- * <p>Return an immutable map of parameterized HTTP header value(s) for this
- * {@link BodyPart}, keyed by header name. Key comparisons in the
- * returned map must be case-insensitive. If you wish to modify the
- * headers map for this {@link BodyPart}, modify the map returned by
- * <code>getHeaders()</code> instead.</p>
- */
- public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException {
- return new UnmodifiableMultivaluedMap<String,ParameterizedHeader>(
- new ParameterizedHeadersMap(headers));
- }
-
-
- protected ContentDisposition cd = null;
-
- /**
- * Get the content disposition.
- * <p>
- * The "Content-Disposition" header, if present, will be parsed.
- *
- * @return the content disposition, will be null if not present.
- * @throws IllegalArgumentException if the content disposition header
- * cannot be parsed.
- */
- public ContentDisposition getContentDisposition() {
- if (cd == null) {
- String scd = headers.getFirst("Content-Disposition");
- if (scd != null) {
- try {
- cd = new ContentDisposition(scd);
- } catch (ParseException ex) {
- throw new IllegalArgumentException("Error parsing content disposition: " + scd, ex);
- }
- }
- }
- return cd;
- }
-
- /**
- * Set the content disposition.
- *
- * @param cd the content disposition.
- */
- public void setContentDisposition(ContentDisposition cd) {
- this.cd = cd;
- headers.remove("Content-Disposition");
- }
-
- private MediaType mediaType = null;
-
- /**
- * <p>Return the {@link MediaType} for this {@link BodyPart}. If never
- * set, the default {@link MediaType} MUST be <code>text/plain</code>.</p>
- */
- public MediaType getMediaType() {
- return this.mediaType;
- }
-
-
- /**
- * <p>Set the {@link MediaType} for this {@link BodyPart}.
- *
- * @param mediaType The new {@link MediaType}
- * @throws IllegalArgumentException if the <code>mediaType</code> is null.
- */
- public void setMediaType(MediaType mediaType) {
- if (mediaType == null)
- throw new IllegalArgumentException("mediaType cannot be null");
-
- this.mediaType = mediaType;
- }
-
-
- private MultiPart parent = null;
-
-
- /**
- * <p>Return the parent {@link MultiPart} (if any) for this {@link BodyPart}.
- */
- public MultiPart getParent() {
- return this.parent;
- }
-
-
- /**
- * <p>Set the parent {@link MultiPart} (if any) for this {@link BodyPart}.</p>
- *
- * @param parent The new parent
- */
- public void setParent(MultiPart parent) {
- this.parent = parent;
- }
-
-
- private Providers providers = null;
-
-
- /**
- * <p>Return the configured {@link Providers} for this {@link BodyPart}.</p>
- */
- public Providers getProviders() {
- return this.providers;
- }
-
-
- /**
- * <p>Set the configured {@link Providers} for this {@link BodyPart}.</p>
- *
- * @param providers The new {@link Providers}
- */
- public void setProviders(Providers providers) {
- this.providers = providers;
- }
-
-
- // ---------------------------------------------------------- Public Methods
-
-
- /**
- * <p>Perform any necessary cleanup at the end of processing this
- * {@link BodyPart}.</p>
- */
- public void cleanup() {
- if ((getEntity() != null) && (getEntity() instanceof BodyPartEntity)) {
- ((BodyPartEntity) getEntity()).cleanup();
- }
- }
-
-
- /**
- * <p>Builder pattern method to return this {@link BodyPart} after
- * additional configuration.</p>
- *
- * @param entity Entity to set for this {@link BodyPart}
- */
- public BodyPart entity(Object entity) {
- setEntity(entity);
- return this;
- }
-
- /**
- * <p>Return the entity after appropriate conversion to the requested
- * type. This is useful only when the containing {@link MultiPart}
- * instance has been received, which causes the <code>providers</code> property
- * to have been set.</p>
- *
- * @param clazz Desired class into which the entity should be converted
- *
- * @exception IllegalArgumentException if no {@link MessageBodyReader} can
- * be found to perform the requested conversion
- * @exception IllegalStateException if this method is called when the
- * <code>providers</code> property has not been set or when the
- * entity instance is not the unconverted content of the body part entity
- */
- public <T> T getEntityAs(Class<T> clazz) {
- if ((entity == null) || !(entity instanceof BodyPartEntity)) {
- throw new IllegalStateException("Entity instance does not contain the unconverted content");
- }
- if (getProviders() == null) {
- throw new IllegalStateException("The providers property has not been set, which is done automatically when a MultiPart entity is received");
- }
- Annotation annotations[] = new Annotation[0];
- MessageBodyReader<T> reader =
- getProviders().getMessageBodyReader(clazz, clazz, annotations, mediaType);
- if (reader == null) {
- throw new IllegalArgumentException("No available MessageBodyReader for class " + clazz.getName() + " and media type " + mediaType);
- }
- try {
- return reader.readFrom(clazz, clazz, annotations, mediaType, headers,
- ((BodyPartEntity) entity).getInputStream());
- } catch (IOException e) {
- return null; // Can not happen
- }
- }
-
- /**
- * <p>Builder pattern method to return this {@link BodyPart} after
- * additional configuration.</p>
- *
- * @param type Media type to set for this {@link BodyPart}
- */
- public BodyPart type(MediaType type) {
- setMediaType(type);
- return this;
- }
-
- public BodyPart contentDisposition(ContentDisposition cd) {
- setContentDisposition(cd);
- return this;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartEntity.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartEntity.java
deleted file mode 100644
index 9c5f9a4d63c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartEntity.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import org.jvnet.mimepull.MIMEPart;
-
-/**
- * Proxy class representing the entity of a {@link BodyPart} when a
- * {@link MultiPart} entity is received and parsed.
- * <p>
- * Its primary purpose is to provide an input stream to retrieve the actual data.
- * However, it also transparently deals with storing the data in a temporary disk
- * file, if it is larger than a configurable size; otherwise, the data is stored
- * in memory for faster processing.
- */
-public class BodyPartEntity implements Closeable {
- private final MIMEPart mimePart;
-
- /**
- * Construct a new {@link BodyPartEntity} with a {@link MIMEPart}.
- *
- * @param mimePart <code>MIMEPart</code> containing the input stream
- * of this body part entity.
- */
- public BodyPartEntity(MIMEPart mimePart) {
- this.mimePart = mimePart;
- }
-
-
- /**
- * Get the input stream to the raw bytes of this body part entity.
- *
- * @return the input stream of the body part entity.
- */
- public InputStream getInputStream() {
- return mimePart.read();
- }
-
- /**
- * Clean up temporary file(s), if any were utilized.
- */
- public void cleanup() {
- mimePart.close();
- }
-
- // Closeable
-
- /**
- * Defer to {@link #cleanup}.
- *
- */
- public void close() throws IOException {
- cleanup();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartsList.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartsList.java
deleted file mode 100644
index a8e6d23d376..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/BodyPartsList.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.sun.jersey.multipart;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-/**
- * <p>Custom <code>List<BodyPart></code> implementation that maintains
- * parentage information automatically.</p>
- */
-class BodyPartsList extends ArrayList<BodyPart> {
-
- BodyPartsList(MultiPart parent) {
- this.parent = parent;
- }
-
- MultiPart parent = null;
-
- @Override
- public boolean add(BodyPart bp) {
- super.add(bp);
- bp.setParent(parent);
- return true;
- }
-
- @Override
- public void add(int index, BodyPart bp) {
- super.add(index, bp);
- bp.setParent(parent);
- }
-
- @Override
- public boolean addAll(Collection<? extends BodyPart> bps) {
- if (super.addAll(bps)) {
- for (BodyPart bp : bps) {
- bp.setParent(parent);
- }
- return true;
- } else {
- return false;
- }
- }
-
- @Override
- public boolean addAll(int index, Collection<? extends BodyPart> bps) {
- if (super.addAll(index, bps)) {
- for (BodyPart bp : bps) {
- bp.setParent(parent);
- }
- return true;
- } else {
- return false;
- }
- }
-
- @Override
- public void clear() {
- BodyPart bps[] = super.toArray(new BodyPart[super.size()]);
- super.clear();
- for (BodyPart bp : bps) {
- bp.setParent(null);
- }
- }
-
- @Override
- public BodyPart remove(int index) {
- BodyPart bp = super.remove(index);
- if (bp != null) {
- bp.setParent(null);
- }
- return bp;
- }
-
- @Override
- public boolean remove(Object bp) {
- if (super.remove(bp)) {
- ((BodyPart) bp).setParent(null);
- return true;
- } else {
- return false;
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/Boundary.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/Boundary.java
deleted file mode 100644
index ba2259cfbd8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/Boundary.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Utility for creating boundary parameters.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class Boundary {
-
- public static final String BOUNDARY_PARAMETER = "boundary";
-
- /**
- * Transform a media type and add a boundary parameter with a unique value
- * if one is not already present.
- *
- * @param mediaType, if null then a media type of "multipart/mixed" with
- * a boundary parameter will be returned.
- * @return the media type with a boundary parameter.
- */
- public static MediaType addBoundary(MediaType mediaType) {
- if (mediaType == null) {
- return MultiPartMediaTypes.createMixed();
- }
-
- if (!mediaType.getParameters().containsKey(BOUNDARY_PARAMETER)) {
- final Map<String, String> parameters = new HashMap<String, String>(
- mediaType.getParameters());
- parameters.put(BOUNDARY_PARAMETER, createBoundary());
-
- return new MediaType(mediaType.getType(), mediaType.getSubtype(),
- parameters);
- }
-
- return mediaType;
- }
-
-
- private final static AtomicInteger boundaryCounter = new AtomicInteger();
-
- /**
- * Create a unique boundary.
- *
- * @return the boundary.
- */
- public static String createBoundary() {
- return new StringBuilder("Boundary_").
- append(boundaryCounter.incrementAndGet()).
- append('_').
- append(new Object().hashCode()).
- append('_').
- append(System.currentTimeMillis()).
- toString();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataBodyPart.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataBodyPart.java
deleted file mode 100644
index 6c4987d0976..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataBodyPart.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import com.sun.jersey.core.header.ContentDisposition;
-import com.sun.jersey.core.header.FormDataContentDisposition;
-import com.sun.jersey.core.header.MediaTypes;
-import java.text.ParseException;
-import javax.ws.rs.core.MediaType;
-
-/**
- * <p>Subclass of {@link BodyPart} with specialized support for media type
- * <code>multipart/form-data</code>. See
- * <a href="http://www.ietf.org/rfc/rfc2388.txt">RFC 2388</a>
- * for the formal definition of this media type.</p>
- *
- * <p>For a server side application wishing to process an incoming
- * <code>multipart/form-data</code> message, the following features
- * are provided:</p>
- * <ul>
- * <li>Property accessor to retrieve the control name.</li>
- * <li>Property accessor to retrieve the field value for a simple
- * String field.</li>
- * <li>Convenience accessor to retrieve the field value after conversion
- * through an appropriate <code>MessageBodyReader</code>.</li>
- * </ul>
- *
- * <p>For a client side application wishing to construct an outgoing
- * <code>multipart/form-data</code> message, the following features
- * are provided:</p>
- * <ul>
- * <li>Convenience constructors for named fields with either
- * simple string values, or arbitrary entities and media types.</li>
- * <li>Property accessor to set the control name.</li>
- * <li>Property accessor to set the field value for a simple
- * String field.</li>
- * <li>Convenience accessor to set the media type and value of a
- * "file" field.</li>
- * </ul>
- *
- * @author Craig.McClanahan@Sun.COM
- * @author Paul.Sandoz@Sun.Com
- * @author imran@smartitengineering.com
- */
-public class FormDataBodyPart extends BodyPart {
-
- /**
- * <Instantiate an unnamed new {@link FormDataBodyPart} with a
- * <code>mediaType</code> of <code>text/plain</code>.
- */
- public FormDataBodyPart() {
- super();
- }
-
-
- /**
- * Instantiate an unnamed {@link FormDataBodyPart} with the
- * specified characteristics.
- *
- * @param mediaType The {@link MediaType} for this body part
- */
- public FormDataBodyPart(MediaType mediaType) {
- super(mediaType);
- }
-
-
- /**
- * Instantiate an unnamed {@link FormDataBodyPart} with the
- * specified characteristics.
- *
- * @param entity The entity for this body part
- * @param mediaType The {@link MediaType} for this body part
- */
- public FormDataBodyPart(Object entity, MediaType mediaType) {
- super(entity, mediaType);
- }
-
-
- /**
- * Instantiate a named {@link FormDataBodyPart} with a
- * media type of <code>text/plain</code> and String value.
- *
- * @param name the control name for this body part
- * @param value the value for this body part
- */
- public FormDataBodyPart(String name, String value) {
- super(value, MediaType.TEXT_PLAIN_TYPE);
- setName(name);
- }
-
-
- /**
- * Instantiate a named {@link FormDataBodyPart} with the
- * specified characteristics.
- *
- * @param name the control name for this body part
- * @param entity the entity for this body part
- * @param mediaType the {@link MediaType} for this body part
- */
- public FormDataBodyPart(String name, Object entity, MediaType mediaType) {
- super(entity, mediaType);
- setName(name);
- }
-
-
- /**
- * Instantiate a named {@link FormDataBodyPart} with the
- * specified characteristics.
- *
- * @param fdcd the content disposition header for this body part.
- * @param value the value for this body part
- */
- public FormDataBodyPart(FormDataContentDisposition fdcd, String value) {
- super(value, MediaType.TEXT_PLAIN_TYPE);
- setFormDataContentDisposition(fdcd);
- }
-
-
- /**
- * Instantiate a named {@link FormDataBodyPart} with the
- * specified characteristics.
- *
- * @param fdcd the content disposition header for this body part.
- * @param entity The entity for this body part
- * @param mediaType The {@link MediaType} for this body part
- */
- public FormDataBodyPart(FormDataContentDisposition fdcd, Object entity, MediaType mediaType) {
- super(entity, mediaType);
- setFormDataContentDisposition(fdcd);
- }
-
- /**
- * Get the form data content disposition.
- *
- * @return the form data content disposition.
- */
- public FormDataContentDisposition getFormDataContentDisposition() {
- return (FormDataContentDisposition)getContentDisposition();
- }
-
- /**
- * Set the form data content disposition.
- *
- * @param cd the form data content disposition.
- */
- public void setFormDataContentDisposition(FormDataContentDisposition cd) {
- super.setContentDisposition(cd);
- }
-
- /**
- * Override the behaviour on {@link BodyPart} to ensure that
- * only instances of {@link FormDataContentDisposition} can be obtained.
- *
- * @return the content disposition.
- * @throws IllegalArgumentException if the content disposition header
- * cannot be parsed.
- */
- @Override
- public ContentDisposition getContentDisposition() {
- if (cd == null) {
- String scd = getHeaders().getFirst("Content-Disposition");
- if (scd != null) {
- try {
- cd = new FormDataContentDisposition(scd);
- } catch (ParseException ex) {
- throw new IllegalArgumentException("Error parsing content disposition: " + scd, ex);
- }
- }
- }
- return cd;
- }
-
- /**
- * Override the behaviour on {@link BodyPart} to ensure that
- * only instances of {@link FormDataContentDisposition} can be set.
- *
- * @param cd the content disposition which must be an instance
- * of {@link FormDataContentDisposition}.
- * @throws IllegalArgumentException if the content disposition is not an
- * instance of {@link FormDataContentDisposition}.
- */
- @Override
- public void setContentDisposition(ContentDisposition cd) {
- if (cd instanceof FormDataContentDisposition) {
- super.setContentDisposition(cd);
- } else {
- throw new IllegalArgumentException();
- }
- }
-
-
- /**
- * Get the control name.
- *
- * @return the control name.
- */
- public String getName() {
- FormDataContentDisposition fdcd = getFormDataContentDisposition();
- if (fdcd == null)
- return null;
-
- return fdcd.getName();
- }
-
- /**
- * Set the control name.
- *
- * @param name the control name.
- */
- public void setName(String name) {
- if(name == null) {
- throw new IllegalArgumentException("Name can not be null.");
- }
- if (getFormDataContentDisposition() == null) {
- FormDataContentDisposition contentDisposition;
- contentDisposition = FormDataContentDisposition.name(name)
- .build();
- super.setContentDisposition(contentDisposition);
- } else {
- FormDataContentDisposition _cd = getFormDataContentDisposition();
- _cd = FormDataContentDisposition.name(name).
- fileName(cd.getFileName()).
- creationDate(cd.getCreationDate()).
- modificationDate(cd.getModificationDate()).
- readDate(cd.getReadDate()).
- size(cd.getSize()).
- build();
- super.setContentDisposition(_cd);
- }
- }
-
-
- /**
- * Get the field value for this body part. This should be called
- * only on body parts representing simple field values.
- *
- * @return the simple field value.
- * @throws IllegalStateException if called on a body part with a
- * media type other than <code>text/plain</code>
- */
- public String getValue() {
- if (!MediaTypes.typeEquals(MediaType.TEXT_PLAIN_TYPE, getMediaType())) {
- throw new IllegalStateException("Media type is not text/plain");
- }
- if (getEntity() instanceof BodyPartEntity) {
- return getEntityAs(String.class);
- } else {
- return (String) getEntity();
- }
- }
-
-
- /**
- * Get the field value after appropriate conversion to the requested
- * type. This is useful only when the containing {@link FormDataMultiPart}
- * instance has been received, which causes the <code>providers</code>
- * property to have been set.
- *
- * @param <T> the type of the field value.
- * @param clazz Desired class into which the field value should be converted
- * @return the field value
- * @throws IllegalArgumentException if no <code>MessageBodyReader</code> can
- * be found to perform the requested conversion
- * @throws IllegalStateException if this method is called when the
- * <code>providers</code> property has not been set or when the
- * entity instance is not the unconverted content of the body part
- * entity
- */
- public <T> T getValueAs(Class<T> clazz) {
- return getEntityAs(clazz);
- }
-
- /**
- * Set the field value for this body part. This should be called
- * only on body parts representing simple field values.
- *
- * @param value the field value
- * @throws IllegalStateException if called on a body part with a
- * media type other than <code>text/plain</code>
- */
- public void setValue(String value) {
- if (!MediaType.TEXT_PLAIN_TYPE.equals(getMediaType())) {
- throw new IllegalStateException("Media type is not text/plain");
- }
- setEntity(value);
- }
-
- /**
- * Set the field media type and value for this body part.
- *
- * @param mediaType the media type for this field value
- * @param value the field value as a Java object
- */
- public void setValue(MediaType mediaType, Object value) {
- setMediaType(mediaType);
- setEntity(value);
- }
-
- /**
- *
- * @return true if this body part represents a simple, string-based,
- * field value, otherwise false.
- */
- public boolean isSimple() {
- return MediaType.TEXT_PLAIN_TYPE.equals(getMediaType());
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataMultiPart.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataMultiPart.java
deleted file mode 100644
index bb63a563b20..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataMultiPart.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import com.sun.jersey.core.header.MediaTypes;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.MediaType;
-
-/**
- * <p>Subclass of {@link MultiPart} with specialized support for media type
- * <code>multipart/form-data</code>. See
- * <a href="http://www.ietf.org/rfc/rfc2388.txt">RFC 2388</a>
- * for the formal definition of this media type.</p>
- *
- * <p>For a server side application wishing to process an incoming
- * <code>multipart/form-data</code> message, the following features
- * are provided:</p>
- * <ul>
- * <li>Incoming entities will be of type {@link FormDataMultiPart},
- * enabling access to the specialized methods.</li>
- * <li>Incoming body parts will be of type {@link FormDataBodyPart},
- * enabling access to its specialized methods.</li>
- * <li>Convenience method to return the {@link FormDataBodyPart} for a
- * specified control name.</li>
- * <li>Convenience method to return a <code>Map</code> of {@link FormDataBodyPart}s
- * for all fields, keyed by field name.</li>
- * </ul>
- *
- * <p>For a client side application wishing to construct an outgoing
- * <code>multipart/form-data</code> message, the following features
- * are provided:</p>
- * <ul>
- * <li>Media type of the {@link FormDataMultiPart} instance will automatically
- * set to <code>multipart/form-data</code>.</li>
- * <li>Builder pattern method to add simple field values as body parts of
- * type <code>text/plain</code>.</li>
- * <li>Builder pattern method to add named "file" field values with arbitrary
- * media types.</li>
- * </ul>
- *
- * <p><strong>FIXME</strong> - Consider supporting the use case of a nested
- * <code>multipart/mixed</code> body part to contain multiple uploaded files.</p>
- */
-public class FormDataMultiPart extends MultiPart {
-
-
- /**
- * Instantiate a new {@link FormDataMultiPart} instance with
- * default characteristics.
- */
- public FormDataMultiPart() {
- super(MediaType.MULTIPART_FORM_DATA_TYPE);
- }
-
- /**
- * Builder pattern method to add a named field with a text value,
- * and return this instance.
- *
- * @param name the control name
- * @param value the text value
- * @return this instance.
- */
- public FormDataMultiPart field(String name, String value) {
- getBodyParts().add(new FormDataBodyPart(name, value));
- return this;
- }
-
-
- /**
- * Builder pattern method to add a named field with an arbitrary
- * media type and entity, and return this instance.
- *
- * @param name the control name.
- * @param entity entity value for the new field
- * @param mediaType media type for the new field
- * @return this instance.
- */
- public FormDataMultiPart field(String name, Object entity, MediaType mediaType) {
- getBodyParts().add(new FormDataBodyPart(name, entity, mediaType));
- return this;
- }
-
-
- /**
- * Get a form data body part given a control name.
- * <p>
- *
- * @param name the control name.
- * @return the form data body part, otherwise null if no part
- * is present with the given control name. If more that one
- * part is present with the same control name, then the first
- * part that occurs is returned.
- */
- public FormDataBodyPart getField(String name) {
- FormDataBodyPart result = null;
- for (BodyPart bodyPart : getBodyParts()) {
- if (!(bodyPart instanceof FormDataBodyPart)) {
- continue;
- }
- if (name.equals(((FormDataBodyPart) bodyPart).getName())) {
- result = (FormDataBodyPart) bodyPart;
- }
- }
- return result;
- }
-
- /**
- * Get a list of one or more form data body parts given a control name.
- *
- * @param name the control name.
- * @return the list of form data body parts, otherwise null if no parts
- * are present with the given control name.
- */
- public List<FormDataBodyPart> getFields(String name) {
- List<FormDataBodyPart> result = null;
- for (BodyPart bodyPart : getBodyParts()) {
- if (!(bodyPart instanceof FormDataBodyPart)) {
- continue;
- }
- if (name.equals(((FormDataBodyPart) bodyPart).getName())) {
- if (result == null)
- result = new ArrayList<FormDataBodyPart>(1);
- result.add((FormDataBodyPart) bodyPart);
- }
- }
- return result;
- }
-
- /**
- * Get a map of form data body parts where the key is the control name
- * and the value is a list of one or more form data body parts.
- *
- * @return return the map of form data body parts.
- */
- public Map<String, List<FormDataBodyPart>> getFields() {
- Map<String, List<FormDataBodyPart>> map = new HashMap<String, List<FormDataBodyPart>>();
- for (BodyPart bodyPart : getBodyParts()) {
- if (!(bodyPart instanceof FormDataBodyPart)) {
- continue;
- }
-
- FormDataBodyPart p = (FormDataBodyPart) bodyPart;
- List<FormDataBodyPart> l = map.get(p.getName());
- if (l == null) {
- l = new ArrayList<FormDataBodyPart>(1);
- map.put(p.getName(), l);
- }
- l.add(p);
- }
- return map;
- }
-
- /**
- * Disable changing the media type to anything other than
- * <code>multipart/form-data</code>.
- *
- * @param mediaType The proposed media type
- *
- * @exception IllegalArgumentException if the proposed media type is not
- * <code>multipart/form-data</code>
- */
- @Override
- public void setMediaType(MediaType mediaType) {
- if (!MediaTypes.typeEquals(mediaType, MediaType.MULTIPART_FORM_DATA_TYPE)) {
- throw new IllegalArgumentException("Cannot change media type of a FormDataMultiPart instance");
- }
- super.setMediaType(mediaType);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataParam.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataParam.java
deleted file mode 100644
index 1d85556f8d8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/FormDataParam.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import com.sun.jersey.core.header.FormDataContentDisposition;
-import com.sun.jersey.spi.container.ParamQualifier;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.FormParam;
-
-/**
- * Binds the named body part(s) of a "multipart/form-data" request
- * entity body to a resource method parameter.
- * <p>
- * The {@link FormParam} annotation in conjunction with the media type
- * "application/x-www-form-urlencoded" is inefficient for sending and
- * consuming large quantities of binary data or text containing non-ASCII
- * characters.
- * <p>
- * This annotation in conjunction with the media type "multipart/form-data"
- * should be used for submitting and consuming forms that contain files,
- * non-ASCII data, and binary data.
- * <p>
- * The type <code>T</code> of the annotated parameter must be one of the
- * following:
- * <ol>
- * <li>{@link FormDataBodyPart}. The value of the parameter will be the
- * first named body part, otherwise null if such a named body part is not
- * present.
- * <li>A <code>List</code> or <code>Collection</code> of {@link FormDataBodyPart}.
- * The value of the
- * parameter will one or more named body parts with the same name, otherwise
- * null if such a named body part is not present.
- * <li>{@link FormDataContentDisposition}. The value of the parameter will be
- * the content disposition of the first named body part, otherwise null if
- * such a named body part is not present.
- * <li>A <code>List</code> or <code>Collection</code> of {@link FormDataContentDisposition}.
- * The value of
- * the parameter will one or more content dispositions of the named body parts
- * with the same name, otherwise null if such a named body part is not
- * present.
- * <li>A type for which a message body reader is available given the media type
- * of the first named body part. The value of the parameter will be the
- * result of reading using the message body reader given the type <code>T</code>,
- * the media type of the named part, and the bytes of the named body part as
- * input.
- * <p>
- * If there is no named part present and there is a default value present as
- * declared by {@link DefaultValue} then the media type will be set to
- * "text/plain". The value of the parameter will be the result of reading
- * using the message body reader given the type <code>T</code>, the media type
- * "text/plain", and the UTF-8 encoded bytes of the default value as input.
- * <p>
- * If there is no message body reader available and the type <code>T</code> conforms
- * to a type specified by {@link FormParam} then processing is performed
- * as specified by {@link FormParam}, where the values of the form parameter
- * are <code>String</code> instances produced by reading the bytes of the named body
- * parts utilizing a message body reader for the <code>String</code> type and the
- * media type "text/plain".
- * <p>
- * If there is no named part present then processing is performed as
- * specified by {@link FormParam}.</li>
- * </ol>
- * <p>
- * For example, the use of this annotation allows one to support the
- * following:
- * <blockquote><pre>
- * &#064;POST
- * &#064;Consumes(MediaType.MULTIPART_FORM_DATA_TYPE)
- * public String postForm(
- * &#064;DefaultValue("true") &#064;FormDataParam("enabled") boolean enabled,
- * &#064;FormDataParam("data") FileData bean,
- * &#064;FormDataParam("file") InputStream file,
- * &#064;FormDataParam("file") FormDataContentDisposition fileDisposition) {
- * ...
- * }
- * </pre></blockquote>
- * Where the server consumes a "multipart/form-data" request entity body that
- * contains one optional named body part "enabled" and two required named
- * body parts "data" and "file".
- * <p>
- * The optional part "enabled" is processed
- * as a <code>boolean</code> value, if the part is absent then the
- * value will be <code>true</code>.
- * <p>
- * The part "data" is processed as a JAXB bean and contains some meta-data
- * about the following part.
- * <p>
- * The part "file" is a file that is uploaded, this is processed as an
- * <code>InputStream</code>. Additional informaiton about the file from the
- * "Content-Disposition" header can be accessed by the parameter
- * <code>fileDisposition</code>.
- *
- * <p>
- * Note that, whilst the annotation target permits use on fields and methods,
- * this annotation is only required to be supported on resource method
- * parameters.
- *
- * @see FormDataMultiPart
- * @see FormDataBodyPart
- * @see FormDataContentDisposition
- * @see javax.ws.rs.DefaultValue
- * @see javax.ws.rs.FormParam
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-@ParamQualifier
-public @interface FormDataParam {
- /**
- * Defines the control name of a "multipart/form-data" body part whose
- * content will be used to initialize the value of the annotated method
- * argument.
- *
- * @return the control name of a "multipart/form-data" body part.
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/HeadersMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/HeadersMap.java
deleted file mode 100644
index 294ee0fe4f9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/HeadersMap.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import com.sun.jersey.core.util.StringKeyStringValueIgnoreCaseMultivaluedMap;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * A map of MIME headers.
- * <p>
- * An implementation of {@link MultivaluedMap} where keys are instances of
- * String and are compared ignoring case and values are instances of String.
- */
-/* package */ class HeadersMap
- extends StringKeyStringValueIgnoreCaseMultivaluedMap {
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPart.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPart.java
deleted file mode 100644
index 56ef1f88532..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPart.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-
-/**
- * <p>A mutable model representing a MIME MultiPart entity. This class extends
- * {@link BodyPart} because MultiPart entities can be nested inside other
- * MultiPart entities to an arbitrary depth.</p>
- */
-public class MultiPart extends BodyPart implements Closeable {
-
-
- // ------------------------------------------------------------ Constructors
-
-
- /**
- * <p>Instantiate a new {@link MultiPart} with a <code>mediaType</code> of
- * <code>multipart/mixed</code>.</p>
- */
- public MultiPart() {
- super(new MediaType("multipart", "mixed"));
- }
-
-
- /**
- * <p>Instantiate a new {@link MultiPart} with the specified characteristics.</p>
- *
- * @param mediaType The {@link MediaType} for this multipart
- */
- public MultiPart(MediaType mediaType) {
- super(mediaType);
- }
-
-
- // -------------------------------------------------------------- Properties
-
-
- private BodyPartsList bodyParts = new BodyPartsList(this);
-
-
- /**
- * <p>Return a mutable list of {@link BodyPart}s nested in this
- * {@link MultiPart}.</p>
- */
- public List<BodyPart> getBodyParts() {
- return this.bodyParts;
- }
-
-
- /**
- * <p>Disable access to the entity for a {@link MultiPart}. Use the list
- * returned by <code>getBodyParts()</code> to access the relevant
- * {@link BodyPart} instead.</p>
- *
- * @exception IllegalStateException thrown unconditionally
- */
- @Override
- public Object getEntity() {
- throw new IllegalStateException("Cannot get entity on a MultiPart instance");
- }
-
-
- /**
- * <p>Disable access to the entity for a {@link MultiPart}. Use the list
- * returned by <code>getBodyParts()</code> to access the relevant
- * {@link BodyPart} instead.</p>
- * @param entity
- */
- @Override
- public void setEntity(Object entity) {
- throw new IllegalStateException("Cannot set entity on a MultiPart instance");
- }
-
-
- /**
- * <p>Set the {@link MediaType} for this {@link MultiPart}. If never set,
- * the default {@link MediaType} MUST be <code>multipart/mixed</code>.</p>
- *
- * @param mediaType The new {@link MediaType}
- *
- * @exception IllegalArgumentException if the <code>type</code> property
- * is not set to <code>multipart</code>
- */
- @Override
- public void setMediaType(MediaType mediaType) {
- if (!"multipart".equals(mediaType.getType())) {
- throw new IllegalArgumentException(mediaType.toString());
- }
- super.setMediaType(mediaType);
- }
-
-
- // ---------------------------------------------------------- Public Methods
-
-
- /**
- * <p>Builder pattern method to add the specified {@link BodyPart} to this
- * {@link MultiPart}.</p>
- *
- * @param bodyPart {@link BodyPart} to be added
- */
- public MultiPart bodyPart(BodyPart bodyPart) {
- getBodyParts().add(bodyPart);
- return this;
- }
-
-
- /**
- * <p>Builder pattern method to add a newly configured {@link BodyPart}
- * to this {@link MultiPart}.</p>
- *
- * @param entity Entity object for this body part
- * @param mediaType Content type for this body part
- */
- public MultiPart bodyPart(Object entity, MediaType mediaType) {
- BodyPart bodyPart = new BodyPart(entity, mediaType);
- return bodyPart(bodyPart);
- }
-
-
- /**
- * <p>Override the entity set operation on a {@link MultiPart} to throw
- * <code>IllegalArgumentException</code>.</p>
- *
- * @param entity Entity to set for this {@link BodyPart}
- */
- @Override
- public BodyPart entity(Object entity) {
- setEntity(entity);
- return this;
- }
-
-
- /**
- * <p>Builder pattern method to return this {@link MultiPart} after
- * additional configuration.</p>
- *
- * @param type Media type to set for this {@link MultiPart}
- */
- @Override
- public MultiPart type(MediaType type) {
- setMediaType(type);
- return this;
- }
-
-
- /**
- * <p>Perform any necessary cleanup at the end of processing this
- * {@link MultiPart}.</p>
- */
- @Override
- public void cleanup() {
- for (BodyPart bp : getBodyParts()) {
- bp.cleanup();
- }
- }
-
-
- // Closeable
-
- public void close() throws IOException {
- cleanup();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartConfig.java
deleted file mode 100644
index eea907ad80e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartConfig.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * <p>Injectable JavaBean containing the configuration parameters for
- * <code>jersey-multipart</code> as used in this particular application.</p>
- */
-public class MultiPartConfig {
-
-
- // ------------------------------------------------------------- Constructor
-
-
- /**
- * <p>Load and customize (if necessary) the configuration values for the
- * <code>jersey-multipart</code> module.</p>
- *
- * @exception IllegalArgumentException if the configuration resource
- * exists, but there are problems reading it
- */
- public MultiPartConfig() {
- configure();
- }
-
-
- // ------------------------------------------------------ Manifest Constants
-
-
- /**
- * <p>Name of a properties resource that (if found in the classpath
- * for this application) will be used to configure the settings returned
- * by our getter methods.</p>
- */
- public static final String MULTI_PART_CONFIG_RESOURCE =
- "jersey-multipart-config.properties";
-
-
- /**
- * <p>Name of the resource property for the <code>bufferThreshold</code>
- * property.</p>
- */
- public static final String BUFFER_THRESHOLD_NAME = "bufferThreshold";
-
-
- // ------------------------------------------------------ Instance Variables
-
-
- /**
- * <p>The threshold size (in bytes) above which a body part entity will be
- * buffered to disk instead of being held in memory.</p>
- */
- private int bufferThreshold = 4096;
-
-
- // ---------------------------------------------------------- Public Methods
-
-
- /**
- * <p>Return the size (in bytes) of the entity of an incoming
- * {@link BodyPart} before it will be buffered to disk. If not
- * customized, the default value is 4096.</p>
- */
- public int getBufferThreshold() {
- return bufferThreshold;
- }
-
-
- // --------------------------------------------------------- Private Methods
-
-
- /**
- * <p>Configure the values returned by this instance's getters based on
- * the contents of a properties resource, if it exists on the classpath
- * for this application.</p>
- *
- * @exception IllegalArgumentException if the configuration resource
- * exists, but there are problems reading it
- */
- private void configure() {
-
- // Identify the class loader we will use
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null) {
- loader = this.getClass().getClassLoader();
- }
-
- // Attempt to find our properties resource
- InputStream stream = null;
- try {
- stream = loader.getResourceAsStream(MULTI_PART_CONFIG_RESOURCE);
- if (stream == null) {
- return;
- }
- Properties props = new Properties();
- props.load(stream);
- String value = null;
- value = props.getProperty(BUFFER_THRESHOLD_NAME);
- if (value != null) {
- System.out.println("Setting bufferThreshold to " + value);
- this.bufferThreshold = Integer.valueOf(value);
- }
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- } finally {
- if (stream != null) {
- try {
- stream.close();
- } catch (IOException e) {
- // Pass through
- }
- }
- }
-
- }
-
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartMediaTypes.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartMediaTypes.java
deleted file mode 100644
index b57b910b272..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/MultiPartMediaTypes.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import java.util.Collections;
-import javax.ws.rs.core.MediaType;
-
-/**
- * <p>Convenience {@link MediaType} (and associated String)
- * manifest constants.</p>
- */
-public final class MultiPartMediaTypes {
-
- /** "multipart/alternative" */
- public static final String MULTIPART_ALTERNATIVE = "multipart/alternative";
-
- /** "multipart/alternative" */
- public static final MediaType MULTIPART_ALTERNATIVE_TYPE =
- new MediaType("multipart", "alternative");
-
- /** "multipart/digest" */
- public static final String MULTIPART_DIGEST = "multipart/digest";
-
- /** "multipart/digest" */
- public static final MediaType MULTIPART_DIGEST_TYPE =
- new MediaType("multipart", "digest");
-
- /** "multipart/mixed" */
- public static final String MULTIPART_MIXED = "multipart/mixed";
-
- /** "multipart/mixed" */
- public static final MediaType MULTIPART_MIXED_TYPE =
- new MediaType("multipart", "mixed");
-
- /** "multipart/parallel" */
- public static final String MULTIPART_PARALLEL = "multipart/parallel";
-
- /** "multipart/parallel" */
- public static final MediaType MULTIPART_PARELLEL_TYPE =
- new MediaType("multipart", "parallel");
-
-
- /**
- * @return a "multipart/alternative" with a boundary parameter.
- */
- public static MediaType createAlternative() {
- return create(MULTIPART_ALTERNATIVE_TYPE);
- }
-
- /**
- * @return a "multipart/digest" with a boundary parameter.
- */
- public static MediaType createDigest() {
- return create(MULTIPART_DIGEST_TYPE);
- }
-
- /**
- * @return a "multipart/mixed" with a boundary parameter.
- */
- public static MediaType createMixed() {
- return create(MULTIPART_MIXED_TYPE);
- }
-
- /**
- * @return a "multipart/parallel" with a boundary parameter.
- */
- public static MediaType createParallel() {
- return create(MULTIPART_PARELLEL_TYPE);
- }
-
- /**
- * @return a "multipart/form-data" with a boundary parameter.
- */
- public static MediaType createFormData() {
- return create(MediaType.MULTIPART_FORM_DATA_TYPE);
- }
-
- private static MediaType create(MediaType mt) {
- return new MediaType(mt.getType(), mt.getSubtype(),
- Collections.singletonMap(Boundary.BOUNDARY_PARAMETER, Boundary.createBoundary()));
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/ParameterizedHeadersMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/ParameterizedHeadersMap.java
deleted file mode 100644
index 33fbf4c56ac..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/ParameterizedHeadersMap.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart;
-
-import com.sun.jersey.core.header.ParameterizedHeader;
-import com.sun.jersey.core.util.StringKeyIgnoreCaseMultivaluedMap;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * A map of MIME headers with parameterized values.
- * <p>
- * An implementation of {@link MultivaluedMap} where keys are instances of
- * String and are compared ignoring case and values are instances of
- * {@link ParameterizedHeader}.
- *
- */
-/* package */ class ParameterizedHeadersMap
- extends StringKeyIgnoreCaseMultivaluedMap<ParameterizedHeader> {
-
- public ParameterizedHeadersMap() {
- }
-
- public ParameterizedHeadersMap(MultivaluedMap<String,String> headers) throws ParseException {
- for (Map.Entry<String,List<String>> entry : headers.entrySet()) {
- List<ParameterizedHeader> list = new ArrayList<ParameterizedHeader>(entry.getValue().size());
- for (String value : entry.getValue()) {
- list.add(new ParameterizedHeader(value));
- }
- this.put(entry.getKey(), list);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.java
deleted file mode 100644
index 5588ea3ef8c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.multipart.file;
-
-import java.io.File;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Default implementation of {@link MediaTypePredictor} that uses
- * {@link CommonMediaTypes}.
- *
- * @author imran@smartitengineering.com
- * @author Paul.Sandoz@Sun.Com
- */
-public class DefaultMediaTypePredictor
- implements MediaTypePredictor {
-
- /**
- * This enum represents file extension and MIME types of commonly used file. It
- * is to be noted that all file extension and MIME types are specified in lower
- * case, when checking the extension this should be kept in mind.
- * Curently supported file extension and MIME Types are -
- * <br /><ul>
- * <li>".xml" - application/xml</li>
- * <li>".txt" - text/plain</li>
- * <li>".pdf" - application/pdf</li>
- * <li>".htm" - text/html</li>
- * <li>".html" - text/html</li>
- * <li>".jpg" - image/jpeg</li>
- * <li>".png" - image/png</li>
- * <li>".gif" - image/gif</li>
- * <li>".bmp" - image/bmp</li>
- * <li>".tar" - application/x-tar</li>
- * <li>".zip" - application/zip</li>
- * <li>".gz" - application/x-gzip</li>
- * <li>".rar" - application/x-rar</li>
- * <li>".mp3" - audio/mpeg</li>
- * <li>".wav" - audio/x-wave</li>
- * <li>".avi" - video/x-msvideo</li>
- * <li>".mpeg" - video/mpeg</li>
- * </ul>
- */
- public enum CommonMediaTypes {
-
- XML(".xml", MediaType.APPLICATION_XML_TYPE),
- TXT(".txt", MediaType.TEXT_PLAIN_TYPE),
- HTM(".htm", MediaType.TEXT_HTML_TYPE),
- HTML(".html", MediaType.TEXT_HTML_TYPE),
- PDF(".pdf", new MediaType("application", "pdf")),
- JPG(".jpg", new MediaType("image", "jpeg")),
- PNG(".png", new MediaType("image", "png")),
- GIF(".gif", new MediaType("image", "gif")),
- BMP(".bmp", new MediaType("image", "pdf")),
- TAR(".tar", new MediaType("application", "x-tar")),
- ZIP(".zip", new MediaType("application", "zip")),
- GZ(".gz", new MediaType("application", "x-gzip")),
- RAR(".rar", new MediaType("application", "x-rar")),
- MP3(".mp3", new MediaType("audio", "mpeg")),
- WAV(".wav", new MediaType("audio", "x-wave")),
- AVI(".avi", new MediaType("video", "x-msvideo")),
- MPEG(".mpeg", new MediaType("video", "mpeg")),;
-
- private final String extension;
-
- private final MediaType mediaType;
-
- private CommonMediaTypes(final String extension,
- final MediaType mediaType) {
- if (extension == null || !extension.startsWith(".") || mediaType == null) {
- throw new IllegalArgumentException();
- }
- this.extension = extension;
- this.mediaType = mediaType;
- }
-
- /**
- * Get the file extension.
- *
- * @return the file extension.
- */
- public String getExtension() {
- return extension;
- }
-
- /**
- * Get the media type.
- *
- * @return the media type.
- */
- public MediaType getMediaType() {
- return mediaType;
- }
-
- /**
- * A utility method for predicting media type from a file name.
- *
- * @param file The file from which to predict the {@link MediaType}
- * @return The {@link MediaType} for the give file; <code>null</code> - if file
- * is null; "application/octet-stream" if extension not recognized.
- * @see CommonMediaTypes#getMediaTypeFromFileName(java.lang.String)
- */
- public static MediaType getMediaTypeFromFile(final File file) {
- if (file == null) {
- return null;
- }
- String fileName = file.getName();
- return getMediaTypeFromFileName(fileName);
- }
-
- /**
- * A utility method for predicting media type from a file name. If the file
- * name extension is not recognised it will return {@link MediaType} for
- * "*\/*", it will also return the same if the file is <code>null</code>.
- * Currently supported file extensions can be found at {@link CommonMediaTypes}.
- *
- * @param fileName The file name from which to predict the {@link MediaType}
- * @return The {@link MediaType} for the give file; <code>null</code> - if file
- * is null; "application/octet-stream" if extension not recognized.
- */
- public static MediaType getMediaTypeFromFileName(String fileName) {
- if (fileName == null) {
- return null;
- }
- CommonMediaTypes[] types = CommonMediaTypes.values();
- if (types != null && types.length > 0) {
- for (CommonMediaTypes type : types) {
- if (fileName != null &&
- fileName.toLowerCase().endsWith(type.getExtension())) {
- return type.getMediaType();
- }
- }
- }
- return MediaType.APPLICATION_OCTET_STREAM_TYPE;
- }
- }
-
- public MediaType getMediaTypeFromFile(File file) {
- return CommonMediaTypes.getMediaTypeFromFile(file);
- }
-
- public MediaType getMediaTypeFromFileName(String fileName) {
- return CommonMediaTypes.getMediaTypeFromFileName(fileName);
- }
-
- private static final DefaultMediaTypePredictor MEDIA_TYPE_PREDICTOR =
- new DefaultMediaTypePredictor();
-
- /**
- * Get the singleton instance of this class.
- *
- * @return the singleton instance.
- */
- public static DefaultMediaTypePredictor getInstance() {
- return MEDIA_TYPE_PREDICTOR;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/FileDataBodyPart.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/FileDataBodyPart.java
deleted file mode 100644
index 2e89dc4c339..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/FileDataBodyPart.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.multipart.file;
-
-import com.sun.jersey.core.header.FormDataContentDisposition;
-import com.sun.jersey.multipart.FormDataBodyPart;
-import java.io.File;
-import java.util.Date;
-import javax.ws.rs.core.MediaType;
-
-/**
- * An extension of {@link FormDataBodyPart} for associating
- * {@link File} File as a body part entity.
- * <p>
- * This class may be used to create body parts that a file attachments.
- * Where appropriate the Content-Disposition parameters and Content-Type header
- * will be derived from the file.
- *
- * @author imran@smartitengineering.com
- * @author Paul.Sandoz@Sun.Com
- */
-public class FileDataBodyPart
- extends FormDataBodyPart {
-
- private File fileEntity;
-
- private MediaTypePredictor predictor =
- DefaultMediaTypePredictor.getInstance();
-
- /**
- * A no-args constructor which expects its client to set the values
- * individually, the attributes to be set are fileEntity and name; the
- * media type will be predicted from the fileEntity if not set explicitly
- */
- public FileDataBodyPart() {
- super();
- }
-
- /**
- * Constructs the body part with the provided name and file, it predicts the
- * {@link MediaType} of the file provided. For the known media types client
- * will not need to set the media type explicitly.
- *
- * @param name The name of body part
- * @param fileEntity The file that represents the entity
- * @see MediaTypePredictor#getMediaTypeFromFile(java.io.File)
- * @see FileDataBodyPart#FileDataBodyPart(java.lang.String, java.io.File, javax.ws.rs.core.MediaType)
- */
- public FileDataBodyPart(final String name,
- final File fileEntity) {
- this(name, fileEntity, null);
- }
-
- /**
- * Constructs the body part with all the attributes set for its proper
- * function. If this constructor is used to construct the body part then it
- * is not required to set any other attributes for proper behavior.
- *
- * @param name The name of body part
- * @param fileEntity The file that represents the entity
- * @param mediaType The {@link MediaType} of the body part
- * @throws java.lang.IllegalArgumentException If the fileEntity is null
- */
- public FileDataBodyPart(final String name,
- final File fileEntity,
- final MediaType mediaType)
- throws IllegalArgumentException {
- super();
- super.setName(name);
- if (mediaType != null) {
- setFileEntity(fileEntity, mediaType);
- } else {
- setFileEntity(fileEntity, predictMediaType(fileEntity));
- }
- }
-
- /**
- * Get the file for this body part.
- * @return File entity for this body part
- */
- public File getFileEntity() {
- return fileEntity;
- }
-
- /**
- * This operation is not supported from this implementation.
- *
- * @param mediaType
- * @param value
- * @throws java.lang.UnsupportedOperationException Operation not supported.
- * @see FileDataBodyPart#setFileEntity(java.io.File, javax.ws.rs.core.MediaType)
- */
- @Override
- public void setValue(MediaType mediaType,
- Object value)
- throws UnsupportedOperationException {
- throw new UnsupportedOperationException("It is unsupported, please " +
- "use setFileEntity instead!");
- }
-
- /**
- * This operation is not supported from this implementation.
- *
- * @param entity
- * @throws java.lang.UnsupportedOperationException Operation not supported.
- * @see FileDataBodyPart#setFileEntity(java.io.File)
- */
- @Override
- public void setEntity(Object entity)
- throws UnsupportedOperationException {
- throw new UnsupportedOperationException("It is unsupported, please " +
- "use setFileEntity instead!");
- }
-
- /**
- * Sets the fileEntity for this {@link FormDataBodyPart}.
- *
- * @param fileEntity The entity of this {@link FormDataBodyPart}.
- */
- public void setFileEntity(final File fileEntity) {
- this.setFileEntity(fileEntity, predictMediaType());
- }
-
- /**
- * Sets the {@link MediaType} and fileEntity for this {@link FormDataBodyPart}.
- *
- * @param fileEntity The entity of this body part
- * @param mediaType the media type.
- */
- public void setFileEntity(final File fileEntity,
- final MediaType mediaType) {
- super.setMediaType(mediaType);
-
- super.setEntity(fileEntity);
- this.fileEntity = fileEntity;
-
- if (fileEntity != null) {
- FormDataContentDisposition.FormDataContentDispositionBuilder builder =
- FormDataContentDisposition.name(getName());
- builder.fileName(fileEntity.getName());
- if (fileEntity.exists()) {
- builder.size(fileEntity.length());
- builder.modificationDate(new Date(fileEntity.lastModified()));
- }
- setFormDataContentDisposition(builder.build());
- }
- }
-
- /**
- * Predict the media type of the current fileEntity.
- *
- * @return Predicted {@link MediaType}
- */
- protected MediaType predictMediaType() {
- return predictMediaType(getFileEntity());
- }
-
- /**
- * Predict the media type of the provided {@link File}.
- *
- * @param file the file from which the media type is predicted.
- * @return Predicted {@link MediaType}
- */
- protected MediaType predictMediaType(final File file) {
- return getPredictor().getMediaTypeFromFile(file);
- }
-
- /**
- * Get the media type predictor.
- *
- * @return the media type predictor.
- */
- public MediaTypePredictor getPredictor() {
- return predictor;
- }
-
- /**
- * Set the media type predictor.
- *
- * @param predictor the media type predictor.
- */
- public void setPredictor(MediaTypePredictor predictor) {
- if (predictor == null) {
- throw new IllegalArgumentException();
- }
-
- this.predictor = predictor;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/MediaTypePredictor.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/MediaTypePredictor.java
deleted file mode 100644
index 805a949f755..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/MediaTypePredictor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart.file;
-
-import java.io.File;
-import javax.ws.rs.core.MediaType;
-import com.sun.jersey.multipart.file.DefaultMediaTypePredictor.CommonMediaTypes;
-
-/**
- * An interface which allows developers implement their own media type
- * predictor.
- *
- * @author imran@smartitengineering.com
- * @author Paul.Sandoz@Sun.Com
- */
-public interface MediaTypePredictor {
-
- /**
- * Get the media type from a file name.
- *
- * @param file The file from which to get the {@link MediaType}
- * @return The {@link MediaType} for the give file; <code>null</code> - if file
- * is null; "application/octet-stream" if extension not recognized.
- * @see CommonMediaTypes#getMediaTypeFromFileName(java.lang.String)
- */
- public MediaType getMediaTypeFromFile(final File file);
-
- /**
- * Get the media type from a file name. If the file
- * name extension is not recognised it will return {@link MediaType} for
- * "*\/*", it will also return the same if the file is <code>null</code>.
- *
- * @param fileName The file name from which to get the {@link MediaType}
- * @return The {@link MediaType} for the give file; <code>null</code> - if file
- * is null; "application/octet-stream" if extension not recognized.
- */
- public MediaType getMediaTypeFromFileName(String fileName);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/package-info.java
deleted file mode 100644
index fd8e073b8f5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/file/package-info.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-/**
- * Provides support for body parts that are file attachments.
- *
- */
-package com.sun.jersey.multipart.file;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.java
deleted file mode 100644
index 2ab1ca278fb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart.impl;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.header.FormDataContentDisposition;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import com.sun.jersey.multipart.BodyPartEntity;
-import com.sun.jersey.multipart.FormDataBodyPart;
-import com.sun.jersey.multipart.FormDataMultiPart;
-import com.sun.jersey.multipart.FormDataParam;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.inject.InjectableValuesProvider;
-import com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider;
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.spi.container.JavaMethodInvokerFactory;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import com.sun.jersey.spi.inject.Injectable;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-
-/**
- * <p>Support <code>@FormDataParam</code> injection into method parameters from
- * a {@link FormDataMultiPart} entity.</p>
- */
-public class FormDataMultiPartDispatchProvider extends AbstractResourceMethodDispatchProvider {
- private static final String FORM_MULTIPART_PROPERTY = "com.sun.jersey.api.representation.form.multipart";
-
- @Context
- private MessageBodyWorkers mbws;
-
- @Context
- private MultivaluedParameterExtractorProvider mpep;
-
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
- return this.create(abstractResourceMethod, JavaMethodInvokerFactory.getDefault());
- }
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod method, JavaMethodInvoker invoker) {
- if ("GET".equals(method.getHttpMethod())) {
- return null;
- }
-
- boolean found = false;
- for (MediaType m : method.getSupportedInputTypes()) {
- found = (!m.isWildcardSubtype() && m.isCompatible(MediaType.MULTIPART_FORM_DATA_TYPE));
- if (found) {
- break;
- }
- }
- if (!found) {
- return null;
- }
-
- return super.create(method, invoker);
- }
-
- private static final class FormDataInjectableValuesProvider extends InjectableValuesProvider {
- public FormDataInjectableValuesProvider(List<Injectable> is) {
- super(is);
- }
-
- @Override
- public Object[] getInjectableValues(HttpContext context) {
- FormDataMultiPart form = context.getRequest().getEntity(FormDataMultiPart.class);
- context.getProperties().put(FORM_MULTIPART_PROPERTY, form);
-
- return super.getInjectableValues(context);
- }
- }
-
- @Override
- protected InjectableValuesProvider getInjectableValuesProvider(AbstractResourceMethod method) {
- if (method.getParameters().isEmpty()) {
- return null;
- }
-
- boolean hasFormParam = false;
- for (int i = 0; i < method.getParameters().size(); i++) {
- Parameter parameter = method.getParameters().get(i);
- if (parameter.getAnnotation() != null)
- hasFormParam |= parameter.getAnnotation().annotationType() == FormDataParam.class;
- }
- if (!hasFormParam)
- return null;
-
- return new FormDataInjectableValuesProvider(getInjectables(method));
- }
-
- private List<Injectable> getInjectables(AbstractResourceMethod method) {
- List<Injectable> list = new ArrayList<Injectable>(method.getParameters().size());
- for (int i = 0; i < method.getParameters().size(); i++) {
- Parameter p = method.getParameters().get(i);
- if (Parameter.Source.ENTITY == p.getSource()) {
- if (FormDataMultiPart.class.isAssignableFrom(p.getParameterClass())) {
- list.add(new FormDataMultiPartInjectable());
- } else {
- list.add(null);
- }
- } else if (p.getAnnotation().annotationType() == FormDataParam.class) {
- if (Collection.class == p.getParameterClass() || List.class == p.getParameterClass()) {
- Class c = ReflectionHelper.getGenericClass(p.getParameterType());
- if (FormDataBodyPart.class == c) {
- list.add(new ListFormDataBodyPartMultiPartInjectable(p.getSourceName()));
- } else if (FormDataContentDisposition.class == c) {
- list.add(new ListFormDataContentDispositionMultiPartInjectable(p.getSourceName()));
- }
- } else if (FormDataBodyPart.class == p.getParameterClass()) {
- list.add(new FormDataBodyPartMultiPartInjectable(p.getSourceName()));
- } else if (FormDataContentDisposition.class == p.getParameterClass()) {
- list.add(new FormDataContentDispositionMultiPartInjectable(p.getSourceName()));
- } else {
- list.add(new FormDataMultiPartParamInjectable(p));
- }
- } else {
- Injectable injectable = getInjectableProviderContext().getInjectable(p, ComponentScope.PerRequest);
- list.add(injectable);
- }
- }
- return list;
- }
-
- private static final class FormDataMultiPartInjectable
- extends AbstractHttpContextInjectable<Object> {
-
- @Override
- public Object getValue(HttpContext context) {
- // Return entire FormDataMultiPart instance (if any)
- return context.getProperties().get(FORM_MULTIPART_PROPERTY);
- }
-
- }
-
- private static final class FormDataBodyPartMultiPartInjectable
- extends AbstractHttpContextInjectable<FormDataBodyPart> {
- private final String name;
-
- FormDataBodyPartMultiPartInjectable(String name) {
- this.name = name;
- }
-
- @Override
- public FormDataBodyPart getValue(HttpContext context) {
- FormDataMultiPart fdmp = (FormDataMultiPart)
- context.getProperties().get(FORM_MULTIPART_PROPERTY);
-
- return fdmp.getField(name);
- }
- }
-
- private static final class ListFormDataBodyPartMultiPartInjectable
- extends AbstractHttpContextInjectable<List<FormDataBodyPart>> {
- private final String name;
-
- ListFormDataBodyPartMultiPartInjectable(String name) {
- this.name = name;
- }
-
- @Override
- public List<FormDataBodyPart> getValue(HttpContext context) {
- FormDataMultiPart fdmp = (FormDataMultiPart)
- context.getProperties().get(FORM_MULTIPART_PROPERTY);
-
- return fdmp.getFields(name);
- }
- }
-
- private static final class FormDataContentDispositionMultiPartInjectable
- extends AbstractHttpContextInjectable<FormDataContentDisposition> {
- private final String name;
-
- FormDataContentDispositionMultiPartInjectable(String name) {
- this.name = name;
- }
-
- @Override
- public FormDataContentDisposition getValue(HttpContext context) {
- FormDataMultiPart fdmp = (FormDataMultiPart)
- context.getProperties().get(FORM_MULTIPART_PROPERTY);
-
- FormDataBodyPart fdbp = fdmp.getField(name);
- if (fdbp == null)
- return null;
-
- return fdmp.getField(name).getFormDataContentDisposition();
- }
- }
-
- private static final class ListFormDataContentDispositionMultiPartInjectable
- extends AbstractHttpContextInjectable<List<FormDataContentDisposition>> {
- private final String name;
-
- ListFormDataContentDispositionMultiPartInjectable(String name) {
- this.name = name;
- }
-
- @Override
- public List<FormDataContentDisposition> getValue(HttpContext context) {
- FormDataMultiPart fdmp = (FormDataMultiPart)
- context.getProperties().get(FORM_MULTIPART_PROPERTY);
-
- List<FormDataBodyPart> fdbps = fdmp.getFields(name);
- if (fdbps == null)
- return null;
-
- List<FormDataContentDisposition> l = new ArrayList<FormDataContentDisposition>(fdbps.size());
- for (FormDataBodyPart fdbp : fdbps) {
- l.add(fdbp.getFormDataContentDisposition());
- }
-
- return l;
- }
- }
-
- private final class FormDataMultiPartParamInjectable
- extends AbstractHttpContextInjectable<Object> {
-
- private final Parameter param;
-
- private final MultivaluedParameterExtractor extractor;
-
- FormDataMultiPartParamInjectable(Parameter param) {
- this.param = param;
- this.extractor = mpep.get(param);
- }
-
- @Override
- public Object getValue(HttpContext context) {
- // Return the field value for the field specified by the
- // sourceName property
- FormDataMultiPart fdmp = (FormDataMultiPart)
- context.getProperties().get(FORM_MULTIPART_PROPERTY);
-
- List<FormDataBodyPart> fdbps = fdmp.getFields(param.getSourceName());
- FormDataBodyPart fdbp = (fdbps != null) ? fdbps.get(0) : null;
-
- MediaType mediaType = (fdbp != null)
- ? fdbp.getMediaType() : MediaType.TEXT_PLAIN_TYPE;
-
- MessageBodyReader reader = mbws.getMessageBodyReader(
- param.getParameterClass(),
- param.getParameterType(),
- param.getAnnotations(),
- mediaType);
-
- if (reader != null) {
- InputStream in = null;
- if (fdbp == null) {
- if (param.getDefaultValue() != null) {
- // Convert default value to bytes
- in = new ByteArrayInputStream(param.getDefaultValue().getBytes());
- } else {
- return null;
- }
- } else {
- in = ((BodyPartEntity) fdbp.getEntity()).getInputStream();
- }
-
- try {
- return reader.readFrom(
- param.getParameterClass(),
- param.getParameterType(),
- param.getAnnotations(),
- mediaType,
- context.getRequest().getRequestHeaders(),
- in);
- } catch (IOException e) {
- throw new ContainerException(e);
- }
- } else if (extractor != null) {
- MultivaluedMap<String, String> map = new MultivaluedMapImpl();
- if (fdbp != null) {
- try {
- for (FormDataBodyPart p : fdbps) {
- mediaType = p.getMediaType();
-
- reader = mbws.getMessageBodyReader(
- String.class,
- String.class,
- param.getAnnotations(),
- mediaType);
-
- String value = (String) reader.readFrom(
- String.class,
- String.class,
- param.getAnnotations(),
- mediaType,
- context.getRequest().getRequestHeaders(),
- ((BodyPartEntity) p.getEntity()).getInputStream());
-
- map.add(param.getSourceName(), value);
- }
- } catch (IOException e) {
- throw new ContainerException(e);
- }
- }
- return extractor.extract(map);
- } else {
- return null;
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartConfigProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartConfigProvider.java
deleted file mode 100644
index d5eba8cad0f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartConfigProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart.impl;
-
-import com.sun.jersey.multipart.MultiPartConfig;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.Context;
-
-/**
- * <p>Jersey-specific injectable provider that supplies a configured instance
- * of {@link MultiPartConfig} for this application.</p>
- */
-public class MultiPartConfigProvider implements InjectableProvider<Context, Type> {
-
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public Injectable<MultiPartConfig> getInjectable(ComponentContext ic, Context a, Type t) {
- if (MultiPartConfig.class != t) {
- return null;
- }
- final MultiPartConfig mpc = new MultiPartConfig();
- return new Injectable<MultiPartConfig>() {
- public MultiPartConfig getValue() {
- return mpc;
- }
- };
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.java
deleted file mode 100644
index 26b1ace86d9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart.impl;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.multipart.BodyPart;
-import com.sun.jersey.multipart.BodyPartEntity;
-import com.sun.jersey.multipart.FormDataBodyPart;
-import com.sun.jersey.multipart.FormDataMultiPart;
-import com.sun.jersey.multipart.MultiPart;
-import com.sun.jersey.multipart.MultiPartConfig;
-import com.sun.jersey.spi.inject.ClientSide;
-import com.sun.jersey.spi.inject.ConstrainedTo;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.Providers;
-import org.jvnet.mimepull.Header;
-import org.jvnet.mimepull.MIMEConfig;
-import org.jvnet.mimepull.MIMEMessage;
-import org.jvnet.mimepull.MIMEParsingException;
-import org.jvnet.mimepull.MIMEPart;
-
-/**
- * <p>{@link Provider} {@link MessageBodyReader} implementation for
- * {@link MultiPart} entities.</p>
- */
-@ConstrainedTo(ClientSide.class)
-@Consumes("multipart/*")
-public class MultiPartReaderClientSide implements MessageBodyReader<MultiPart> {
-
- /**
- * <P>Injectable helper to look up appropriate {@link Provider}s
- * for our body parts.</p>
- */
- private final Providers providers;
-
- /**
- * <p>Injected configuration parameters for this application.</p>
- */
- private final MultiPartConfig config;
-
- private final MIMEConfig mimeConfig;
-
- /**
- * <p>Accept constructor injection of the configuration parameters for this
- * application.</p>
- */
- public MultiPartReaderClientSide(@Context Providers providers, @Context MultiPartConfig config) {
- this.providers = providers;
-
- if (config == null) {
- throw new IllegalArgumentException("The MultiPartConfig instance we expected is not present. Have you registered the MultiPartConfigProvider class?");
- }
- this.config = config;
-
- mimeConfig = new MIMEConfig();
- mimeConfig.setMemoryThreshold(config.getBufferThreshold());
- }
-
-
- public boolean isReadable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return MultiPart.class.isAssignableFrom(type);
- }
-
- /**
- * <p>Read the entire list of body parts from the Input stream, using the
- * appropriate provider implementation to deserialize each body part's entity.</p>
- *
- * @param type The class of the object to be read (i.e. {@link MultiPart}.class)
- * @param genericType The type of object to be written
- * @param annotations Annotations on the resource method that returned this object
- * @param mediaType Media type (<code>multipart/*</code>) of this entity
- * @param headers Mutable map of HTTP headers for the entire response
- * @param stream Output stream to which the entity should be written
- *
- * @throws java.io.IOException if an I/O error occurs
- * @throws javax.ws.rs.WebApplicationException if an HTTP error response
- * needs to be produced (only effective if the response is not committed yet)
- * @throws javax.ws.rs.WebApplicationException if the Content-Disposition
- * header of a <code>multipart/form-data</code> body part cannot be parsed
- */
- public MultiPart readFrom(Class<MultiPart> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> headers,
- InputStream stream) throws IOException, WebApplicationException {
-
- try {
- return readMultiPart(type, genericType, annotations, mediaType, headers, stream);
- } catch (MIMEParsingException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- }
- }
-
-
- protected MultiPart readMultiPart(Class<MultiPart> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> headers,
- InputStream stream) throws IOException, MIMEParsingException {
- MIMEMessage mm = new MIMEMessage(stream,
- mediaType.getParameters().get("boundary"),
- mimeConfig);
-
- boolean formData = false;
- MultiPart multiPart = null;
- if (MediaTypes.typeEquals(mediaType, MediaType.MULTIPART_FORM_DATA_TYPE)) {
- multiPart = new FormDataMultiPart();
- formData = true;
- } else {
- multiPart = new MultiPart();
- }
-
- multiPart.setProviders(providers);
-
- MultivaluedMap<String,String> mpHeaders = multiPart.getHeaders();
- for (Map.Entry<String,List<String>> entry : headers.entrySet()) {
- List<String> values = entry.getValue();
- for (String value : values) {
- mpHeaders.add(entry.getKey(), value);
- }
- }
-
- if (!formData) {
- multiPart.setMediaType(mediaType);
- }
-
- for (MIMEPart mp : mm.getAttachments()) {
- BodyPart bodyPart = null;
- if (formData) {
- bodyPart = new FormDataBodyPart();
- } else {
- bodyPart = new BodyPart();
- }
-
- // Configure providers
- bodyPart.setProviders(providers);
-
- // Copy headers
- for (Header h : mp.getAllHeaders()) {
- bodyPart.getHeaders().add(h.getName(), h.getValue());
- }
-
- try {
- String contentType = bodyPart.getHeaders().getFirst("Content-Type");
- if (contentType != null)
- bodyPart.setMediaType(MediaType.valueOf(contentType));
-
- bodyPart.getContentDisposition();
- } catch (IllegalArgumentException ex) {
- throw new WebApplicationException(ex, Status.BAD_REQUEST);
- }
-
- // Copy data into a BodyPartEntity structure
- bodyPart.setEntity(new BodyPartEntity(mp));
- // Add this BodyPart to our MultiPart
- multiPart.getBodyParts().add(bodyPart);
- }
-
- return multiPart;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.java
deleted file mode 100644
index 940caa52c2c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.multipart.impl;
-
-import com.sun.jersey.multipart.MultiPart;
-import com.sun.jersey.multipart.MultiPartConfig;
-import com.sun.jersey.spi.CloseableService;
-import com.sun.jersey.spi.inject.ConstrainedTo;
-import com.sun.jersey.spi.inject.ServerSide;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.Providers;
-import org.jvnet.mimepull.MIMEParsingException;
-
-/**
- * <p>{@link Provider} {@link MessageBodyReader} implementation for
- * {@link MultiPart} entities.</p>
- */
-@ConstrainedTo(ServerSide.class)
-public class MultiPartReaderServerSide extends MultiPartReaderClientSide {
-
- private final CloseableService closeableService;
-
- public MultiPartReaderServerSide(@Context Providers providers, @Context MultiPartConfig config,
- @Context CloseableService closeableService) {
- super(providers, config);
-
- this.closeableService = closeableService;
- }
-
- protected MultiPart readMultiPart(Class<MultiPart> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, String> headers,
- InputStream stream) throws IOException, MIMEParsingException {
- MultiPart mp = super.readMultiPart(type, genericType, annotations, mediaType, headers, stream);
- closeableService.add(mp);
- return mp;
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartWriter.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartWriter.java
deleted file mode 100644
index 2be85f11616..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/impl/MultiPartWriter.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.multipart.impl;
-
-import com.sun.jersey.multipart.Boundary;
-import com.sun.jersey.multipart.BodyPart;
-import com.sun.jersey.multipart.BodyPartEntity;
-import com.sun.jersey.multipart.MultiPart;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.Providers;
-
-/**
- * <p>{@link Provider} {@link MessageBodyWriter} implementation for
- * {@link MultiPart} entities.</p>
- */
-//@Provider
-@Produces("multipart/*")
-public class MultiPartWriter implements MessageBodyWriter<MultiPart> {
-
- private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
- /**
- * <P>Injectable helper to look up appropriate {@link Provider}s
- * for our body parts.</p>
- */
- private final Providers providers;
-
- public MultiPartWriter(@Context Providers providers) {
- this.providers = providers;
- }
-
- @Override
- public long getSize(MultiPart entity, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-
- @Override
- public boolean isWriteable(Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType) {
- return MultiPart.class.isAssignableFrom(type);
- }
-
- /**
- * <p>Write the entire list of body parts to the output stream, using the
- * appropriate provider implementation to serialize each body part's entity.</p>
- *
- * @param entity The {@link MultiPart} instance to write
- * @param type The class of the object to be written (i.e. {@link MultiPart}.class)
- * @param genericType The type of object to be written
- * @param annotations Annotations on the resource method that returned this object
- * @param mediaType Media type (<code>multipart/*</code>) of this entity
- * @param headers Mutable map of HTTP headers for the entire response
- * @param stream Output stream to which the entity should be written
- *
- * @throws java.io.IOException if an I/O error occurs
- * @throws javax.ws.rs.WebApplicationException if an HTTP error response
- * needs to be produced (only effective if the response is not committed yet)
- */
- @Override
- public void writeTo(MultiPart entity, Class<?> type, Type genericType,
- Annotation[] annotations, MediaType mediaType,
- MultivaluedMap<String, Object> headers,
- OutputStream stream) throws IOException, WebApplicationException {
-
- // Verify that there is at least one body part
- if ((entity.getBodyParts() == null) || (entity.getBodyParts().size() < 1)) {
- throw new WebApplicationException(new IllegalArgumentException("Must specify at least one body part"));
- }
-
- // If our entity is not nested, make sure the MIME-Version header is set
- if (entity.getParent() == null) {
- Object value = headers.getFirst("MIME-Version");
- if (value == null) {
- headers.putSingle("MIME-Version", "1.0");
- }
- }
-
- // Initialize local variables we need
- final Writer writer = new BufferedWriter(new OutputStreamWriter(stream)); // FIXME - charset???
-
- // Determine the boundary string to be used, creating one if needed
- final MediaType boundaryMediaType = Boundary.addBoundary(mediaType);
- if (boundaryMediaType != mediaType) {
- headers.putSingle(HttpHeaders.CONTENT_TYPE, boundaryMediaType);
- }
-
- final String boundaryString = boundaryMediaType.getParameters().get("boundary");
- // Iterate through the body parts for this message
- boolean isFirst = true;
- for (final BodyPart bodyPart : entity.getBodyParts()) {
-
- // Write the leading boundary string
- if (isFirst) {
- isFirst = false;
- writer.write("--");
- } else {
- writer.write("\r\n--");
- }
- writer.write(boundaryString);
- writer.write("\r\n");
-
- // Write the headers for this body part
- final MediaType bodyMediaType = bodyPart.getMediaType();
- if (bodyMediaType == null) {
- throw new WebApplicationException(new IllegalArgumentException("Missing body part media type"));
- }
- final MultivaluedMap<String, String> bodyHeaders = bodyPart.getHeaders();
- bodyHeaders.putSingle("Content-Type", bodyMediaType.toString());
-
- if (bodyHeaders.getFirst("Content-Disposition") == null
- && bodyPart.getContentDisposition() != null) {
- bodyHeaders.putSingle("Content-Disposition", bodyPart.getContentDisposition().toString());
- }
-
- // Iterate for the nested body parts
- for (final Map.Entry<String, List<String>> entry : bodyHeaders.entrySet()) {
-
- // Only headers that match "Content-*" are allowed on body parts
- if (!entry.getKey().toLowerCase().startsWith("content-")) {
- throw new WebApplicationException(new IllegalArgumentException("Invalid body part header '" + entry.getKey() + "', only Content-* allowed"));
- }
-
- // Write this header and its value(s)
- writer.write(entry.getKey());
- writer.write(':');
- boolean first = true;
- for (String value : entry.getValue()) {
- if (first) {
- writer.write(' ');
- first = false;
- } else {
- writer.write(',');
- }
- writer.write(value);
- }
- writer.write("\r\n");
- }
-
- // Mark the end of the headers for this body part
- writer.write("\r\n");
- writer.flush();
-
- // Write the entity for this body part
- Object bodyEntity = bodyPart.getEntity();
- if (bodyEntity == null) {
- throw new WebApplicationException(
- new IllegalArgumentException("Missing body part entity of type '" + bodyMediaType + "'"));
- }
-
- Class bodyClass = bodyEntity.getClass();
- if (bodyEntity instanceof BodyPartEntity) {
- bodyClass = InputStream.class;
- bodyEntity = ((BodyPartEntity) bodyEntity).getInputStream();
- }
-
- final MessageBodyWriter bodyWriter = providers.getMessageBodyWriter(
- bodyClass,
- bodyClass,
- EMPTY_ANNOTATIONS,
- bodyMediaType);
-
- if (bodyWriter == null) {
- throw new WebApplicationException(
- new IllegalArgumentException(
- "No MessageBodyWriter for body part of type '" +
- bodyEntity.getClass().getName() + "' and media type '" +
- bodyMediaType + "'"));
- }
-
- bodyWriter.writeTo(
- bodyEntity,
- bodyClass,
- bodyClass,
- EMPTY_ANNOTATIONS,
- bodyMediaType,
- bodyHeaders,
- stream);
- }
-
- // Write the final boundary string
- writer.write("\r\n--");
- writer.write(boundaryString);
- writer.write("--\r\n");
- writer.flush();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/multipart/package-info.java
deleted file mode 100644
index 420f8786b1f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/multipart/package-info.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-/**
- * <h3>JAX-RS Integration with MIME MultiPart Message Formats</h3>
- *
- * <p>The classes in this package provide for integration of
- * <code>multipart/*</code> request
- * and response bodies in a JAX-RS runtime environment. The set of registered
- * providers is leveraged, in that the content type for a body part of such a
- * message reuses the same MessageBodyReader/MessageBodyWriter implementations
- * as would be used for that content type as a standalone entity.</p>
- *
- * <p>For more information on the syntax and semantics of MIME multipart streams,
- * see the following RFCs:</p>
- * <ul>
- * <li><a href="http://www.ietf.org/rfc/rfc2045.txt">Multipurpose Internet Mail
- * Extensions (MIME) Part One: Format of Internet Message Bodies</a>
- * (RFC 2045)</li>
- * <li><a href="http://www.ietf.org/rfc/rfc2046.txt">Multipurpose Internet Mail
- * Extensions (MIME) Part Two: Media Types</a> (RFC 2046)</li>
- * <li><a href="http://www.ietf.org/rfc/rfc2047.txt">Multipurpose Internet Mail
- * Extensions (MIME) Part Three: Message Header Extensions for Non-ASCII
- * Text</a> (RFC 2047)</li>
- * <li><a href="http://www.ietf.org/rfc/rfc2048.txt">Multipurpose Internet Mail
- * Extensions (MIME) Part Four: Registration Procedures</a> (RFC 2048)</li>
- * <li><a href="http://www.ietf.org/rfc/rfc2048.txt">Multipurpose Internet Mail
- * Extensions (MIME) Part Five: Conformance Criteria and Examples</a>
- * (RFC 2049)</li>
- * </ul>
- *
- * <h4>Implementation Notes</h4>
- *
- * <p>The following notes describe significant aspects of the implementation
- * of the MIME MultiPart APIs in this (and related) packages:</p>
- * <ul>
- * <li>Although packaged as a Jersey extension, the runtime code in this
- * library should be portable to any compliant JAX-RS implementation.
- * Jersey is only required for execution of the unit tests.</li>
- * </ul>
- *
- * <h4>Supported MIME Multipart Capabilities</h4>
- *
- * <p>The following list of general MIME MultiPart features is currently
- * supported:</p>
- * <ul>
- * <li>The <code>MIME-Version: 1.0</code> HTTP header is included on generated
- * responses. It is accepted, but not required, on processed requests.</li>
- * <li>A <code>MessageBodyReader</code> implementation for consuming MIME
- * MultiPart entities. See below for usage restrictions.</li>
- * <li>A <code>MessageBodyWriter</code> implementation for producing MIME
- * MultiPart entities. The appropriate <code>Provider</code> is used to
- * serialize each body part, based on its media type.</li>
- * <li>Optional creation of an appropriate <code>boundary</code> parameter on a
- * generated <code>Content-Type</code> header, if not already present.</li>
- * <li>Top level content type of <code>multipart</code>, with the following
- * supported subtypes: <code>alternative</code>, <code>digest</code>,
- * <code>mixed</code>, and <code>parallel</code>.</li>
- * </ul>
- *
- * <p>At present, the <code>MessageBodyReader</code> implementation exhibits a
- * usability issue. It is not currently possible to know ahead of time what
- * Java class the application would prefer to use for each individual body part,
- * so an appropriate <code>Provider</code> cannot be selected. Currently, the
- * unparsed content of each body part is returned (as a byte array) in the
- * <code>entity</code> property of the returned <code>BodyPart}</code> instance, and
- * the application can decide what further steps are needed based on the
- * headers included in that body part. The simplest technique is to examine
- * the received <code>BodyPart</code>, and then call the <code>getEntityAs()</code>
- * method once you know which implementation class you would prefer.</p>
- *
- * <h4>Not (Yet) Supported MIME Multipart Capabilities</h4>
- *
- * <p>The following list of general MIME MultiPart features is NOT (yet, in
- * most cases) supported:</p>
- * <ul>
- * <li>The <code>charset</code> parameter on the <code>Content-Type</code> header
- * field. Currently, the hard coded charset is FIXME. [RFC2045#5.2]</li>
- * <li>The <code>Content-Transfer-Encoding</code> header field. [RFC2045#6]</li>
- * <li>The <code>message/*</code> family of content types.</li>
- * </ul>
- */
-package com.sun.jersey.multipart;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/BuildId.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/BuildId.java
deleted file mode 100644
index 8bb85c9745b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/BuildId.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl;
-
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class BuildId {
- private static String buildId = _initiateBuildId();
-
- private static String _initiateBuildId() {
- String id = "Jersey";
-
- final InputStream in = getIntputStream();
- if (in != null) {
- try {
- Properties p = new Properties();
- p.load(in);
- String _id = p.getProperty("Build-Id");
- if (_id != null)
- id = id + ": " + _id;
- } catch (Exception e){
- // Ignore
- } finally {
- close(in);
- }
- }
- return id;
- }
-
- private static void close(InputStream in) {
- try {
- in.close();
- } catch (Exception ex) {
- // Ignore
- }
- }
-
- private static InputStream getIntputStream() {
- try {
- return BuildId.class.getResourceAsStream("build.properties");
- } catch (Exception ex) {
- return null;
- }
- }
-
- public static final String getBuildId() {
- return buildId;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/InitialContextHelper.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/InitialContextHelper.java
deleted file mode 100644
index 884e5a4e7ea..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/InitialContextHelper.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class InitialContextHelper {
-
- public static InitialContext getInitialContext() {
- try {
- // Deployment on Google App Engine will
- // result in a LinkageError
- return new InitialContext();
- } catch (NamingException ex) {
- return null;
- } catch (LinkageError ex) {
- return null;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalHttpContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalHttpContext.java
deleted file mode 100644
index 2555ed8f478..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalHttpContext.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.api.core.ExtendedUriInfo;
-import java.util.Map;
-
-/**
- * Implementation of {@link HttpContext} using {@link ThreadLocal}
- * to store {@link HttpRequestContext} and {@link HttpResponseContext} instances
- * associated with threads.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ThreadLocalHttpContext implements HttpContext {
- private ThreadLocal<HttpContext> context = new ThreadLocal<HttpContext>();
-
- /**
- * Set the {@link HttpContext} for the current thread.
- */
- public void set(HttpContext context) {
- this.context.set(context);
- }
-
- public HttpContext get() {
- return this.context.get();
- }
-
- public ExtendedUriInfo getUriInfo() {
- try {
- return context.get().getUriInfo();
- } catch (NullPointerException ex) {
- throw new IllegalStateException();
- }
- }
-
- public HttpRequestContext getRequest() {
- try {
- return context.get().getRequest();
- } catch (NullPointerException ex) {
- throw new IllegalStateException();
- }
- }
-
- public HttpResponseContext getResponse() {
- try {
- return context.get().getResponse();
- } catch (NullPointerException ex) {
- throw new IllegalStateException();
- }
- }
-
- public Map<String, Object> getProperties() {
- try {
- return context.get().getProperties();
- } catch (NullPointerException ex) {
- throw new IllegalStateException();
- }
- }
-
- public boolean isTracingEnabled() {
- try {
- return context.get().isTracingEnabled();
- } catch (NullPointerException ex) {
- throw new IllegalStateException();
- }
- }
-
- public void trace(String message) {
- try {
- context.get().trace(message);
- } catch (NullPointerException ex) {
- throw new IllegalStateException();
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalInvoker.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalInvoker.java
deleted file mode 100644
index ac057199780..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalInvoker.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-
-/**
- * A proxy invocation handler that delegates all methods to a thread
- * local instance
- */
-public class ThreadLocalInvoker<T> implements InvocationHandler {
- private ThreadLocal<T> threadLocalInstance = new ThreadLocal<T>();
-
- private ThreadLocal<T> immutableThreadLocalInstance;
-
- public void set(T threadLocalInstance) {
- this.threadLocalInstance.set(threadLocalInstance);
- }
-
- public T get() {
- return this.threadLocalInstance.get();
- }
-
- public ThreadLocal<T> getThreadLocal() {
- return threadLocalInstance;
- }
-
- public ThreadLocal<T> getImmutableThreadLocal() {
- if (immutableThreadLocalInstance == null) {
- immutableThreadLocalInstance = new ThreadLocal<T>() {
- @Override
- public T get() {
- return ThreadLocalInvoker.this.get();
- }
-
- @Override
- public void remove() {
- throw new IllegalStateException();
- }
-
- @Override
- public void set(T t) {
- throw new IllegalStateException();
- }
- };
- }
- return immutableThreadLocalInstance;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- if (threadLocalInstance.get() == null)
- throw new IllegalStateException("No thread local value in scope for proxy of " + proxy.getClass());
-
- try {
- return method.invoke(threadLocalInstance.get(), args);
- } catch (IllegalAccessException ex) {
- throw new IllegalStateException(ex);
- } catch (InvocationTargetException ex) {
- throw ex.getTargetException();
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.java
deleted file mode 100644
index ad6f40133e1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl;
-
-import java.lang.reflect.Method;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * A proxy invocation handler that delegates all methods to a thread
- * local instance
- */
-public class ThreadLocalNamedInvoker<T> extends ThreadLocalInvoker<T> {
-
- private String name;
-
- /**
- * @param name the JNDI name at which an instance of T can be found
- */
- public ThreadLocalNamedInvoker(String name) {
- this.name = name;
- }
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- // if no instance yet exists for the current thread then look one up
- // and stash it
- if (this.get() == null) {
- Context ctx = new InitialContext();
- T t = (T) ctx.lookup(name);
- this.set(t);
- }
- return super.invoke(proxy,method,args);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/VariantSelector.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/VariantSelector.java
deleted file mode 100644
index b6979ad7b10..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/VariantSelector.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl;
-
-import com.sun.jersey.core.header.AcceptableLanguageTag;
-import com.sun.jersey.core.header.AcceptableMediaType;
-import com.sun.jersey.core.header.AcceptableToken;
-import com.sun.jersey.core.header.QualityFactor;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.server.impl.model.HttpHelper;
-import com.sun.jersey.spi.container.ContainerRequest;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Variant;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class VariantSelector {
-
- private VariantSelector() { }
-
- /**
- * Interface to get a dimension value from a variant and check if an
- * acceptable dimension value is compatible with a dimension value.
- *
- * @param T the acceptable dimension value type
- * @param U the dimension value type
- */
- private static interface DimensionChecker<T, U> {
- /**
- * Get the dimension value from the variant
- *
- * @param v the variant
- * @return the dimension value
- */
- U getDimension(VariantHolder v);
-
- /**
- * Get the quality source of the dimension
- *
- * @return
- */
- int getQualitySource(VariantHolder v, U u);
-
- /**
- * Ascertain if the acceptable dimension value is compatible with
- * the dimension value
- *
- * @param t the acceptable dimension value
- * @param u the dimension value
- * @return true if the acceptable dimension value is compatible with
- * the dimension value
- */
- boolean isCompatible(T t, U u);
-
- String getVaryHeaderValue();
- }
-
- private static final DimensionChecker<AcceptableMediaType, MediaType> MEDIA_TYPE_DC =
- new DimensionChecker<AcceptableMediaType, MediaType>() {
- public MediaType getDimension(VariantHolder v) {
- return v.v.getMediaType();
- }
-
- public boolean isCompatible(AcceptableMediaType t, MediaType u) {
- return t.isCompatible(u);
- }
-
- public int getQualitySource(VariantHolder v, MediaType u) {
- return v.mediaTypeQs;
- }
-
- public String getVaryHeaderValue() {
- return HttpHeaders.ACCEPT;
- }
- };
-
- private static final DimensionChecker<AcceptableLanguageTag, Locale> LANGUAGE_TAG_DC =
- new DimensionChecker<AcceptableLanguageTag, Locale>() {
- public Locale getDimension(VariantHolder v) {
- return v.v.getLanguage();
- }
-
- public boolean isCompatible(AcceptableLanguageTag t, Locale u) {
- return t.isCompatible(u);
- }
-
- public int getQualitySource(VariantHolder qsv, Locale u) {
- return QualityFactor.MINUMUM_QUALITY;
- }
-
- public String getVaryHeaderValue() {
- return HttpHeaders.ACCEPT_LANGUAGE;
- }
- };
-
- private static final DimensionChecker<AcceptableToken, String> CHARSET_DC =
- new DimensionChecker<AcceptableToken, String>() {
- public String getDimension(VariantHolder v) {
- MediaType m = v.v.getMediaType();
- return (m != null) ? m.getParameters().get("charset") : null;
- }
-
- public boolean isCompatible(AcceptableToken t, String u) {
- return t.isCompatible(u);
- }
-
- public int getQualitySource(VariantHolder qsv, String u) {
- return QualityFactor.MINUMUM_QUALITY;
- }
-
- public String getVaryHeaderValue() {
- return HttpHeaders.ACCEPT_CHARSET;
- }
- };
-
- private static final DimensionChecker<AcceptableToken, String> ENCODING_DC =
- new DimensionChecker<AcceptableToken, String>() {
- public String getDimension(VariantHolder v) {
- return v.v.getEncoding();
- }
-
- public boolean isCompatible(AcceptableToken t, String u) {
- return t.isCompatible(u);
- }
-
- public int getQualitySource(VariantHolder qsv, String u) {
- return QualityFactor.MINUMUM_QUALITY;
- }
-
- public String getVaryHeaderValue() {
- return HttpHeaders.ACCEPT_ENCODING;
- }
- };
-
- /**
- * Select variants for a given dimension.
- *
- * @param the collection of variants.
- *
- * @param as the list of acceptable dimension values, ordered by the quality
- * parameter, with the highest quality dimension value occurring
- * first.
- * @param dc the dimension checker
- */
- private static <T extends QualityFactor, U> LinkedList<VariantHolder> selectVariants(
- LinkedList<VariantHolder> vs,
- List<T> as,
- DimensionChecker<T, U> dc,
- Set<String> vary) {
- int cq = QualityFactor.MINUMUM_QUALITY;
- int cqs = QualityFactor.MINUMUM_QUALITY;
-
- final LinkedList<VariantHolder> selected = new LinkedList<VariantHolder>();
-
- // Iterate over the acceptable entries
- // This assumes the entries are ordered by the quality
- for (final T a : as) {
- final int q = a.getQuality();
-
- final Iterator<VariantHolder> iv = vs.iterator();
- while (iv.hasNext()) {
- final VariantHolder v = iv.next();
-
- // Get the dimension value of the variant to check
- final U d = dc.getDimension(v);
-
- if (d != null) {
- vary.add(dc.getVaryHeaderValue());
- // Check if the acceptable entry is compatable with
- // the dimension value
- final int qs = dc.getQualitySource(v, d);
- if (qs >= cqs && dc.isCompatible(a, d)) {
- if (qs > cqs) {
- cqs = qs;
- cq = q;
- // Remove all entries that were added for qs < cqs
- selected.clear();
- selected.add(v);
- } else if (q > cq) {
- cq = q;
- // Add variant with higher accept quality at the front
- selected.addFirst(v);
- } else if (q == cq) {
- // Ensure selection is stable with order of variants
- // with same quality of source and accept quality
- selected.add(v);
- }
- iv.remove();
- }
- }
- }
- }
-
- // Add all variants that are not compatible with this dimension
- // to the end
- for (VariantHolder v : vs) {
- if (dc.getDimension(v) == null)
- selected.add(v);
- }
- return selected;
- }
-
- private static class VariantHolder {
- private final Variant v;
-
- private final int mediaTypeQs;
-
- public VariantHolder(Variant v) {
- this(v, QualitySourceMediaType.DEFAULT_QUALITY_SOURCE_FACTOR);
- }
-
- public VariantHolder(Variant v, int mediaTypeQs) {
- this.v = v;
- this.mediaTypeQs = mediaTypeQs;
- }
- }
-
- private static LinkedList<VariantHolder> getVariantHolderList(final List<Variant> variants) {
- final LinkedList<VariantHolder> l = new LinkedList<VariantHolder>();
- for (Variant v : variants) {
- final MediaType mt = v.getMediaType();
- if (mt != null) {
- if (mt instanceof QualitySourceMediaType || mt.getParameters().
- containsKey(QualitySourceMediaType.QUALITY_SOURCE_FACTOR)) {
- int qs = QualitySourceMediaType.getQualitySource(mt);
- l.add(new VariantHolder(v, qs));
- } else {
- l.add(new VariantHolder(v));
- }
- } else {
- l.add(new VariantHolder(v));
- }
- }
-
- return l;
- }
-
- public static Variant selectVariant(ContainerRequest r, List<Variant> variants) {
- LinkedList<VariantHolder> vhs = getVariantHolderList(variants);
-
- Set<String> vary = new HashSet<String>();
- vhs = selectVariants(vhs, HttpHelper.getAccept(r), MEDIA_TYPE_DC, vary);
- vhs = selectVariants(vhs, HttpHelper.getAcceptLanguage(r), LANGUAGE_TAG_DC, vary);
- vhs = selectVariants(vhs, HttpHelper.getAcceptCharset(r), CHARSET_DC, vary);
- vhs = selectVariants(vhs, HttpHelper.getAcceptEncoding(r), ENCODING_DC, vary);
-
-
- if (vhs.isEmpty()) {
- return null;
- } else {
- StringBuilder varyHeader = new StringBuilder();
- for (String v : vary) {
- if (varyHeader.length() > 0) {
- varyHeader.append(',');
- }
- varyHeader.append(v);
- }
- r.getProperties().put(ContainerRequest.VARY_HEADER, varyHeader.toString());
- return vhs.iterator().next().v;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/CloseableServiceFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/CloseableServiceFactory.java
deleted file mode 100644
index 8c896c7c7ee..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/CloseableServiceFactory.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.sun.jersey.server.impl.application;
-
-import com.sun.jersey.spi.CloseableService;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import java.io.Closeable;
-import java.lang.reflect.Type;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.core.Context;
-
-/**
- *
- * @author paulsandoz
- */
-public class CloseableServiceFactory implements
- InjectableProvider<Context, Type>, Injectable<CloseableService>, CloseableService {
- private static final Logger LOGGER = Logger.getLogger(CloseableServiceFactory.class.getName());
-
- private final HttpContext context;
-
- public CloseableServiceFactory(@Context HttpContext context) {
- this.context = context;
- }
-
- // InjectableProvider
-
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public Injectable getInjectable(ComponentContext ic, Context a, Type c) {
- if (c != CloseableService.class)
- return null;
-
- return this;
- }
-
- // Injectable
-
- public CloseableService getValue() {
- return this;
- }
-
- // CloseableService
-
- public void add(Closeable c) {
- Set<Closeable> s = (Set<Closeable>)context.getProperties().
- get(CloseableServiceFactory.class.getName());
- if (s == null) {
- s = new HashSet<Closeable>();
- context.getProperties().put(CloseableServiceFactory.class.getName(), s);
- }
-
- s.add(c);
- }
-
- public void close(HttpContext context) {
- Set<Closeable> s = (Set<Closeable>)context.getProperties().
- get(CloseableServiceFactory.class.getName());
- if (s != null) {
- for (Closeable c : s) {
- try {
- c.close();
- } catch (Exception ex) {
- LOGGER.log(Level.SEVERE, "Unable to close", ex);
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/DeferredResourceConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/DeferredResourceConfig.java
deleted file mode 100644
index 86f5ba156da..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/DeferredResourceConfig.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.application;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.DefaultResourceConfig;
-import com.sun.jersey.core.spi.component.ComponentProvider;
-import com.sun.jersey.core.spi.component.ProviderFactory;
-import java.util.Collections;
-import java.util.Set;
-import java.util.logging.Logger;
-import javax.ws.rs.core.Application;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class DeferredResourceConfig extends DefaultResourceConfig {
-
- private static final Logger LOGGER =
- Logger.getLogger(DeferredResourceConfig.class.getName());
-
- private final Class<? extends Application> appClass;
-
- private final Set<Class<?>> defaultClasses;
-
- public DeferredResourceConfig(Class<? extends Application> appClass) {
- this(appClass, Collections.<Class<?>>emptySet());
- }
-
- public DeferredResourceConfig(Class<? extends Application> appClass,
- Set<Class<?>> defaultClasses) {
- this.appClass = appClass;
- this.defaultClasses = defaultClasses;
- }
-
- public ApplicationHolder getApplication(ProviderFactory pf) {
- return new ApplicationHolder(pf);
- }
-
- public class ApplicationHolder {
- private final Application originalApp;
-
- private final DefaultResourceConfig adaptedApp;
-
- private ApplicationHolder(ProviderFactory pf) {
- final ComponentProvider cp = pf.getComponentProvider(appClass);
- if (cp == null) {
- throw new ContainerException("The Application class " + appClass.getName() + " could not be instantiated");
- }
- this.originalApp = (Application)cp.getInstance();
-
- if ((originalApp.getClasses() == null || originalApp.getClasses().isEmpty()) &&
- (originalApp.getSingletons() == null || originalApp.getSingletons().isEmpty())) {
- LOGGER.info("Instantiated the Application class " + appClass.getName() +
- ". The following root resource and provider classes are registered: " + defaultClasses);
- this.adaptedApp = new DefaultResourceConfig(defaultClasses);
- adaptedApp.add(originalApp);
- } else {
- LOGGER.info("Instantiated the Application class " + appClass.getName());
- adaptedApp = null;
- }
-
- }
-
- public Application getOriginalApplication() {
- return originalApp;
- }
-
- public Application getApplication() {
- return (adaptedApp != null) ? adaptedApp : originalApp;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ExceptionMapperFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ExceptionMapperFactory.java
deleted file mode 100644
index f0a6658cf8c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ExceptionMapperFactory.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.application;
-
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.spi.container.ExceptionMapperContext;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.util.HashSet;
-import java.util.Set;
-import javax.ws.rs.ext.ExceptionMapper;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ExceptionMapperFactory implements ExceptionMapperContext {
-
- private static class ExceptionMapperType {
- ExceptionMapper em;
- Class<? extends Throwable> c;
-
- public ExceptionMapperType(ExceptionMapper em, Class<? extends Throwable> c) {
- this.em = em;
- this.c = c;
- }
- }
-
- private Set<ExceptionMapperType> emts = new HashSet<ExceptionMapperType>();
-
- public ExceptionMapperFactory() {
- }
-
- public void init(ProviderServices providerServices) {
- for (ExceptionMapper em : providerServices.getProviders(ExceptionMapper.class)) {
- Class<? extends Throwable> c = getExceptionType(em.getClass());
- if (c != null) {
- emts.add(new ExceptionMapperType(em, c));
- }
- }
- }
-
- // ExceptionMapperContext
-
- public ExceptionMapper find(Class<? extends Throwable> c) {
- int distance = Integer.MAX_VALUE;
- ExceptionMapper selectedEm = null;
- for (ExceptionMapperType emt : emts) {
- int d = distance(c, emt.c);
- if (d < distance) {
- distance = d;
- selectedEm = emt.em;
- if (distance == 0) break;
- }
- }
-
- return selectedEm;
- }
-
- private int distance(Class<?> c, Class<?> emtc) {
- int distance = 0;
- if (!emtc.isAssignableFrom(c))
- return Integer.MAX_VALUE;
-
- while (c != emtc) {
- c = c.getSuperclass();
- distance++;
- }
-
- return distance;
- }
-
- @SuppressWarnings("unchecked")
- private Class<? extends Throwable> getExceptionType(Class<? extends ExceptionMapper> c) {
- Class<?> t = getType(c);
- if (Throwable.class.isAssignableFrom(t))
- return (Class<? extends Throwable>)t;
-
- // TODO log warning
- return null;
- }
-
- private Class getType(Class<? extends ExceptionMapper> c) {
- Class _c = c;
- while (_c != Object.class) {
- Type[] ts = _c.getGenericInterfaces();
- for (Type t : ts) {
- if (t instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)t;
- if (pt.getRawType() == ExceptionMapper.class) {
- return getResolvedType(pt.getActualTypeArguments()[0], c, _c);
- }
- }
- }
-
- _c = _c.getSuperclass();
- }
-
- // This statement will never be reached
- return null;
- }
-
- private Class getResolvedType(Type t, Class c, Class dc) {
- if (t instanceof Class)
- return (Class)t;
- else if (t instanceof TypeVariable) {
- ReflectionHelper.ClassTypePair ct = ReflectionHelper.
- resolveTypeVariable(c, dc, (TypeVariable)t);
- if (ct != null)
- return ct.c;
- else
- return null;
- } else if (t instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)t;
- return (Class)pt.getRawType();
- } else {
- // TODO log
- return null;
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.java
deleted file mode 100644
index 0ce693c46b0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.application;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.spi.container.ResourceMethodDispatchAdapter;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import com.sun.jersey.spi.inject.Errors;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResourceMethodDispatcherFactory implements ResourceMethodDispatchProvider {
-
- private static final Logger LOGGER = Logger.getLogger(ResourceMethodDispatcherFactory.class.getName());
-
- private final Set<ResourceMethodDispatchProvider> dispatchers;
-
- private ResourceMethodDispatcherFactory(ProviderServices providerServices) {
- dispatchers = providerServices.getProvidersAndServices(
- ResourceMethodDispatchProvider.class);
- }
-
- public static ResourceMethodDispatchProvider create(ProviderServices providerServices) {
- ResourceMethodDispatchProvider p = new ResourceMethodDispatcherFactory(providerServices);
-
- for (ResourceMethodDispatchAdapter a :
- providerServices.getProvidersAndServices(ResourceMethodDispatchAdapter.class)) {
- p = a.adapt(p);
- }
- return p;
- }
-
- // ResourceMethodDispatchProvider
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
- // Mark the errors so it is possible to reset
- Errors.mark();
- for (ResourceMethodDispatchProvider rmdp : dispatchers) {
- try {
- RequestDispatcher d = rmdp.create(abstractResourceMethod);
- if (d != null) {
- // Reset any errors, if any, produced from previous dispatch
- // providers
- Errors.reset();
- return d;
- }
- } catch (Exception e) {
- LOGGER.log(Level.SEVERE, ImplMessages.ERROR_PROCESSING_METHOD(
- abstractResourceMethod.getMethod(),
- rmdp.getClass().getName()), e);
- }
- }
-
- Errors.unmark();
- return null;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/RootResourceUriRules.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/RootResourceUriRules.java
deleted file mode 100644
index eadb7fd1c6e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/RootResourceUriRules.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.application;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.core.spi.component.ComponentInjector;
-import com.sun.jersey.core.spi.factory.InjectableProviderFactory;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.server.impl.model.RulesMap;
-import com.sun.jersey.server.impl.uri.PathPattern;
-import com.sun.jersey.server.impl.uri.PathTemplate;
-import com.sun.jersey.server.impl.uri.rules.ResourceClassRule;
-import com.sun.jersey.server.impl.uri.rules.ResourceObjectRule;
-import com.sun.jersey.server.impl.uri.rules.RightHandPathRule;
-import com.sun.jersey.server.impl.wadl.WadlFactory;
-import com.sun.jersey.server.impl.wadl.WadlResource;
-import com.sun.jersey.spi.inject.Errors;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-
-/**
- * A class that creates a rules map for root resources.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class RootResourceUriRules {
- private static final Logger LOGGER = Logger.getLogger(RootResourceUriRules.class.getName());
-
- private final RulesMap<UriRule> rules = new RulesMap<UriRule>();
-
- private final WebApplicationImpl wa;
-
- private final WadlFactory wadlFactory;
-
- private final ResourceConfig resourceConfig;
-
- private final InjectableProviderFactory injectableFactory;
-
- public RootResourceUriRules(
- final WebApplicationImpl wa,
- final ResourceConfig resourceConfig,
- final WadlFactory wadlFactory,
- final InjectableProviderFactory injectableFactory) {
- this.wa = wa;
- this.resourceConfig = resourceConfig;
- this.wadlFactory = wadlFactory;
- this.injectableFactory = injectableFactory;
-
- final Set<Class<?>> classes = resourceConfig.getRootResourceClasses();
-
- final Set<Object> singletons = resourceConfig.getRootResourceSingletons();
-
- if (classes.isEmpty() &&
- singletons.isEmpty() &&
- resourceConfig.getExplicitRootResources().isEmpty()) {
- LOGGER.severe(ImplMessages.NO_ROOT_RES_IN_RES_CFG());
- throw new ContainerException(ImplMessages.NO_ROOT_RES_IN_RES_CFG());
- }
-
- final Set<AbstractResource> rootResourcesSet = wa.getAbstractRootResources();
- final Map<String, AbstractResource> explicitRootResources = wa.getExplicitAbstractRootResources();
-
- // Initiate the WADL with the root resources
- initWadl(rootResourcesSet);
-
- // Process singleton instances of root resource classes
- for (final Object o : singletons) {
- final AbstractResource ar = wa.getAbstractResource(o);
- // Configure meta-data
- wa.initiateResource(ar, o);
-
- final ComponentInjector ci = new ComponentInjector(injectableFactory, o.getClass());
- ci.inject(o);
-
- addRule(ar.getPath().getValue(), o);
- }
-
- // Process root resource classes
- for (final Class<?> c : classes) {
- final AbstractResource ar = wa.getAbstractResource(c);
- // Configure meta-data
- wa.initiateResource(ar);
-
- addRule(ar.getPath().getValue(), c);
- }
-
- // Process explicit root resources
- for (final Map.Entry<String, Object> e : resourceConfig.getExplicitRootResources().entrySet()) {
- final String path = e.getKey();
- final Object o = e.getValue();
- if (o instanceof Class) {
- final Class c = (Class)o;
-
- // Configure meta-data
- wa.initiateResource(explicitRootResources.get(path));
-
- addRule(path, c);
- } else {
- // Configure meta-data
- wa.initiateResource(explicitRootResources.get(path));
-
- final ComponentInjector ci = new ComponentInjector(injectableFactory, o.getClass());
- ci.inject(o);
-
- addRule(path, o);
- }
- }
-
- rules.processConflicts(new RulesMap.ConflictClosure() {
- public void onConflict(PathPattern p1, PathPattern p2) {
- Errors.error(String.format("Conflicting URI templates. "
- + "The URI templates %s and %s for root resource classes "
- + "transform to the same regular expression %s",
- p1.getTemplate().getTemplate(),
- p2.getTemplate().getTemplate(),
- p1));
- }
- });
-
- initWadlResource();
- }
-
- private void initWadl(final Set<AbstractResource> rootResources) {
- if (!wadlFactory.isSupported())
- return;
-
- wadlFactory.init(injectableFactory, rootResources);
- }
-
- private void initWadlResource() {
- if (!wadlFactory.isSupported())
- return;
-
- final PathPattern p = new PathPattern(new PathTemplate("application.wadl"));
-
- // If "application.wadl" is already defined to not add the
- // default WADL resource
- if (rules.containsKey(p))
- return;
-
- // Configure meta-data
- wa.initiateResource(WadlResource.class);
-
- rules.put(p, new RightHandPathRule(
- resourceConfig.getFeature(ResourceConfig.FEATURE_REDIRECT),
- p.getTemplate().endsWithSlash(),
- new ResourceClassRule(p.getTemplate(), WadlResource.class)));
- }
-
- private void addRule(final String path, final Class c) {
- final PathPattern p = getPattern(path, c);
- if (isPatternValid(p, c)) {
- rules.put(p, new RightHandPathRule(
- resourceConfig.getFeature(ResourceConfig.FEATURE_REDIRECT),
- p.getTemplate().endsWithSlash(),
- new ResourceClassRule(p.getTemplate(), c)));
- }
- }
-
- private void addRule(final String path, final Object o) {
- final PathPattern p = getPattern(path, o.getClass());
- if (isPatternValid(p, o.getClass())) {
- rules.put(p, new RightHandPathRule(
- resourceConfig.getFeature(ResourceConfig.FEATURE_REDIRECT),
- p.getTemplate().endsWithSlash(),
- new ResourceObjectRule(p.getTemplate(), o)));
- }
- }
-
- private PathPattern getPattern(String path, Class c) {
- PathPattern p = null;
- try {
- p = new PathPattern(new PathTemplate(path));
- } catch (IllegalArgumentException ex) {
- Errors.error("Illegal URI template for root resource class " + c.getName() +
- ": "+ ex.getMessage());
- }
- return p;
- }
-
- private boolean isPatternValid(PathPattern p, Class c) {
- if (p == null)
- return false;
-
- final PathPattern conflict = rules.hasConflict(p);
- if (conflict != null) {
- Errors.error(String.format("Conflicting URI templates. "
- + "The URI template %s for root resource class %s "
- + "and the URI template %s transform to the same regular expression %s",
- p.getTemplate().getTemplate(),
- c.getName(),
- conflict.getTemplate().getTemplate(),
- p));
- return false;
- } else {
- return true;
- }
- }
-
- public RulesMap<UriRule> getRules() {
- return rules;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationContext.java
deleted file mode 100644
index f3b7b4f0c2a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationContext.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.application;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.api.core.ExtendedUriInfo;
-import com.sun.jersey.api.core.TraceInformation;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.uri.UriComponent;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.core.header.InBoundHeaders;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-import com.sun.jersey.spi.uri.rules.UriRules;
-import java.io.ByteArrayInputStream;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.MatchResult;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.PathSegment;
-import javax.ws.rs.core.UriBuilder;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class WebApplicationContext implements UriRuleContext, ExtendedUriInfo {
- public static final String HTTP_METHOD_MATCH_RESOURCE = "com.sun.jersey.MATCH_RESOURCE";
-
- private final WebApplicationImpl app;
-
- private final boolean isTraceEnabled;
-
- private ContainerRequest request;
-
- private ContainerResponse response;
-
- private List<ContainerResponseFilter> responseFilters;
-
- public WebApplicationContext(WebApplicationImpl app,
- ContainerRequest request, ContainerResponse response) {
- this.app = app;
- this.isTraceEnabled = app.isTracingEnabled();
- this.request = request;
- this.response = response;
- this.responseFilters = Collections.EMPTY_LIST;
-
- if (isTracingEnabled()) {
- getProperties().put(TraceInformation.class.getName(),
- new TraceInformation(this));
- }
- }
-
- public WebApplicationContext createMatchResourceContext(URI u) {
- final URI base = request.getBaseUri();
-
- if (u.isAbsolute()) {
- // TODO check if base is a base of u
- URI r = base.relativize(u);
- if (r == u) {
- throw new ContainerException("The URI " + u + " is not relative to the base URI " + base);
- }
- } else {
- u = UriBuilder.fromUri(base).
- path(u.getRawPath()).
- replaceQuery(u.getRawQuery()).
- fragment(u.getRawFragment()).
- build();
- }
-
- final ContainerRequest _request = new ContainerRequest(app,
- HTTP_METHOD_MATCH_RESOURCE,
- base, u,
- new InBoundHeaders(), new ByteArrayInputStream(new byte[0]));
- _request.setSecurityContext(request);
-
- // Propagate security context
- final ContainerResponse _response = new ContainerResponse(app,
- _request, null);
-
- return new WebApplicationContext(app,
- _request,
- _response);
- }
-
- public List<ContainerResponseFilter> getResponseFilters() {
- return responseFilters;
- }
-
- // HttpContext
-
- @Override
- public HttpRequestContext getRequest() {
- return request;
- }
-
- @Override
- public HttpResponseContext getResponse() {
- return response;
- }
-
- @Override
- public ExtendedUriInfo getUriInfo() {
- return this;
- }
-
- @Override
- public Map<String, Object> getProperties() {
- return request.getProperties();
- }
-
- // Traceable
-
- @Override
- public boolean isTracingEnabled() {
- return isTraceEnabled;
- }
-
- @Override
- public void trace(String message) {
- if (!isTracingEnabled())
- return;
-
- request.trace(message);
- }
-
- // UriMatchResultContext
-
- private MatchResult matchResult;
-
- @Override
- public MatchResult getMatchResult() {
- return matchResult;
- }
-
- @Override
- public void setMatchResult(MatchResult matchResult) {
- this.matchResult = matchResult;
- }
-
-
- // UriRuleContext
-
- private final LinkedList<Object> resources = new LinkedList<Object>();
-
- private final LinkedList<MatchResult> matchResults = new LinkedList<MatchResult>();
-
- private final LinkedList<String> paths = new LinkedList<String>();
-
- private final LinkedList<UriTemplate> templates = new LinkedList<UriTemplate>();
-
- private AbstractResourceMethod arm;
-
- @Override
- public ContainerRequest getContainerRequest() {
- return request;
- }
-
- @Override
- public void setContainerRequest(ContainerRequest request) {
- this.request = request;
- this.response.setContainerRequest(request);
- }
-
- @Override
- public ContainerResponse getContainerResponse() {
- return response;
- }
-
- @Override
- public void setContainerResponse(ContainerResponse response) {
- this.response = response;
- }
-
- @Override
- public void pushContainerResponseFilters(List<ContainerResponseFilter> filters) {
- if (filters.isEmpty())
- return;
-
- if (responseFilters == Collections.EMPTY_LIST)
- responseFilters = new LinkedList<ContainerResponseFilter>();
-
- for (ContainerResponseFilter f : filters) {
- responseFilters.add(0, f);
- }
- }
-
- @Override
- public Object getResource(Class resourceClass) {
- return app.getResourceComponentProvider(resourceClass).getInstance(this);
- }
-
- @Override
- public UriRules<UriRule> getRules(Class resourceClass) {
- return app.getUriRules(resourceClass);
- }
-
- @Override
- public void pushMatch(UriTemplate template, List<String> names) {
- matchResults.addFirst(matchResult);
-
- templates.addFirst(template);
-
- if (encodedTemplateValues == null) {
- encodedTemplateValues = new MultivaluedMapImpl();
- }
-
- int i = 1;
- for (String name : names) {
- final String value = matchResult.group(i++);
- encodedTemplateValues.addFirst(name, value);
-
- if (decodedTemplateValues != null) {
- decodedTemplateValues.addFirst(
- UriComponent.decode(name, UriComponent.Type.PATH_SEGMENT),
- UriComponent.decode(value, UriComponent.Type.PATH));
- }
- }
- }
-
- @Override
- public void pushResource(Object resource) {
- resources.addFirst(resource);
- }
-
- @Override
- public void pushMethod(AbstractResourceMethod arm) {
- this.arm = arm;
- }
-
- @Override
- public void pushRightHandPathLength(int rhpathlen) {
- final String ep = request.getPath(false);
- paths.addFirst(ep.substring(0,
- ep.length() - rhpathlen));
- }
-
-
- // UriInfo, defer to HttpRequestContext
-
- private MultivaluedMapImpl encodedTemplateValues;
-
- private MultivaluedMapImpl decodedTemplateValues;
-
- @Override
- public URI getBaseUri() {
- return request.getBaseUri();
- }
-
- @Override
- public UriBuilder getBaseUriBuilder() {
- return request.getBaseUriBuilder();
- }
-
- @Override
- public URI getAbsolutePath() {
- return request.getAbsolutePath();
- }
-
- @Override
- public UriBuilder getAbsolutePathBuilder() {
- return request.getAbsolutePathBuilder();
- }
-
- @Override
- public URI getRequestUri() {
- return request.getRequestUri();
- }
-
- @Override
- public UriBuilder getRequestUriBuilder() {
- return request.getRequestUriBuilder();
- }
-
- @Override
- public String getPath() {
- return request.getPath(true);
- }
-
- @Override
- public String getPath(boolean decode) {
- return request.getPath(decode);
- }
-
- @Override
- public List<PathSegment> getPathSegments() {
- return request.getPathSegments(true);
- }
-
- @Override
- public List<PathSegment> getPathSegments(boolean decode) {
- return request.getPathSegments(decode);
- }
-
- @Override
- public MultivaluedMap<String, String> getQueryParameters() {
- return request.getQueryParameters(true);
- }
-
- @Override
- public MultivaluedMap<String, String> getQueryParameters(boolean decode) {
- return request.getQueryParameters(decode);
- }
-
-
- // UriInfo, matching specific functionality
-
- @Override
- public MultivaluedMap<String, String> getPathParameters() {
- return getPathParameters(true);
- }
-
- @Override
- public MultivaluedMap<String, String> getPathParameters(boolean decode) {
- if (decode) {
- if (decodedTemplateValues != null) {
- return decodedTemplateValues;
- }
-
- decodedTemplateValues = new MultivaluedMapImpl();
- for (Map.Entry<String, List<String>> e : encodedTemplateValues.entrySet()) {
- List<String> l = new ArrayList<String>();
- for (String v : e.getValue()) {
- l.add(UriComponent.decode(v, UriComponent.Type.PATH));
- }
- decodedTemplateValues.put(
- UriComponent.decode(e.getKey(), UriComponent.Type.PATH_SEGMENT),
- l);
- }
-
- return decodedTemplateValues;
- } else {
- return encodedTemplateValues;
- }
- }
-
- @Override
- public List<String> getMatchedURIs() {
- return getMatchedURIs(true);
- }
-
- @Override
- public List<String> getMatchedURIs(boolean decode) {
- List<String> result;
- if (decode) {
- result = new ArrayList<String>(paths.size());
-
- for (String path : paths) {
- result.add(UriComponent.decode(
- path,
- UriComponent.Type.PATH));
- }
- } else {
- result = paths;
- }
- return Collections.unmodifiableList(result);
- }
-
- @Override
- public List<Object> getMatchedResources() {
- return resources;
- }
-
-
- // ExtendedUriInfo
-
- @Override
- public AbstractResourceMethod getMatchedMethod() {
- return arm;
- }
-
- @Override
- public Throwable getMappedThrowable() {
- return response.getMappedThrowable();
- }
-
- @Override
- public List<MatchResult> getMatchedResults() {
- return matchResults;
- }
-
- @Override
- public List<UriTemplate> getMatchedTemplates() {
- return templates;
- }
-
- @Override
- public List<PathSegment> getPathSegments(String name) {
- return getPathSegments(name, true);
- }
-
- @Override
- public List<PathSegment> getPathSegments(String name, boolean decode) {
- int[] bounds = getPathParameterBounds(name);
- if (bounds != null) {
- String path = matchResults.getLast().group();
- // Work out how many path segments are up to the start
- // and end position of the matching path parameter value
- // This assumes that the path always starts with a '/'
- int segmentsStart = 0;
- for (int x = 0; x < bounds[0]; x++) {
- if (path.charAt(x) == '/') {
- segmentsStart++;
- }
- }
- int segmentsEnd = segmentsStart;
- for (int x = bounds[0]; x < bounds[1]; x++) {
- if (path.charAt(x) == '/') {
- segmentsEnd++;
- }
- }
-
- return getPathSegments(decode).subList(segmentsStart - 1, segmentsEnd);
- } else
- return Collections.emptyList();
- }
-
- private int[] getPathParameterBounds(String name) {
- Iterator<UriTemplate> iTemplate = templates.iterator();
- Iterator<MatchResult> iMatchResult = matchResults.iterator();
- while (iTemplate.hasNext()) {
- MatchResult mr = iMatchResult.next();
- // Find the index of path parameter
- int pIndex = getLastPathParameterIndex(name, iTemplate.next());
- if (pIndex != -1) {
- int pathLength = mr.group().length();
- int segmentIndex = mr.end(pIndex + 1);
- int groupLength = segmentIndex - mr.start(pIndex + 1);
-
- // Find the absolute position of the end of the
- // capturing group in the request path
- while (iMatchResult.hasNext()) {
- mr = iMatchResult.next();
- segmentIndex += mr.group().length() - pathLength;
- pathLength = mr.group().length();
- }
- int[] bounds = {segmentIndex - groupLength, segmentIndex};
- return bounds;
- }
- }
- return null;
- }
-
- private int getLastPathParameterIndex(String name, UriTemplate t) {
- int i = 0;
- int pIndex = -1;
- for (String parameterName : t.getTemplateVariables()) {
- if (parameterName.equals(name)) {
- pIndex = i;
- }
- i++;
- }
- return pIndex;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationImpl.java
deleted file mode 100644
index 74234b8e459..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/application/WebApplicationImpl.java
+++ /dev/null
@@ -1,1578 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.application;
-
-import com.sun.jersey.api.NotFoundException;
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.container.filter.UriConnegFilter;
-import com.sun.jersey.api.core.ExtendedUriInfo;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.InjectParam;
-import com.sun.jersey.api.core.ParentRef;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.core.ResourceConfigurator;
-import com.sun.jersey.api.core.ResourceContext;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractResourceModelContext;
-import com.sun.jersey.api.model.AbstractResourceModelListener;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.model.ResourceModelIssue;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ProviderFactory;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactoryInitializer;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCProviderFactory;
-import com.sun.jersey.core.spi.factory.ContextResolverFactory;
-import com.sun.jersey.core.spi.factory.MessageBodyFactory;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.server.impl.BuildId;
-import com.sun.jersey.server.impl.ThreadLocalHttpContext;
-import com.sun.jersey.server.impl.component.IoCResourceFactory;
-import com.sun.jersey.server.impl.component.ResourceFactory;
-import com.sun.jersey.server.impl.container.filter.FilterFactory;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderFactory;
-import com.sun.jersey.server.impl.model.ResourceUriRules;
-import com.sun.jersey.server.impl.model.RulesMap;
-import com.sun.jersey.server.impl.model.parameter.CookieParamInjectableProvider;
-import com.sun.jersey.server.impl.model.parameter.FormParamInjectableProvider;
-import com.sun.jersey.server.impl.model.parameter.HeaderParamInjectableProvider;
-import com.sun.jersey.server.impl.model.parameter.HttpContextInjectableProvider;
-import com.sun.jersey.server.impl.model.parameter.MatrixParamInjectableProvider;
-import com.sun.jersey.server.impl.model.parameter.PathParamInjectableProvider;
-import com.sun.jersey.server.impl.model.parameter.QueryParamInjectableProvider;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorFactory;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderFactory;
-import com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller;
-import com.sun.jersey.server.impl.modelapi.validation.BasicValidator;
-import com.sun.jersey.server.impl.monitoring.MonitoringProviderFactory;
-import com.sun.jersey.server.impl.resource.PerRequestFactory;
-import com.sun.jersey.server.impl.template.TemplateFactory;
-import com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule;
-import com.sun.jersey.server.impl.wadl.WadlFactory;
-import com.sun.jersey.server.spi.component.ResourceComponentInjector;
-import com.sun.jersey.server.spi.component.ResourceComponentProvider;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import com.sun.jersey.spi.StringReaderWorkers;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.container.ContainerResponseWriter;
-import com.sun.jersey.spi.container.ExceptionMapperContext;
-import com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchFactory;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.container.WebApplicationListener;
-import com.sun.jersey.spi.inject.Errors;
-import com.sun.jersey.spi.inject.Inject;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import com.sun.jersey.spi.inject.ServerSide;
-import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
-import com.sun.jersey.spi.monitoring.DispatchingListener;
-import com.sun.jersey.spi.monitoring.RequestListener;
-import com.sun.jersey.spi.monitoring.ResponseListener;
-import com.sun.jersey.spi.service.ServiceFinder;
-import com.sun.jersey.spi.template.TemplateContext;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRules;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Request;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Providers;
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A Web application that contains a set of resources, each referenced by
- * an absolute URI template.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class WebApplicationImpl implements WebApplication {
-
- private static final Logger LOGGER = Logger.getLogger(WebApplicationImpl.class.getName());
-
- private final Map<Class, AbstractResource> abstractResourceMap =
- new HashMap<Class, AbstractResource>();
-
- private final ConcurrentMap<Class, UriRules<UriRule>> rulesMap =
- new ConcurrentHashMap<Class, UriRules<UriRule>>();
-
- private final ConcurrentMap<Class, ResourceComponentProvider> providerMap =
- new ConcurrentHashMap<Class, ResourceComponentProvider>();
-
- private static class ClassAnnotationKey {
- private final Class c;
-
- private final Set<Annotation> as;
-
- public ClassAnnotationKey(Class c, Annotation[] as) {
- this.c = c;
- this.as = new HashSet<Annotation>(Arrays.asList(as));
- }
-
- @Override
- public int hashCode() {
- int hash = 5;
- hash = 67 * hash + (this.c != null ? this.c.hashCode() : 0);
- hash = 67 * hash + (this.as != null ? this.as.hashCode() : 0);
- return hash;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final ClassAnnotationKey other = (ClassAnnotationKey) obj;
- if (this.c != other.c && (this.c == null || !this.c.equals(other.c))) {
- return false;
- }
- if (this.as != other.as && (this.as == null || !this.as.equals(other.as))) {
- return false;
- }
- return true;
- }
- }
-
- private final ConcurrentMap<ClassAnnotationKey, ResourceComponentProvider> providerWithAnnotationKeyMap =
- new ConcurrentHashMap<ClassAnnotationKey, ResourceComponentProvider>();
-
- private final ThreadLocalHttpContext context;
-
- private final CloseableServiceFactory closeableFactory;
-
- private boolean initiated;
-
- private ResourceConfig resourceConfig;
-
- private RootResourceClassesRule rootsRule;
-
- private ServerInjectableProviderFactory injectableFactory;
-
- private ProviderFactory cpFactory;
-
- private ResourceFactory rcpFactory;
-
- private IoCComponentProviderFactory provider;
-
- private List<IoCComponentProviderFactory> providerFactories;
-
- private Providers providers;
-
- private MessageBodyFactory bodyFactory;
-
- private StringReaderFactory stringReaderFactory;
-
- private TemplateContext templateContext;
-
- private ExceptionMapperFactory exceptionFactory;
-
- private ResourceMethodDispatchProvider dispatcherFactory;
-
- private ResourceContext resourceContext;
-
- private Set<AbstractResource> abstractRootResources;
-
- private Map<String, AbstractResource> explicitAbstractRootResources;
-
- private final AbstractResourceModelContext armContext = new AbstractResourceModelContext() {
-
- @Override
- public Set<AbstractResource> getAbstractRootResources() {
- return abstractRootResources;
- }
- };
-
- private FilterFactory filterFactory;
-
- private WadlFactory wadlFactory;
-
- private boolean isTraceEnabled;
-
- private RequestListener requestListener;
-
- private DispatchingListenerProxy dispatchingListener;
-
- private ResponseListener responseListener;
-
- public WebApplicationImpl() {
- this.context = new ThreadLocalHttpContext();
-
- InvocationHandler requestHandler = new InvocationHandler() {
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- try {
- return method.invoke(context.getRequest(), args);
- } catch (IllegalAccessException ex) {
- throw new IllegalStateException(ex);
- } catch (InvocationTargetException ex) {
- throw ex.getTargetException();
- }
- }
- };
- InvocationHandler uriInfoHandler = new InvocationHandler() {
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- try {
- return method.invoke(context.getUriInfo(), args);
- } catch (IllegalAccessException ex) {
- throw new IllegalStateException(ex);
- } catch (InvocationTargetException ex) {
- throw ex.getTargetException();
- }
- }
- };
-
- // Create injectable provider factory
- this.injectableFactory = new ServerInjectableProviderFactory();
- injectableFactory.add(new ContextInjectableProvider<InjectableProviderContext>(
- InjectableProviderContext.class, injectableFactory));
- injectableFactory.add(new ContextInjectableProvider<ServerInjectableProviderContext>(
- ServerInjectableProviderContext.class, injectableFactory));
-
- // Add proxied injectables
- final Map<Type, Object> m = new HashMap<Type, Object>();
- m.put(HttpContext.class, context);
- m.put(HttpHeaders.class, createProxy(HttpHeaders.class, requestHandler));
- m.put(UriInfo.class, createProxy(UriInfo.class, uriInfoHandler));
- m.put(ExtendedUriInfo.class, createProxy(ExtendedUriInfo.class, uriInfoHandler));
- m.put(Request.class, createProxy(Request.class, requestHandler));
- m.put(SecurityContext.class, createProxy(SecurityContext.class, requestHandler));
- injectableFactory.add(new InjectableProvider<Context, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable getInjectable(ComponentContext ic, Context a, Type c) {
- final Object o = m.get(c);
- if (o != null) {
- return new Injectable() {
- @Override
- public Object getValue() {
- return o;
- }
- };
- } else
- return null;
- }
- });
-
- injectableFactory.add(new InjectableProvider<Context, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<Injectable> getInjectable(ComponentContext ic, Context a, Type c) {
- if (c instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)c;
- if (pt.getRawType() == Injectable.class) {
- if (pt.getActualTypeArguments().length == 1) {
- final Injectable<?> i = injectableFactory.getInjectable(
- a.annotationType(),
- ic,
- a,
- pt.getActualTypeArguments()[0],
- ComponentScope.PERREQUEST_UNDEFINED_SINGLETON);
- if (i == null)
- return null;
- return new Injectable<Injectable>() {
- @Override
- public Injectable getValue() {
- return i;
- }
- };
- }
- }
- }
-
- return null;
- }
- });
-
- injectableFactory.add(new InjectableProvider<Inject, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<Injectable> getInjectable(ComponentContext ic, Inject a, Type c) {
- if (c instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)c;
- if (pt.getRawType() == Injectable.class) {
- if (pt.getActualTypeArguments().length == 1) {
- final Injectable<?> i = injectableFactory.getInjectable(
- a.annotationType(),
- ic,
- a,
- pt.getActualTypeArguments()[0],
- ComponentScope.PERREQUEST_UNDEFINED_SINGLETON);
- if (i == null)
- return null;
- return new Injectable<Injectable>() {
- @Override
- public Injectable getValue() {
- return i;
- }
- };
- }
- }
- }
-
- return null;
- }
- });
-
- injectableFactory.add(new InjectableProvider<InjectParam, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<Injectable> getInjectable(ComponentContext ic, InjectParam a, Type c) {
- if (c instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)c;
- if (pt.getRawType() == Injectable.class) {
- if (pt.getActualTypeArguments().length == 1) {
- final Injectable<?> i = injectableFactory.getInjectable(
- a.annotationType(),
- ic,
- a,
- pt.getActualTypeArguments()[0],
- ComponentScope.PERREQUEST_UNDEFINED_SINGLETON);
- if (i == null)
- return null;
- return new Injectable<Injectable>() {
- @Override
- public Injectable getValue() {
- return i;
- }
- };
- }
- }
- }
-
- return null;
- }
- });
-
- closeableFactory = new CloseableServiceFactory(context);
- injectableFactory.add(closeableFactory);
- }
-
- private class ComponentProcessorImpl implements IoCComponentProcessor {
- private final ResourceComponentInjector rci;
-
- ComponentProcessorImpl(ResourceComponentInjector rci) {
- this.rci = rci;
- }
-
- @Override
- public void preConstruct() {
- }
-
- @Override
- public void postConstruct(Object o) {
- rci.inject(context.get(), o);
- }
- }
-
- private static final IoCComponentProcessor NULL_COMPONENT_PROCESSOR = new IoCComponentProcessor() {
- @Override
- public void preConstruct() {
- }
-
- @Override
- public void postConstruct(Object o) {
- }
- };
-
- private class ComponentProcessorFactoryImpl implements IoCComponentProcessorFactory {
- private final ConcurrentMap<Class, IoCComponentProcessor> componentProcessorMap =
- new ConcurrentHashMap<Class, IoCComponentProcessor>();
-
- @Override
- public ComponentScope getScope(Class c) {
- return rcpFactory.getScope(c);
- }
-
- @Override
- public IoCComponentProcessor get(final Class c, final ComponentScope scope) {
- IoCComponentProcessor cp = componentProcessorMap.get(c);
- if (cp != null) {
- return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
- }
-
- synchronized (abstractResourceMap) {
- cp = componentProcessorMap.get(c);
- if (cp != null) {
- return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
- }
-
- final ResourceComponentInjector rci = Errors.processWithErrors(new Errors.Closure<ResourceComponentInjector>() {
- @Override
- public ResourceComponentInjector f() {
- return new ResourceComponentInjector(
- injectableFactory, scope, getAbstractResource(c));
- }
- });
-
- if (rci.hasInjectableArtifacts()) {
- cp = new ComponentProcessorImpl(rci);
- componentProcessorMap.put(c, cp);
- } else {
- cp = null;
- componentProcessorMap.put(c, NULL_COMPONENT_PROCESSOR);
- }
- }
- return cp;
- }
- }
-
- @Override
- public FeaturesAndProperties getFeaturesAndProperties() {
- return resourceConfig;
- }
-
- @Override
- public WebApplication clone() {
- WebApplicationImpl wa = new WebApplicationImpl();
- wa.initiate(resourceConfig, provider);
- return wa;
- }
-
- /* package */ UriRules<UriRule> getUriRules(final Class c) {
- assert c != null;
-
- // Try the non-blocking read, the most common operation
- UriRules<UriRule> r = rulesMap.get(c);
- if (r != null) {
- return r;
- }
-
- // Not present use a synchronized block to ensure that only one
- // instance is created and put to the map
- synchronized (abstractResourceMap) {
- // One or more threads may have been blocking on the synchronized
- // block, re-check the map
- r = rulesMap.get(c);
- if (r != null) {
- return r;
- }
-
- r = Errors.processWithErrors(new Errors.Closure<ResourceUriRules>() {
- @Override
- public ResourceUriRules f() {
- return newResourceUriRules(getAbstractResource(c));
- }
- }).getRules();
- rulesMap.put(c, r);
- }
- return r;
- }
-
- /* package */ ResourceComponentProvider getResourceComponentProvider(final Class c) {
- assert c != null;
-
- // Try the non-blocking read, the most common operation
- ResourceComponentProvider rcp = providerMap.get(c);
- if (rcp != null) {
- return rcp;
- }
-
- // Not present use a synchronized block to ensure that only one
- // instance is created and put to the map
- synchronized (abstractResourceMap) {
- // One or more threads may have been blocking on the synchronized
- // block, re-check the map
- rcp = providerMap.get(c);
- if (rcp != null) {
- return rcp;
- }
-
- final ResourceComponentProvider _rcp = rcp = rcpFactory.getComponentProvider(null, c);
- Errors.processWithErrors(new Errors.Closure<Void>() {
- @Override
- public Void f() {
- _rcp.init(getAbstractResource(c));
- return null;
- }
- });
-
- providerMap.put(c, rcp);
- }
- return rcp;
- }
-
- /* package */ ResourceComponentProvider getResourceComponentProvider(final ComponentContext cc, final Class c) {
- assert c != null;
-
- if (cc == null || cc.getAnnotations().length == 0)
- return getResourceComponentProvider(c);
-
- if (cc.getAnnotations().length == 1) {
- final Annotation a = cc.getAnnotations()[0];
- if (a.annotationType() == Inject.class) {
- final Inject i = Inject.class.cast(a);
- final String value = (i.value() != null)
- ? i.value().trim()
- : "";
- if (value.isEmpty())
- return getResourceComponentProvider(c);
- } else if (a.annotationType() == InjectParam.class) {
- final InjectParam i = InjectParam.class.cast(a);
- final String value = (i.value() != null)
- ? i.value().trim()
- : "";
- if (value.isEmpty())
- return getResourceComponentProvider(c);
- }
- }
-
- final ClassAnnotationKey cak = new ClassAnnotationKey(c,
- cc.getAnnotations());
-
- // Try the non-blocking read, the most common operation
- ResourceComponentProvider rcp = providerWithAnnotationKeyMap.get(cak);
- if (rcp != null) {
- return rcp;
- }
-
- // Not present use a synchronized block to ensure that only one
- // instance is created and put to the map
- synchronized (abstractResourceMap) {
- // One or more threads may have been blocking on the synchronized
- // block, re-check the map
- rcp = providerWithAnnotationKeyMap.get(cak);
- if (rcp != null) {
- return rcp;
- }
-
- final ResourceComponentProvider _rcp = rcp = rcpFactory.getComponentProvider(cc, c);
- Errors.processWithErrors(new Errors.Closure<Void>() {
- @Override
- public Void f() {
- _rcp.init(getAbstractResource(c));
- return null;
- }
- });
-
- providerWithAnnotationKeyMap.put(cak, rcp);
- }
- return rcp;
- }
-
- /* package */ void initiateResource(AbstractResource ar) {
- initiateResource(ar.getResourceClass());
- }
-
- /* package */ void initiateResource(Class c) {
- getUriRules(c);
- getResourceComponentProvider(c);
- }
-
- /* package */ void initiateResource(AbstractResource ar, final Object resource) {
- final Class c = ar.getResourceClass();
- getUriRules(c);
-
- if (!providerMap.containsKey(c)) {
- providerMap.put(c, new ResourceComponentProvider() {
- @Override
- public void init(AbstractResource abstractResource) {
- }
-
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Object getInstance(HttpContext hc) {
- return getInstance();
- }
-
- @Override
- public void destroy() {
- }
-
- @Override
- public Object getInstance() {
- return resource;
- }
- });
- }
- }
-
- /* package */ Set<AbstractResource> getAbstractRootResources() {
- return abstractRootResources;
- }
-
- /* package */ Map<String, AbstractResource> getExplicitAbstractRootResources() {
- return explicitAbstractRootResources;
- }
-
- private ResourceUriRules newResourceUriRules(final AbstractResource ar) {
- assert null != ar;
-
- BasicValidator validator = new BasicValidator();
- validator.validate(ar);
- for (ResourceModelIssue issue : validator.getIssueList()) {
- Errors.error(issue.getMessage(), issue.isFatal());
- }
- return new ResourceUriRules(
- resourceConfig,
- getDispatchProvider(),
- injectableFactory,
- filterFactory,
- wadlFactory,
- dispatchingListener,
- ar);
- }
-
- protected ResourceMethodDispatchProvider getDispatchProvider() {
- return dispatcherFactory;
- }
-
- @Override
- public RequestListener getRequestListener() {
- return requestListener;
- }
-
- @Override
- public DispatchingListener getDispatchingListener() {
- return dispatchingListener;
- }
-
- @Override
- public ResponseListener getResponseListener() {
- return responseListener;
- }
-
- /* package */ AbstractResource getAbstractResource(Object o) {
- return getAbstractResource(o.getClass());
- }
-
- /* package */ AbstractResource getAbstractResource(Class c) {
- AbstractResource ar = abstractResourceMap.get(c);
- if (ar == null) {
- ar = IntrospectionModeller.createResource(c);
- abstractResourceMap.put(c, ar);
- }
-
- return ar;
- }
-
- private static class ContextInjectableProvider<T> extends
- SingletonTypeInjectableProvider<Context, T> {
- ContextInjectableProvider(Type type, T instance) {
- super(type, instance);
- }
- }
-
- @Override
- public boolean isInitiated () {
- return initiated;
- }
-
- @Override
- public void initiate(ResourceConfig resourceConfig) {
- initiate(resourceConfig, null);
- }
-
- @Override
- public void initiate(final ResourceConfig rc, final IoCComponentProviderFactory _provider) {
- Errors.processWithErrors(new Errors.Closure<Void>() {
- @Override
- public Void f() {
- Errors.setReportMissingDependentFieldOrMethod(false);
- _initiate(rc, _provider);
- return null;
- }
- });
- }
-
- private void _initiate(final ResourceConfig rc, final IoCComponentProviderFactory _provider) {
- if (rc == null) {
- throw new IllegalArgumentException("ResourceConfig instance MUST NOT be null");
- }
-
- if (initiated) {
- throw new ContainerException(ImplMessages.WEB_APP_ALREADY_INITIATED());
- }
- this.initiated = true;
-
- LOGGER.info("Initiating Jersey application, version '" + BuildId.getBuildId() + "'");
-
- // If there are components defined in jaxrs-components then
- // wrap resource config with appended set of classes
- Class<?>[] components = ServiceFinder.find("jersey-server-components").toClassArray();
- if (components.length > 0) {
- if (LOGGER.isLoggable(Level.INFO)) {
- StringBuilder b = new StringBuilder();
- b.append("Adding the following classes declared in META-INF/services/jersey-server-components to the resource configuration:");
- for (Class c : components)
- b.append('\n').append(" ").append(c);
- LOGGER.log(Level.INFO, b.toString());
- }
-
- this.resourceConfig = rc.clone();
- this.resourceConfig.getClasses().addAll(Arrays.asList(components));
- } else {
- this.resourceConfig = rc;
- }
-
- this.provider = _provider;
-
- this.providerFactories = new ArrayList<IoCComponentProviderFactory>(2);
-
- for (Object o : resourceConfig.getProviderSingletons()) {
- if (o instanceof IoCComponentProviderFactory) {
- providerFactories.add((IoCComponentProviderFactory)o);
- }
- }
-
- if (_provider != null)
- providerFactories.add(_provider);
-
- // Set up the component provider factory to be
- // used with non-resource class components
- this.cpFactory = (providerFactories.isEmpty())
- ? new ProviderFactory(injectableFactory)
- : new IoCProviderFactory(injectableFactory, providerFactories);
-
- // Set up the resource component provider factory
- this.rcpFactory = (providerFactories.isEmpty())
- ? new ResourceFactory(this.resourceConfig, this.injectableFactory)
- : new IoCResourceFactory(this.resourceConfig, this.injectableFactory, providerFactories);
-
- // Initiate IoCComponentProcessorFactoryInitializer
- for (IoCComponentProviderFactory f : providerFactories) {
- IoCComponentProcessorFactory cpf;
- if (f instanceof IoCComponentProcessorFactoryInitializer) {
- cpf = new ComponentProcessorFactoryImpl();
- IoCComponentProcessorFactoryInitializer i = (IoCComponentProcessorFactoryInitializer)f;
- i.init(cpf);
- }
-
- }
-
- this.resourceContext = new ResourceContext() {
- @Override
- public ExtendedUriInfo matchUriInfo(URI u) throws ContainerException {
- try {
- return handleMatchResourceRequest(u);
- } catch (ContainerException ex) {
- throw ex;
- } catch (WebApplicationException ex) {
- if (ex.getResponse().getStatus() == 404) {
- return null;
- } else {
- throw new ContainerException(ex);
- }
- } catch (RuntimeException ex) {
- throw new ContainerException(ex);
- }
- }
-
- @Override
- public Object matchResource(URI u) throws ContainerException {
- ExtendedUriInfo ui = matchUriInfo(u);
- return (ui != null) ? ui.getMatchedResources().get(0) : null;
- }
-
- @Override
- public <T> T matchResource(URI u, Class<T> c) throws ContainerException, ClassCastException {
- return c.cast(matchResource(u));
- }
-
- @Override
- public <T> T getResource(Class<T> c) {
- return c.cast(getResourceComponentProvider(c).getInstance(context));
- }
- };
-
- final ProviderServices providerServices = new ProviderServices(
- ServerSide.class,
- this.cpFactory,
- resourceConfig.getProviderClasses(),
- resourceConfig.getProviderSingletons());
-
- injectableFactory.add(new ContextInjectableProvider<ProviderServices>(
- ProviderServices.class, providerServices));
-
- injectableFactory.add(new ContextInjectableProvider<ResourceMethodCustomInvokerDispatchFactory>(
- ResourceMethodCustomInvokerDispatchFactory.class, new ResourceMethodCustomInvokerDispatchFactory(providerServices)));
-
- // Add injectable provider for @ParentRef
- injectableFactory.add(
- new InjectableProvider<ParentRef, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- @Override
- public Injectable<Object> getInjectable(ComponentContext cc, ParentRef a, Type t) {
- if (!(t instanceof Class))
- return null;
-
- final Class target = ReflectionHelper.getDeclaringClass(cc.getAccesibleObject());
- final Class inject = (Class)t;
- return new Injectable<Object>() {
- @Override
- public Object getValue() {
- final UriInfo ui = context.getUriInfo();
- final List l = ui.getMatchedResources();
-
- final Object parent = getParent(l, target);
- if (parent == null) return null;
- try {
- return inject.cast(parent);
- } catch (ClassCastException ex) {
- throw new ContainerException(
- "The parent resource is expected to be of class " + inject.getName() +
- " but is of class " + parent.getClass().getName(),
- ex);
- }
- }
-
- private Object getParent(List l, Class target) {
- if (l.isEmpty()) {
- return null;
- } else if (l.size() == 1) {
- return (l.get(0).getClass() == target) ? null : l.get(0);
- } else {
- return (l.get(0).getClass() == target) ? l.get(1) : l.get(0);
- }
- }
- };
- }
-
-
- });
-
- // Add injectable provider for @Inject
-
- injectableFactory.add(
- new InjectableProvider<Inject, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- @Override
- public Injectable<Object> getInjectable(ComponentContext cc, Inject a, Type t) {
- if (!(t instanceof Class))
- return null;
-
- final ResourceComponentProvider rcp = getResourceComponentProvider(cc, (Class)t);
-
- return new Injectable<Object>() {
- @Override
- public Object getValue() {
- return rcp.getInstance(context);
- }
- };
- }
-
- });
-
- injectableFactory.add(
- new InjectableProvider<Inject, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Undefined;
- }
-
- @Override
- public Injectable<Object> getInjectable(ComponentContext cc, Inject a, Type t) {
- if (!(t instanceof Class))
- return null;
-
- final ResourceComponentProvider rcp = getResourceComponentProvider(cc, (Class)t);
- if (rcp.getScope() == ComponentScope.PerRequest)
- return null;
-
- return new Injectable<Object>() {
- @Override
- public Object getValue() {
- return rcp.getInstance(context);
- }
- };
- }
-
- });
-
- injectableFactory.add(
- new InjectableProvider<Inject, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<Object> getInjectable(ComponentContext cc, Inject a, Type t) {
- if (!(t instanceof Class))
- return null;
-
- final ResourceComponentProvider rcp = getResourceComponentProvider(cc, (Class)t);
- if (rcp.getScope() != ComponentScope.Singleton)
- return null;
-
- return new Injectable<Object>() {
- @Override
- public Object getValue() {
- return rcp.getInstance(context);
- }
- };
- }
-
- });
-
- // Add injectable provider for @ResourceRef
-
- injectableFactory.add(
- new InjectableProvider<InjectParam, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- @Override
- public Injectable<Object> getInjectable(ComponentContext cc, InjectParam a, Type t) {
- if (!(t instanceof Class))
- return null;
-
- final ResourceComponentProvider rcp = getResourceComponentProvider(cc, (Class)t);
-
- return new Injectable<Object>() {
- @Override
- public Object getValue() {
- return rcp.getInstance(context);
- }
- };
- }
-
- });
-
- injectableFactory.add(
- new InjectableProvider<InjectParam, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Undefined;
- }
-
- @Override
- public Injectable<Object> getInjectable(ComponentContext cc, InjectParam a, Type t) {
- if (!(t instanceof Class))
- return null;
-
- final ResourceComponentProvider rcp = getResourceComponentProvider(cc, (Class)t);
- if (rcp.getScope() == ComponentScope.PerRequest)
- return null;
-
- return new Injectable<Object>() {
- @Override
- public Object getValue() {
- return rcp.getInstance(context);
- }
- };
- }
-
- });
-
- injectableFactory.add(
- new InjectableProvider<InjectParam, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<Object> getInjectable(ComponentContext cc, InjectParam a, Type t) {
- if (!(t instanceof Class))
- return null;
-
- final ResourceComponentProvider rcp = getResourceComponentProvider(cc, (Class)t);
- if (rcp.getScope() != ComponentScope.Singleton)
- return null;
-
- return new Injectable<Object>() {
- @Override
- public Object getValue() {
- return rcp.getInstance(context);
- }
- };
- }
-
- });
-
- // Allow injection of features and properties
- injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(
- FeaturesAndProperties.class, resourceConfig));
-
- // Allow injection of resource config
- // Since the resourceConfig reference can change refer to the
- // reference directly.
- injectableFactory.add(
- new InjectableProvider<Context, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<ResourceConfig> getInjectable(ComponentContext cc, Context a, Type t) {
- if (t != ResourceConfig.class)
- return null;
- return new Injectable<ResourceConfig>() {
- @Override
- public ResourceConfig getValue() {
- return resourceConfig;
- }
- };
- }
- });
-
- // Allow injection of resource context
- injectableFactory.add(new ContextInjectableProvider<ResourceContext>(
- ResourceContext.class, resourceContext));
-
- // Configure the injectable factory with declared providers
- injectableFactory.configure(providerServices);
-
- boolean updateRequired = false;
-
- // Create application-declared Application instance as a component
- if (rc instanceof DeferredResourceConfig) {
- final DeferredResourceConfig drc = (DeferredResourceConfig)rc;
- // Check if resource config has already been cloned
- if (resourceConfig == drc)
- resourceConfig = drc.clone();
-
- final DeferredResourceConfig.ApplicationHolder da = drc.getApplication(cpFactory);
- resourceConfig.add(da.getApplication());
- updateRequired = true;
-
- injectableFactory.add(new ContextInjectableProvider<Application>(
- Application.class, da.getOriginalApplication()));
- } else {
- injectableFactory.add(new ContextInjectableProvider<FeaturesAndProperties>(
- Application.class, resourceConfig));
- }
-
- // Pipelined, decentralized configuration
- for(ResourceConfigurator configurator : providerServices.getProviders(ResourceConfigurator.class)) {
- configurator.configure(this.resourceConfig);
- updateRequired = true;
- }
-
- // Validate the resource config
- this.resourceConfig.validate();
-
- if (updateRequired) {
- // Check if application modified provider classes or singletons
- providerServices.update(resourceConfig.getProviderClasses(),
- resourceConfig.getProviderSingletons(), injectableFactory);
- }
-
- // Obtain all the templates
- this.templateContext = new TemplateFactory(providerServices);
- // Allow injection of template context
- injectableFactory.add(new ContextInjectableProvider<TemplateContext>(
- TemplateContext.class, templateContext));
-
- // Obtain all context resolvers
- final ContextResolverFactory crf = new ContextResolverFactory();
-
- // Obtain all the exception mappers
- this.exceptionFactory = new ExceptionMapperFactory();
-
- // Obtain all message body readers/writers
- this.bodyFactory = new MessageBodyFactory(providerServices,
- getFeaturesAndProperties().getFeature(FeaturesAndProperties.FEATURE_PRE_1_4_PROVIDER_PRECEDENCE));
- injectableFactory.add(
- new ContextInjectableProvider<MessageBodyWorkers>(
- MessageBodyWorkers.class, bodyFactory));
-
- // Injection of Providers
- this.providers = new Providers() {
- @Override
- public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> c, Type t,
- Annotation[] as, MediaType m) {
- return bodyFactory.getMessageBodyReader(c, t, as, m);
- }
-
- @Override
- public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> c, Type t,
- Annotation[] as, MediaType m) {
- return bodyFactory.getMessageBodyWriter(c, t, as, m);
- }
-
- @Override
- public <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> c) {
- if (Throwable.class.isAssignableFrom(c))
- return exceptionFactory.find(c);
- else
- return null;
- }
-
- @Override
- public <T> ContextResolver<T> getContextResolver(Class<T> ct, MediaType m) {
- return crf.resolve(ct, m);
- }
- };
- injectableFactory.add(
- new ContextInjectableProvider<Providers>(
- Providers.class, providers));
-
- // Obtain all String readers
- this.stringReaderFactory = new StringReaderFactory();
- injectableFactory.add(
- new ContextInjectableProvider<StringReaderWorkers>(
- StringReaderWorkers.class, stringReaderFactory));
-
- MultivaluedParameterExtractorProvider mpep =
- new MultivaluedParameterExtractorFactory(stringReaderFactory);
- // Add the multi-valued parameter extractor provider
- injectableFactory.add(
- new ContextInjectableProvider<MultivaluedParameterExtractorProvider>(
- MultivaluedParameterExtractorProvider.class, mpep));
-
- // Add per-request-based injectable providers
- injectableFactory.add(new CookieParamInjectableProvider(mpep));
- injectableFactory.add(new HeaderParamInjectableProvider(mpep));
- injectableFactory.add(new HttpContextInjectableProvider());
- injectableFactory.add(new MatrixParamInjectableProvider(mpep));
- injectableFactory.add(new PathParamInjectableProvider(mpep));
- injectableFactory.add(new QueryParamInjectableProvider(mpep));
- injectableFactory.add(new FormParamInjectableProvider(mpep));
-
- // Create filter factory
- filterFactory = new FilterFactory(providerServices);
-
- // Initiate resource method dispatchers
- dispatcherFactory = ResourceMethodDispatcherFactory.create(providerServices);
-
- dispatchingListener = new DispatchingListenerProxy();
-
- // Initiate the WADL factory
- this.wadlFactory = new WadlFactory(resourceConfig);
-
- // Initiate filter
- filterFactory.init(resourceConfig);
- if (!resourceConfig.getMediaTypeMappings().isEmpty() ||
- !resourceConfig.getLanguageMappings().isEmpty()) {
- boolean present = false;
- for (ContainerRequestFilter f : filterFactory.getRequestFilters()) {
- present |= f instanceof UriConnegFilter;
- }
-
- if (!present) {
- filterFactory.getRequestFilters().add(new UriConnegFilter(
- resourceConfig.getMediaTypeMappings(),
- resourceConfig.getLanguageMappings()));
- } else {
- LOGGER.warning("The media type and language mappings " +
- "declared in the ResourceConfig are ignored because " +
- "there is an instance of " + UriConnegFilter.class.getName() +
- "present in the list of request filters.");
- }
- }
-
- // Initiate context resolvers
- crf.init(providerServices, injectableFactory);
-
- // Initiate the exception mappers
- exceptionFactory.init(providerServices);
-
- // Initiate message body readers/writers
- bodyFactory.init();
-
- // Initiate string readers
- stringReaderFactory.init(providerServices);
-
- // Inject on all components
- Errors.setReportMissingDependentFieldOrMethod(true);
- cpFactory.injectOnAllComponents();
- cpFactory.injectOnProviderInstances(resourceConfig.getProviderSingletons());
-
- // web application is ready
- for (IoCComponentProviderFactory providerFactory : providerFactories) {
- if (providerFactory instanceof WebApplicationListener) {
- WebApplicationListener listener = (WebApplicationListener) providerFactory;
- listener.onWebApplicationReady();
- }
- }
-
- createAbstractResourceModelStructures();
-
- // Obtain all root resource rules
- RulesMap<UriRule> rootRules = new RootResourceUriRules(this,
- resourceConfig, wadlFactory, injectableFactory).getRules();
- this.rootsRule = new RootResourceClassesRule(rootRules);
-
- requestListener = MonitoringProviderFactory.createRequestListener(providerServices);
- responseListener = MonitoringProviderFactory.createResponseListener(providerServices);
- dispatchingListener.init(providerServices);
-
- callAbstractResourceModelListenersOnLoaded(providerServices);
-
- this.isTraceEnabled = resourceConfig.getFeature(ResourceConfig.FEATURE_TRACE) |
- resourceConfig.getFeature(ResourceConfig.FEATURE_TRACE_PER_REQUEST);
- }
-
- @Override
- public Providers getProviders() {
- return providers;
- }
-
- @Override
- public MessageBodyWorkers getMessageBodyWorkers() {
- return bodyFactory;
- }
-
- @Override
- public ExceptionMapperContext getExceptionMapperContext() {
- return exceptionFactory;
- }
-
- @Override
- public ServerInjectableProviderFactory getServerInjectableProviderFactory() {
- return injectableFactory;
- }
-
- @Override
- public void handleRequest(ContainerRequest request, ContainerResponseWriter responseWriter)
- throws IOException {
- final ContainerResponse response = new ContainerResponse(
- this,
- request,
- responseWriter);
- handleRequest(request, response);
- }
-
- @Override
- public void handleRequest(ContainerRequest request, ContainerResponse response) throws IOException {
- final WebApplicationContext localContext = new
- WebApplicationContext(this, request, response);
-
- context.set(localContext);
- try {
- _handleRequest(localContext, request, response);
- } finally {
- PerRequestFactory.destroy(localContext);
- closeableFactory.close(localContext);
- context.set(null);
- }
- }
-
- private WebApplicationContext handleMatchResourceRequest(URI u) {
- final WebApplicationContext oldContext = (WebApplicationContext)context.get();
-
- final WebApplicationContext newContext = oldContext.createMatchResourceContext(u);
-
- context.set(newContext);
- try {
- _handleRequest(newContext, newContext.getContainerRequest());
- return newContext;
- } finally {
- context.set(oldContext);
- }
- }
-
- @Override
- public void destroy() {
- for (ResourceComponentProvider rcp : providerMap.values()) {
- rcp.destroy();
- }
-
- for (ResourceComponentProvider rcp : providerWithAnnotationKeyMap.values()) {
- rcp.destroy();
- }
-
- cpFactory.destroy();
- }
-
- // Traceable
-
- @Override
- public boolean isTracingEnabled() {
- return isTraceEnabled;
- }
-
- @Override
- public void trace(String message) {
- context.get().trace(message);
- }
-
- private void _handleRequest(final WebApplicationContext localContext,
- ContainerRequest request, ContainerResponse response) throws IOException {
- try {
- requestListener.onRequest(Thread.currentThread().getId(), request);
- _handleRequest(localContext, request);
- } catch (WebApplicationException e) {
- response.mapWebApplicationException(e);
- } catch (MappableContainerException e) {
- response.mapMappableContainerException(e);
- } catch (RuntimeException e) {
- if (!response.mapException(e)) {
- LOGGER.log(Level.SEVERE, "The RuntimeException could not be mapped to a response, " +
- "re-throwing to the HTTP container", e);
- throw e;
- }
- }
-
- try {
- // Process response filters from resources
- for (ContainerResponseFilter f : localContext.getResponseFilters()) {
- response = f.filter(request, response);
- localContext.setContainerResponse(response);
- }
-
- for (ContainerResponseFilter f : filterFactory.getResponseFilters()) {
- response = f.filter(request, response);
- localContext.setContainerResponse(response);
- }
- } catch (WebApplicationException e) {
- response.mapWebApplicationException(e);
- } catch (MappableContainerException e) {
- response.mapMappableContainerException(e);
- } catch (RuntimeException e) {
- if (!response.mapException(e)) {
- LOGGER.log(Level.SEVERE, "The RuntimeException could not be mapped to a response, " +
- "re-throwing to the HTTP container", e);
- throw e;
- }
- }
-
- try {
- response.write();
- responseListener.onResponse(Thread.currentThread().getId(), response);
- } catch (WebApplicationException e) {
- if (response.isCommitted()) {
- LOGGER.log(Level.SEVERE, "The response of the WebApplicationException cannot be utilized " +
- "as the response is already committed. Re-throwing to the HTTP container", e);
- throw e;
- } else {
- response.mapWebApplicationException(e);
- response.write();
- }
- }
- }
-
- private void _handleRequest(final WebApplicationContext localContext,
- ContainerRequest request) {
- for (ContainerRequestFilter f : filterFactory.getRequestFilters()) {
- request = f.filter(request);
- localContext.setContainerRequest(request);
- }
-
- /**
- * The matching algorithm currently works from an absolute path.
- * The path is required to be in encoded form.
- */
- StringBuilder path = new StringBuilder();
- path.append("/").append(request.getPath(false));
-
- if (!resourceConfig.getFeature(ResourceConfig.FEATURE_MATCH_MATRIX_PARAMS)) {
- path = stripMatrixParams(path);
- }
-
- if (!rootsRule.accept(path, null, localContext)) {
- throw new NotFoundException(request.getRequestUri());
- }
- }
-
- @Override
- public HttpContext getThreadLocalHttpContext() {
- return context;
- }
-
- /**
- * Strip the matrix parameters from a path
- */
- private StringBuilder stripMatrixParams(StringBuilder path) {
- int e = path.indexOf(";");
- if (e == -1) {
- return path;
- }
-
- int s = 0;
- StringBuilder sb = new StringBuilder();
- do {
- // Append everything up to but not including the ';'
- sb.append(path, s, e);
-
- // Skip everything up to but not including the '/'
- s = path.indexOf("/", e + 1);
- if (s == -1) {
- break;
- }
- e = path.indexOf(";", s);
- } while (e != -1);
-
- if (s != -1) {
- // Append any remaining characters
- sb.append(path, s, path.length());
- }
-
- return sb;
- }
-
-
- private void createAbstractResourceModelStructures() {
-
- final Set<AbstractResource> rootARs = new HashSet<AbstractResource>();
-
- // Add declared singleton instances of root resource classes
- for (final Object o : resourceConfig.getRootResourceSingletons()) {
- rootARs.add(getAbstractResource(o));
- }
-
- // Add declared root resource classes
- for (final Class<?> c : resourceConfig.getRootResourceClasses()) {
- rootARs.add(getAbstractResource(c));
- }
-
- // Add explicit declared root resource classes
- final Map<String, AbstractResource> explicitRootARs =
- new HashMap<String, AbstractResource>();
- for (final Map.Entry<String, Object> e : resourceConfig.getExplicitRootResources().entrySet()) {
- final Object o = e.getValue();
- final Class c = (o instanceof Class) ? (Class)o : o.getClass();
-
- final AbstractResource ar = new AbstractResource(e.getKey(),
- getAbstractResource(c));
-
- rootARs.add(ar);
- explicitRootARs.put(e.getKey(), ar);
- }
-
- abstractRootResources = Collections.unmodifiableSet(rootARs);
- explicitAbstractRootResources = Collections.unmodifiableMap(explicitRootARs);
- }
-
- private void callAbstractResourceModelListenersOnLoaded(ProviderServices providerServices) {
- for (AbstractResourceModelListener aml : providerServices.getProviders(AbstractResourceModelListener.class)) {
- aml.onLoaded(armContext);
- }
- }
-
- private <T> T createProxy(Class<T> c, InvocationHandler i) {
- return c.cast(Proxy.newProxyInstance(
- this.getClass().getClassLoader(),
- new Class[]{c},
- i));
- }
-
- private class DispatchingListenerProxy implements DispatchingListener {
- private DispatchingListener dispatchingListener;
-
- @Override
- public void onSubResource(long id, Class subResource) {
- dispatchingListener.onSubResource(id, subResource);
- }
-
- @Override
- public void onSubResourceLocator(long id, AbstractSubResourceLocator locator) {
- dispatchingListener.onSubResourceLocator(id, locator);
- }
-
- @Override
- public void onResourceMethod(long id, AbstractResourceMethod method) {
- dispatchingListener.onResourceMethod(id, method);
- }
-
- public void init(final ProviderServices providerServices) {
- dispatchingListener = MonitoringProviderFactory.createDispatchingListener(providerServices);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/build.properties b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/build.properties
deleted file mode 100644
index 68b28a286ca..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/build.properties
+++ /dev/null
@@ -1 +0,0 @@
-Build-Id: ${project.version} ${buildNumber} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AbstractBean.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AbstractBean.java
deleted file mode 100644
index 8bdc38b147b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AbstractBean.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.InjectionPoint;
-
-/**
- * Base class implementing the CDI Bean interface.
- *
- * Subclasses must implement the create method.
- *
- * Currently, AbstractBean only supports a single qualifier and a single bean type,
- * although it could easily be extended to support more.
- *
- * @author robc
- */
-public abstract class AbstractBean<T> implements Bean<T> {
-
- private Class<?> klass;
- private Set<Annotation> qualifiers;
- private Set<Type> types;
-
- public AbstractBean(Class<?> klass, Annotation qualifier) {
- this(klass, klass, qualifier);
- }
-
- public AbstractBean(Class<?> klass, Set<Annotation> qualifiers) {
- this(klass, klass, qualifiers);
- }
-
-
- public AbstractBean(Class<?> klass, Type type, Annotation qualifier) {
- this.klass = klass;
-
- qualifiers = new HashSet<Annotation>();
- qualifiers.add(qualifier);
- types = new HashSet<Type>();
- types.add(type);
- }
-
- public AbstractBean(Class<?> klass, Type type, Set<Annotation> qualifiers) {
- this.klass = klass;
- this.qualifiers = qualifiers;
- types = new HashSet<Type>();
- types.add(type);
- }
-
- public Class<?> getBeanClass() {
- return klass;
- }
-
- public Set<InjectionPoint> getInjectionPoints() {
- return (Set<InjectionPoint>)Collections.EMPTY_SET;
- }
-
- public String getName() {
- return null;
- }
-
- public Set<Annotation> getQualifiers() {
- return qualifiers;
- }
-
- public Class<? extends Annotation> getScope() {
- return Dependent.class;
- }
-
- public Set<Class<? extends Annotation>> getStereotypes() {
- return (Set<Class<? extends Annotation>>)Collections.EMPTY_SET;
- }
-
- public Set<Type> getTypes() {
- return types;
- }
-
- public boolean isAlternative() {
- return false;
- }
-
- public boolean isNullable() {
- return false;
- }
-
- public abstract T create(CreationalContext<T> creationalContext);
-
- public void destroy(T instance, CreationalContext<T> creationalContext) {
- // no-op
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.java
deleted file mode 100644
index 8eeaf0af613..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Set;
-import javax.enterprise.inject.spi.AnnotatedCallable;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-/**
- * Implements the CDI AnnotatedCallable interface.
- *
- * @author robc
- */
-public class AnnotatedCallableImpl<T> extends AnnotatedMemberImpl<T> implements AnnotatedCallable<T> {
-
- private List<AnnotatedParameter<T>> parameters;
-
- public AnnotatedCallableImpl(Type baseType,
- Set<Type> typeClosure,
- Set<Annotation> annotations,
- AnnotatedType<T> declaringType,
- Member javaMember,
- boolean isStatic) {
- super(baseType, typeClosure, annotations, declaringType, javaMember, isStatic);
- }
-
- public List<AnnotatedParameter<T>> getParameters() {
- return parameters;
- }
-
- public void setParameters(List<AnnotatedParameter<T>> parameters) {
- this.parameters = parameters;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.java
deleted file mode 100644
index 8f0e4af28a8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Type;
-import java.util.Set;
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-/**
- * Implements the CDI AnnotatedConstructor interface.
- *
- * @author robc
- */
-public class AnnotatedConstructorImpl<T> extends AnnotatedCallableImpl<T> implements AnnotatedConstructor<T> {
-
- private Constructor<T> javaMember;
-
- public AnnotatedConstructorImpl(Type baseType,
- Set<Type> typeClosure,
- Set<Annotation> annotations,
- AnnotatedType<T> declaringType,
- Constructor javaMember,
- boolean isStatic) {
- super(baseType, typeClosure, annotations, declaringType, javaMember, isStatic);
- this.javaMember = javaMember;
- }
-
- public AnnotatedConstructorImpl(AnnotatedConstructor<T> constructor, AnnotatedType<T> declaringType) {
- this(constructor.getBaseType(),
- constructor.getTypeClosure(),
- constructor.getAnnotations(),
- declaringType,
- constructor.getJavaMember(),
- constructor.isStatic());
- }
-
- @Override
- public Constructor<T> getJavaMember() {
- return javaMember;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.java
deleted file mode 100644
index 8e6c89d4e11..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Type;
-import java.util.Set;
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-/**
- * Implements the CDI AnnotatedField interface.
- *
- * @author robc
- */
-public class AnnotatedFieldImpl<T> extends AnnotatedMemberImpl<T> implements AnnotatedField<T> {
-
- private Field javaMember;
-
- public AnnotatedFieldImpl(Type baseType,
- Set<Type> typeClosure,
- Set<Annotation> annotations,
- AnnotatedType<T> declaringType,
- Field javaMember,
- boolean isStatic) {
- super(baseType, typeClosure, annotations, declaringType, javaMember, isStatic);
- this.javaMember = javaMember;
- }
-
- public AnnotatedFieldImpl(AnnotatedField<? super T> field, AnnotatedType<T> declaringType) {
- this(field.getBaseType(),
- field.getTypeClosure(),
- field.getAnnotations(),
- declaringType,
- field.getJavaMember(),
- field.isStatic());
- }
-
- public AnnotatedFieldImpl(AnnotatedField<? super T> field, Set<Annotation> annotations, AnnotatedType<T> declaringType) {
- this(field.getBaseType(),
- field.getTypeClosure(),
- annotations,
- declaringType,
- field.getJavaMember(),
- field.isStatic());
- }
-
- @Override
- public Field getJavaMember() {
- return javaMember;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedImpl.java
deleted file mode 100644
index 82a204624d2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedImpl.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.Set;
-import javax.enterprise.inject.spi.Annotated;
-
-/**
- * Implements the CDI Annotated interface.
- *
- * @author robc
- */
-public class AnnotatedImpl implements Annotated {
-
- private Type baseType;
- private Set<Type> typeClosure;
- private Set<Annotation> annotations;
-
- public AnnotatedImpl(Type baseType, Set<Type> typeClosure, Set<Annotation> annotations) {
- this.baseType = baseType;
- this.typeClosure = Collections.unmodifiableSet(typeClosure);
- this.annotations = Collections.unmodifiableSet(annotations);
- }
-
- public <T extends Annotation> T getAnnotation(java.lang.Class<T> annotationType) {
- for (Annotation a : annotations) {
- if (annotationType.isInstance(a)) {
- return annotationType.cast(a);
- }
- }
- return null;
- }
-
- public Set<Annotation> getAnnotations() {
- return annotations;
- }
-
-
-
- public Type getBaseType() {
- return baseType;
- }
-
- public Set<Type> getTypeClosure() {
- return typeClosure;
- }
-
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
- return getAnnotation(annotationType) != null;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.java
deleted file mode 100644
index 1be319cd367..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-import java.util.Set;
-import javax.enterprise.inject.spi.AnnotatedMember;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-/**
- * Implements the CDI AnnotatedMember interface.
- *
- * @author robc
- */
-public class AnnotatedMemberImpl<T> extends AnnotatedImpl implements AnnotatedMember<T> {
-
- private AnnotatedType<T> declaringType;
- private Member javaMember;
- private boolean isStatic;
-
- public AnnotatedMemberImpl(Type baseType,
- Set<Type> typeClosure,
- Set<Annotation> annotations,
- AnnotatedType<T> declaringType,
- Member javaMember,
- boolean isStatic) {
- super(baseType, typeClosure, annotations);
- this.declaringType = declaringType;
- this.javaMember = javaMember;
- this.isStatic = isStatic;
- }
-
- public AnnotatedType<T> getDeclaringType() {
- return declaringType;
- }
-
- public Member getJavaMember() {
- return javaMember;
- }
-
- public boolean isStatic() {
- return isStatic;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.java
deleted file mode 100644
index 7c4f70bb3c2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Set;
-import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-/**
- * Implements the CDI AnnotatedMethod interface.
- *
- * @author robc
- */
-public class AnnotatedMethodImpl<T> extends AnnotatedCallableImpl<T> implements AnnotatedMethod<T> {
-
- private Method javaMember;
-
- public AnnotatedMethodImpl(Type baseType,
- Set<Type> typeClosure,
- Set<Annotation> annotations,
- AnnotatedType<T> declaringType,
- Method javaMember,
- boolean isStatic) {
- super(baseType, typeClosure, annotations, declaringType, javaMember, isStatic);
- this.javaMember = javaMember;
- }
-
- public AnnotatedMethodImpl(AnnotatedMethod<? super T> method, AnnotatedType<T> declaringType) {
- this(method.getBaseType(),
- method.getTypeClosure(),
- method.getAnnotations(),
- declaringType,
- method.getJavaMember(),
- method.isStatic());
- }
-
- public AnnotatedMethodImpl(AnnotatedMethod<? super T> method, Set<Annotation> annotations, AnnotatedType<T> declaringType) {
- this(method.getBaseType(),
- method.getTypeClosure(),
- annotations,
- declaringType,
- method.getJavaMember(),
- method.isStatic());
- }
-
- @Override
- public Method getJavaMember() {
- return javaMember;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.java
deleted file mode 100644
index 5aaa103afe5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-import javax.enterprise.inject.spi.AnnotatedCallable;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-/**
- * Implements the CDI AnnotatedParameter interface.
- *
- * @author robc
- */
-public class AnnotatedParameterImpl<T> extends AnnotatedImpl implements AnnotatedParameter<T> {
-
- private AnnotatedCallable<T> declaringCallable;
- private int position;
-
- public AnnotatedParameterImpl(Type baseType,
- Set<Type> typeClosure,
- Set<Annotation> annotations,
- AnnotatedCallable<T> declaringCallable,
- int position) {
- super(baseType, typeClosure, annotations);
- this.declaringCallable = declaringCallable;
- this.position = position;
- }
-
- public AnnotatedParameterImpl(AnnotatedParameter<? super T> param, AnnotatedCallable<T> declaringCallable) {
- this(param.getBaseType(),
- param.getTypeClosure(),
- param.getAnnotations(),
- declaringCallable,
- param.getPosition());
- }
-
- public AnnotatedParameterImpl(AnnotatedParameter<? super T> param, Set<Annotation> annotations, AnnotatedCallable<T> declaringCallable) {
- this(param.getBaseType(),
- param.getTypeClosure(),
- annotations,
- declaringCallable,
- param.getPosition());
- }
-
- public AnnotatedCallable<T> getDeclaringCallable() {
- return declaringCallable;
- }
-
- public int getPosition() {
- return position;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.java
deleted file mode 100644
index bda79b9fc21..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-/**
- * Implements the CDI AnnotatedType interface.
- *
- * @author robc
- */
-public class AnnotatedTypeImpl<T> extends AnnotatedImpl implements AnnotatedType<T> {
-
- private Set<AnnotatedConstructor<T>> constructors;
- private Set<AnnotatedField<? super T>> fields;
- private Class<T> javaClass;
- private Set<AnnotatedMethod<? super T>> methods;
-
- public AnnotatedTypeImpl(Type baseType,
- Set<Type> typeClosure,
- Set<Annotation> annotations,
- Class<T> javaClass) {
- super(baseType, typeClosure, annotations);
- this.javaClass = javaClass;
- }
-
- public AnnotatedTypeImpl(AnnotatedType type) {
- this(type.getBaseType(), type.getTypeClosure(), type.getAnnotations(), type.getJavaClass());
- }
-
- public Set<AnnotatedConstructor<T>> getConstructors() {
- return constructors;
- }
-
- public void setConstructors(Set<AnnotatedConstructor<T>> constructors) {
- this.constructors = constructors;
- }
-
- public Set<AnnotatedField<? super T>> getFields() {
- return fields;
- }
-
- public void setFields(Set<AnnotatedField<? super T>> fields) {
- this.fields = fields;
- }
-
- public Class<T> getJavaClass() {
- return javaClass;
- }
-
- public Set<AnnotatedMethod<? super T>> getMethods() {
- return methods;
- }
-
- public void setMethods(Set<AnnotatedMethod<? super T>> methods) {
- this.methods = methods;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/BeanGenerator.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/BeanGenerator.java
deleted file mode 100644
index d22367e218e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/BeanGenerator.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.objectweb.asm.ClassWriter;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-
-/**
- * Generates any number of plain bean classes on the fly, loading them with
- * the thread context class loader.
- *
- * Generated bean classes have a single, public, no-arg constructor.
- *
- * @author robc
- */
-public class BeanGenerator {
-
- private static final Logger LOGGER = Logger.getLogger(CDIExtension.class.getName());
- private String prefix;
- private Method defineClassMethod;
- private int generatedClassCounter = 0;
-
- BeanGenerator(String prefix) {
- this.prefix = prefix;
-
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- try {
- defineClassMethod =
- AccessController.doPrivileged(new PrivilegedExceptionAction<Method>(){
- public Method run() throws Exception{
- Class classLoaderClass = Class.forName("java.lang.ClassLoader");
- Method method = classLoaderClass.getDeclaredMethod(
- "defineClass",
- new Class[] { String.class, byte[].class, int.class, int.class });
- method.setAccessible(true);
- return method;
- }
- });
- }
- catch (PrivilegedActionException e) {
- LOGGER.log(Level.SEVERE, "failed to access method ClassLoader.defineClass", e);
- // TODO - wrapping and rethrowing for now
- throw new RuntimeException(e);
- }
- }
-
- Class<?> createBeanClass() {
- ClassWriter writer = new ClassWriter(0);
- String name = prefix + Integer.toString(generatedClassCounter++);
- writer.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC, name, null, "java/lang/Object", null);
- MethodVisitor methodVisitor = writer.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
- methodVisitor.visitCode();
- methodVisitor.visitVarInsn(Opcodes.ALOAD, 0);
- methodVisitor.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
- methodVisitor.visitInsn(Opcodes.RETURN);
- methodVisitor.visitMaxs(1,1);
- methodVisitor.visitEnd();
- writer.visitEnd();
- byte[] bytecode = writer.toByteArray();
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- try {
- Class<?> result = (Class<?>) defineClassMethod.invoke(classLoader, name.replace("/","."), bytecode, 0, bytecode.length);
- LOGGER.fine("Created class " + result.getName());
- return result;
- }
- catch (Throwable t) {
- LOGGER.log(Level.SEVERE, "error calling ClassLoader.defineClass", t);
- return null;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.java
deleted file mode 100644
index 6fa1eeddcb6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.cdi;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCDestroyable;
-import com.sun.jersey.core.spi.component.ioc.IoCFullyManagedComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCInstantiatedComponentProvider;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.container.WebApplicationListener;
-import java.lang.annotation.Annotation;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-import javax.annotation.ManagedBean;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.RequestScoped;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import static com.sun.jersey.server.impl.cdi.Utils.getBean;
-
-/**
- * Factory for IoCComponentProvider for CDI beans.
- *
- * Crucially, it passes the WebApplication and ResourceConfig on to the CDIExtension,
- * allowing beans registered by the extension to (finally) do some work.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author robc
- */
-public class CDIComponentProviderFactory implements
- IoCComponentProviderFactory, WebApplicationListener {
-
- private static final Logger LOGGER = Logger.getLogger(
- CDIComponentProviderFactory.class.getName());
-
- private final BeanManager beanManager;
- private final CDIExtension extension;
-
- public CDIComponentProviderFactory(Object bm, ResourceConfig rc, WebApplication wa) {
- beanManager = (BeanManager)bm;
- // work around proxying bug in Weld
- if (CDIExtension.lookupExtensionInBeanManager) {
- extension = Utils.getInstance(beanManager, CDIExtension.class);
- }
- else {
- extension = CDIExtension.getInitializedExtension();
- }
- extension.setWebApplication(wa);
- extension.setResourceConfig(rc);
- }
-
- public void onWebApplicationReady() {
- extension.lateInitialize();
- }
-
- public IoCComponentProvider getComponentProvider(Class<?> c) {
- return getComponentProvider(null, c);
- }
-
- public IoCComponentProvider getComponentProvider(ComponentContext cc, final Class<?> c) {
- final Bean<?> b = getBean(beanManager, c);
- if (b == null) {
- return null;
- }
-
- final Class<? extends Annotation> s = b.getScope();
- final ComponentScope cs = getComponentScope(b);
-
- if (s == Dependent.class) {
- if (!c.isAnnotationPresent(ManagedBean.class)) {
- return null;
- }
-
- LOGGER.fine("Binding the CDI managed bean " + c.getName() +
- " in scope " + s.getName() +
- " to CDIComponentProviderFactory");
-
- return new ComponentProviderDestroyable() {
-
- // IoCInstantiatedComponentProvider
-
- public Object getInjectableInstance(Object o) {
- return o;
- }
-
- public Object getInstance() {
- final CreationalContext<?> bcc = beanManager.createCreationalContext(b);
- return c.cast(beanManager.getReference(b, c, bcc));
- }
-
- // IoCDestroyable
-
- public void destroy(Object o) {
- final CreationalContext cc = beanManager.createCreationalContext(b);
- ((Bean)b).destroy(o, cc);
- }
- };
- }
- else {
- LOGGER.fine("Binding the CDI managed bean " + c.getName() +
- " in scope " + s.getName() +
- " to CDIComponentProviderFactory in scope " + cs);
-
- return new IoCFullyManagedComponentProvider() {
- public ComponentScope getScope() {
- return cs;
- }
-
- public Object getInstance() {
- final CreationalContext<?> bcc = beanManager.createCreationalContext(b);
- return c.cast(beanManager.getReference(b, c, bcc));
- }
- };
- }
- }
-
- private interface ComponentProviderDestroyable extends IoCInstantiatedComponentProvider, IoCDestroyable {
- };
-
- private ComponentScope getComponentScope(Bean<?> b) {
- ComponentScope cs = scopeMap.get(b.getScope());
- return (cs != null) ? cs : ComponentScope.Undefined;
- }
-
- private final Map<Class<? extends Annotation>, ComponentScope> scopeMap = createScopeMap();
-
- private Map<Class<? extends Annotation>, ComponentScope> createScopeMap() {
- Map<Class<? extends Annotation>, ComponentScope> m =
- new HashMap<Class<? extends Annotation>, ComponentScope>();
- m.put(ApplicationScoped.class, ComponentScope.Singleton);
- m.put(RequestScoped.class, ComponentScope.PerRequest);
- m.put(Dependent.class, ComponentScope.PerRequest);
- return Collections.unmodifiableMap(m);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.java
deleted file mode 100644
index d9ca39e8086..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.cdi;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.server.impl.InitialContextHelper;
-import com.sun.jersey.spi.container.WebApplication;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * Initializes the factory for IoCComponentProvider(s) for CDI beans.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author robc
- */
-public class CDIComponentProviderFactoryInitializer {
-
- private static final Logger LOGGER = Logger.getLogger(
- CDIComponentProviderFactoryInitializer.class.getName());
-
- public static void initialize(ResourceConfig rc, WebApplication wa) {
- try {
- InitialContext ic = InitialContextHelper.getInitialContext();
- if (ic == null)
- return;
- Object beanManager = ic.lookup("java:comp/BeanManager");
- // Some implementations of InitialContext return null instead of
- // throwing NamingException if there is no Object associated with
- // the name
- if (beanManager == null) {
- LOGGER.config("The CDI BeanManager is not available. JAX-RS CDI support is disabled.");
- return;
- }
-
- rc.getSingletons().add(new CDIComponentProviderFactory(beanManager, rc, wa));
- LOGGER.info("CDI support is enabled");
-
- } catch (NamingException ex) {
- LOGGER.log(Level.CONFIG, "The CDI BeanManager is not available. JAX-RS CDI support is disabled.", ex);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIExtension.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIExtension.java
deleted file mode 100644
index d57607a6f8f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/CDIExtension.java
+++ /dev/null
@@ -1,995 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import com.sun.jersey.api.core.ExtendedUriInfo;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.core.ResourceContext;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import com.sun.jersey.server.impl.InitialContextHelper;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import com.sun.jersey.spi.container.ExceptionMapperContext;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.inject.Errors;
-import com.sun.jersey.spi.inject.Injectable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Array;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.AnnotatedCallable;
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import javax.enterprise.inject.spi.Extension;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.ProcessAnnotatedType;
-import javax.enterprise.inject.spi.ProcessInjectionTarget;
-import javax.enterprise.inject.spi.ProcessManagedBean;
-import javax.enterprise.util.AnnotationLiteral;
-import javax.inject.Inject;
-import javax.inject.Provider;
-import javax.naming.InitialContext;
-import javax.naming.Name;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.Encoded;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Request;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.ext.Providers;
-/**
- *
- * @author robc
- */
-public class CDIExtension implements Extension {
-
- private static final Logger LOGGER = Logger.getLogger(CDIExtension.class.getName());
-
- private static class ContextAnnotationLiteral extends AnnotationLiteral<Context> implements Context {};
- private final Context contextAnnotationLiteral = new ContextAnnotationLiteral();
-
- private static class InjectAnnotationLiteral extends AnnotationLiteral<Inject> implements Inject {};
- private final Inject injectAnnotationLiteral = new InjectAnnotationLiteral();
-
- private static class SyntheticQualifierAnnotationImpl extends AnnotationLiteral<SyntheticQualifier> implements SyntheticQualifier {
- private int value;
-
- public SyntheticQualifierAnnotationImpl(int value) {
- this.value = value;
- }
-
- public int value() {
- return value;
- }
- }
-
- private WebApplication webApplication;
- private ResourceConfig resourceConfig;
- private Set<Class<? extends Annotation>> knownParameterQualifiers;
- private Set<Class<?>> staticallyDefinedContextBeans;
- private Map<Class<? extends Annotation>, Parameter.Source> paramQualifiersMap;
-
- private Map<Class<? extends Annotation>, Set<DiscoveredParameter>> discoveredParameterMap;
- private Map<DiscoveredParameter, SyntheticQualifier> syntheticQualifierMap;
- private int nextSyntheticQualifierValue = 0;
-
- private List<InitializedLater> toBeInitializedLater;
-
- private static String JNDI_CDIEXTENSION_NAME = "CDIExtension";
- private static String JNDI_CDIEXTENSION_CTX = "com/sun/jersey/config";
-
- /*
- * Setting this system property to "true" will force use of the BeanManager to look up the bean for the active CDIExtension,
- * rather than going through a thread local.
- */
- private static final String LOOKUP_EXTENSION_IN_BEAN_MANAGER_SYSTEM_PROPERTY = "com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager";
-
- public static final boolean lookupExtensionInBeanManager = getLookupExtensionInBeanManager();
-
- private static boolean getLookupExtensionInBeanManager() {
- return Boolean.parseBoolean(System.getProperty(LOOKUP_EXTENSION_IN_BEAN_MANAGER_SYSTEM_PROPERTY, "false"));
- }
-
- /*
- * Returns the instance of CDIExtension that was initialized previously in this same thread, if any.
- */
- public static CDIExtension getInitializedExtension() {
- try {
- InitialContext ic = InitialContextHelper.getInitialContext();
- if (ic == null) {
- throw new RuntimeException();
- }
- return (CDIExtension)lookupJerseyConfigJNDIContext(ic).lookup(JNDI_CDIEXTENSION_NAME);
- } catch (NamingException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- public CDIExtension() {}
-
- private void initialize(BeanManager manager) {
- // initialize in a separate method because Weld creates a proxy for the extension
- // and we don't want to waste time initializing it
-
- // workaround for Weld proxy bug
- if (!lookupExtensionInBeanManager) {
- try {
- InitialContext ic = InitialContextHelper.getInitialContext();
- if (ic != null) {
- javax.naming.Context jerseyConfigJNDIContext = createJerseyConfigJNDIContext(ic);
- jerseyConfigJNDIContext.rebind(JNDI_CDIEXTENSION_NAME, this);
- }
- } catch (NamingException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- // annotations to be turned into qualifiers
- Set<Class<? extends Annotation>> set = new HashSet<Class<? extends Annotation>>();
- set.add(CookieParam.class);
- set.add(FormParam.class);
- set.add(HeaderParam.class);
- set.add(MatrixParam.class);
- set.add(PathParam.class);
- set.add(QueryParam.class);
- set.add(Context.class);
- knownParameterQualifiers = Collections.unmodifiableSet(set);
-
- // used to map a qualifier to a Parameter.Source
- Map<Class<? extends Annotation>, Parameter.Source> map = new HashMap<Class<? extends Annotation>, Parameter.Source>();
- map.put(CookieParam.class,Parameter.Source.COOKIE);
- map.put(FormParam.class,Parameter.Source.FORM);
- map.put(HeaderParam.class,Parameter.Source.HEADER);
- map.put(MatrixParam.class,Parameter.Source.MATRIX);
- map.put(PathParam.class,Parameter.Source.PATH);
- map.put(QueryParam.class,Parameter.Source.QUERY);
- map.put(Context.class,Parameter.Source.CONTEXT);
- paramQualifiersMap = Collections.unmodifiableMap(map);
-
- // pre-defined contextual types
- Set<Class<?>> set3 = new HashSet<Class<?>>();
- // standard types
- set3.add(Application.class);
- set3.add(HttpHeaders.class);
- set3.add(Providers.class);
- set3.add(Request.class);
- set3.add(SecurityContext.class);
- set3.add(UriInfo.class);
- // Jersey extensions
- set3.add(ExceptionMapperContext.class);
- set3.add(ExtendedUriInfo.class);
- set3.add(FeaturesAndProperties.class);
- set3.add(HttpContext.class);
- set3.add(HttpRequestContext.class);
- set3.add(HttpResponseContext.class);
- set3.add(MessageBodyWorkers.class);
- set3.add(ResourceContext.class);
- set3.add(WebApplication.class);
- staticallyDefinedContextBeans = Collections.unmodifiableSet(set3);
-
- // tracks all discovered parameters
- Map<Class<? extends Annotation>, Set<DiscoveredParameter>> map2 = new HashMap<Class<? extends Annotation>, Set<DiscoveredParameter>>();
- for (Class<? extends Annotation> qualifier : knownParameterQualifiers) {
- map2.put(qualifier, new HashSet<DiscoveredParameter>());
- }
- discoveredParameterMap = Collections.unmodifiableMap(map2);
-
- // tracks the synthetic qualifiers we have to create to handle a specific
- // combination of JAX-RS injection annotation + default value + encoded
- syntheticQualifierMap = new HashMap<DiscoveredParameter, SyntheticQualifier>();
-
- // things to do in a second time, i.e. once Jersey has been initialized,
- // as opposed to when CDI delivers the SPI events to its extensions
- toBeInitializedLater = new ArrayList<InitializedLater>();
- }
-
- private static interface JNDIContextDiver {
- javax.naming.Context stepInto(javax.naming.Context currentContext, String currentName) throws NamingException;
- }
-
- private static javax.naming.Context diveIntoJNDIContext(javax.naming.Context initialContext, JNDIContextDiver diver) throws NamingException {
- Name jerseyConfigCtxName = initialContext.getNameParser("").parse(JNDI_CDIEXTENSION_CTX);
- javax.naming.Context currentContext = initialContext;
- for (int i=0; i<jerseyConfigCtxName.size(); i++) {
- currentContext = diver.stepInto(currentContext, jerseyConfigCtxName.get(i));
- }
- return currentContext;
- }
-
- private static javax.naming.Context createJerseyConfigJNDIContext(javax.naming.Context initialContext) throws NamingException {
- return diveIntoJNDIContext(initialContext, new JNDIContextDiver() {
-
- @Override
- public javax.naming.Context stepInto(javax.naming.Context ctx, String name) throws NamingException {
- try {
- return (javax.naming.Context) ctx.lookup(name);
- } catch (NamingException e) {
- return ctx.createSubcontext(name);
- }
- }
- });
- }
-
- private static javax.naming.Context lookupJerseyConfigJNDIContext(javax.naming.Context initialContext) throws NamingException {
- return diveIntoJNDIContext(initialContext, new JNDIContextDiver() {
- @Override
- public javax.naming.Context stepInto(javax.naming.Context ctx, String name) throws NamingException {
- return (javax.naming.Context) ctx.lookup(name);
- }
- });
- }
-
- void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event, BeanManager manager) {
- LOGGER.fine("Handling BeforeBeanDiscovery event");
- initialize(manager);
-
- // turn JAX-RS injection annotations into CDI qualifiers
- for (Class<? extends Annotation> qualifier : knownParameterQualifiers) {
- event.addQualifier(qualifier);
- }
- }
-
- /*
- * Holds information on one site (constructor/method argument or field) to be patched.
- */
- private static class PatchInformation {
- private DiscoveredParameter parameter;
- private SyntheticQualifier syntheticQualifier;
- private Annotation annotation;
- private boolean mustAddInject;
-
- public PatchInformation(DiscoveredParameter parameter, SyntheticQualifier syntheticQualifier, boolean mustAddInject) {
- this(parameter, syntheticQualifier, null, mustAddInject);
- }
-
- public PatchInformation(DiscoveredParameter parameter, SyntheticQualifier syntheticQualifier, Annotation annotation, boolean mustAddInject) {
- this.parameter = parameter;
- this.syntheticQualifier = syntheticQualifier;
- this.annotation = annotation;
- this.mustAddInject = mustAddInject;
- }
-
- public DiscoveredParameter getParameter() {
- return parameter;
- }
-
- public SyntheticQualifier getSyntheticQualifier() {
- return syntheticQualifier;
- }
-
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public boolean mustAddInject() {
- return mustAddInject;
- }
- }
-
- <T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> event) {
- LOGGER.fine("Handling ProcessAnnotatedType event for " + event.getAnnotatedType().getJavaClass().getName());
-
- AnnotatedType<T> type = event.getAnnotatedType();
-
- /*
- // only scan managed beans
- if (!type.isAnnotationPresent(ManagedBean.class)) {
- return;
- }
-
- // only scan root resource classes for now
- if (!type.isAnnotationPresent(Path.class)) {
- return;
- }
- */
-
- // first pass to determine if we need to patch any sites
- // we also record any qualifiers with parameters we encounter
- // so we can create beans for them later
-
- // TODO - maybe we should detect cases in which the constructor selection
- // rules in CDI and JAX-RS are in conflict -- CDI should win, but
- // the result may surprise the user
-
- boolean classHasEncodedAnnotation = type.isAnnotationPresent(Encoded.class);
-
- Set<AnnotatedConstructor<T>> mustPatchConstructors = new HashSet<AnnotatedConstructor<T>>();
- Map<AnnotatedParameter<? super T>, PatchInformation> parameterToPatchInfoMap = new HashMap<AnnotatedParameter<? super T>, PatchInformation>();
-
- for (AnnotatedConstructor<T> constructor : type.getConstructors()) {
- if (processAnnotatedConstructor(constructor, classHasEncodedAnnotation, parameterToPatchInfoMap)) {
- mustPatchConstructors.add(constructor);
- }
- }
-
- Set<AnnotatedField<? super T>> mustPatchFields = new HashSet<AnnotatedField<? super T>>();
- Map<AnnotatedField<? super T>, PatchInformation> fieldToPatchInfoMap = new HashMap<AnnotatedField<? super T>, PatchInformation>();
-
- for (AnnotatedField<? super T> field : type.getFields()) {
- if (processAnnotatedField(field, type.getJavaClass(), classHasEncodedAnnotation, fieldToPatchInfoMap)) {
- mustPatchFields.add(field);
- }
- }
-
- Set<AnnotatedMethod<? super T>> mustPatchMethods = new HashSet<AnnotatedMethod<? super T>>();
- Set<AnnotatedMethod<? super T>> setterMethodsWithoutInject = new HashSet<AnnotatedMethod<? super T>>();
-
- for (AnnotatedMethod<? super T> method : type.getMethods()) {
- if (processAnnotatedMethod(method, type.getJavaClass(), classHasEncodedAnnotation, parameterToPatchInfoMap, setterMethodsWithoutInject)) {
- mustPatchMethods.add(method);
- }
- }
-
- boolean typeNeedsPatching = !(mustPatchConstructors.isEmpty() && mustPatchFields.isEmpty() && mustPatchMethods.isEmpty());
-
- // second pass
- if (typeNeedsPatching) {
- AnnotatedTypeImpl<T> newType = new AnnotatedTypeImpl(type);
-
- Set<AnnotatedConstructor<T>> newConstructors = new HashSet<AnnotatedConstructor<T>>();
- for (AnnotatedConstructor<T> constructor : type.getConstructors()) {
- AnnotatedConstructorImpl<T> newConstructor = new AnnotatedConstructorImpl(constructor, newType);
- if (mustPatchConstructors.contains(constructor)) {
- patchAnnotatedCallable(constructor, newConstructor, parameterToPatchInfoMap);
- }
- else {
- copyParametersOfAnnotatedCallable(constructor, newConstructor);
- }
- newConstructors.add(newConstructor);
- }
-
- Set<AnnotatedField<? super T>> newFields = new HashSet<AnnotatedField<? super T>>();
- for (AnnotatedField<? super T> field : type.getFields()) {
- if (mustPatchFields.contains(field)) {
- PatchInformation patchInfo = fieldToPatchInfoMap.get(field);
- Set<Annotation> annotations = new HashSet<Annotation>();
- if (patchInfo.mustAddInject()) {
- annotations.add(injectAnnotationLiteral);
- }
- if (patchInfo.getSyntheticQualifier() != null) {
- annotations.add(patchInfo.getSyntheticQualifier());
- Annotation skippedQualifier = patchInfo.getParameter().getAnnotation();
- for (Annotation annotation : field.getAnnotations()) {
- if (annotation != skippedQualifier) {
- annotations.add(annotation);
- }
- }
- }
- else {
- annotations.addAll(field.getAnnotations());
- }
- if (patchInfo.getAnnotation() != null) {
- annotations.add(patchInfo.getAnnotation());
- }
- newFields.add(new AnnotatedFieldImpl<T>(field, annotations, newType));
- }
- else {
- // copy and reparent
- newFields.add(new AnnotatedFieldImpl<T>(field, newType));
- }
- }
-
- Set<AnnotatedMethod<? super T>> newMethods = new HashSet<AnnotatedMethod<? super T>>();
- for (AnnotatedMethod<? super T> method : type.getMethods()) {
- if (mustPatchMethods.contains((AnnotatedMethod<T>)method)) {
- if (setterMethodsWithoutInject.contains((AnnotatedMethod<T>)method)) {
- Set<Annotation> annotations = new HashSet<Annotation>();
- annotations.add(injectAnnotationLiteral);
- for (Annotation annotation : method.getAnnotations()) {
- if (!knownParameterQualifiers.contains(annotation.annotationType())) {
- annotations.add(annotation);
- }
- }
- AnnotatedMethodImpl<T> newMethod = new AnnotatedMethodImpl<T>(method, annotations, newType);
- patchAnnotatedCallable(method, newMethod, parameterToPatchInfoMap);
- newMethods.add(newMethod);
- }
- else {
- AnnotatedMethodImpl<T> newMethod = new AnnotatedMethodImpl<T>(method, newType);
- patchAnnotatedCallable(method, newMethod, parameterToPatchInfoMap);
- newMethods.add(newMethod);
- }
- }
- else {
- AnnotatedMethodImpl<T> newMethod = new AnnotatedMethodImpl<T>(method, newType);
- copyParametersOfAnnotatedCallable(method, newMethod);
- newMethods.add(newMethod);
- }
- }
-
- newType.setConstructors(newConstructors);
- newType.setFields(newFields);
- newType.setMethods(newMethods);
- event.setAnnotatedType(newType);
-
- LOGGER.fine(" replaced annotated type for " + type.getJavaClass());
- }
- }
-
- private <T> boolean processAnnotatedConstructor(AnnotatedConstructor<T> constructor,
- boolean classHasEncodedAnnotation,
- Map<AnnotatedParameter<? super T>, PatchInformation> parameterToPatchInfoMap) {
- boolean mustPatch = false;
-
- if (constructor.getAnnotation(Inject.class) != null) {
- boolean methodHasEncodedAnnotation = constructor.isAnnotationPresent(Encoded.class);
- for (AnnotatedParameter<T> parameter : constructor.getParameters()) {
- for (Annotation annotation : parameter.getAnnotations()) {
- Set<DiscoveredParameter> discovered = discoveredParameterMap.get(annotation.annotationType());
- if (discovered != null) {
- if (knownParameterQualifiers.contains(annotation.annotationType())) {
- if (methodHasEncodedAnnotation ||
- classHasEncodedAnnotation ||
- parameter.isAnnotationPresent(DefaultValue.class)) {
- mustPatch = true;
- }
-
- boolean encoded = parameter.isAnnotationPresent(Encoded.class) || methodHasEncodedAnnotation || classHasEncodedAnnotation;
- DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class);
- if (defaultValue != null) {
- mustPatch = true;
- }
- DiscoveredParameter jerseyParameter = new DiscoveredParameter(annotation, parameter.getBaseType(), defaultValue, encoded);
- discovered.add(jerseyParameter);
- LOGGER.fine(" recorded " + jerseyParameter);
- parameterToPatchInfoMap.put(parameter, new PatchInformation(jerseyParameter, getSyntheticQualifierFor(jerseyParameter), false));
- }
- }
- }
- }
- }
-
- return mustPatch;
- }
-
- private <T> boolean processAnnotatedMethod(AnnotatedMethod<? super T> method,
- Class<T> token,
- boolean classHasEncodedAnnotation,
- Map<AnnotatedParameter<? super T>, PatchInformation> parameterToPatchInfoMap,
- Set<AnnotatedMethod<? super T>> setterMethodsWithoutInject) {
- boolean mustPatch = false;
-
- if (method.getAnnotation(Inject.class) != null) {
- // a method already annotated with @Inject -- we assume the user is
- // aware of CDI and all we need to do is to detect the need for
- // a synthetic qualifier so as to take @DefaultValue and @Encoded into
- // account
- boolean methodHasEncodedAnnotation = method.isAnnotationPresent(Encoded.class);
- for (AnnotatedParameter<? super T> parameter : method.getParameters()) {
- for (Annotation annotation : parameter.getAnnotations()) {
- Set<DiscoveredParameter> discovered = discoveredParameterMap.get(annotation.annotationType());
- if (discovered != null) {
- if (knownParameterQualifiers.contains(annotation.annotationType())) {
- if (methodHasEncodedAnnotation ||
- classHasEncodedAnnotation ||
- parameter.isAnnotationPresent(DefaultValue.class)) {
- mustPatch = true;
- }
-
- boolean encoded = parameter.isAnnotationPresent(Encoded.class) || methodHasEncodedAnnotation || classHasEncodedAnnotation;
- DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class);
- if (defaultValue != null) {
- mustPatch = true;
- }
- DiscoveredParameter jerseyParameter = new DiscoveredParameter(annotation, parameter.getBaseType(), defaultValue, encoded);
- discovered.add(jerseyParameter);
- LOGGER.fine(" recorded " + jerseyParameter);
- parameterToPatchInfoMap.put(parameter, new PatchInformation(jerseyParameter, getSyntheticQualifierFor(jerseyParameter), false));
- }
- }
- }
- }
- }
- else {
- // a method *not* annotated with @Inject -- here we only deal with
- // setter methods with a JAX-RS "qualifier" (Context, QueryParam, etc.)
- // on the method itself
- if (isSetterMethod(method)) {
- boolean methodHasEncodedAnnotation = method.isAnnotationPresent(Encoded.class);
- for (Annotation annotation : method.getAnnotations()) {
- Set<DiscoveredParameter> discovered = discoveredParameterMap.get(annotation.annotationType());
- if (discovered != null) {
- if (knownParameterQualifiers.contains(annotation.annotationType())) {
- mustPatch = true;
- setterMethodsWithoutInject.add(method);
- for (AnnotatedParameter<? super T> parameter : method.getParameters()) {
- boolean encoded = parameter.isAnnotationPresent(Encoded.class) || methodHasEncodedAnnotation || classHasEncodedAnnotation;
- DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class);
- if (defaultValue == null) {
- defaultValue = method.getAnnotation(DefaultValue.class);
- }
- DiscoveredParameter jerseyParameter = new DiscoveredParameter(annotation, parameter.getBaseType(), defaultValue, encoded);
- discovered.add(jerseyParameter);
- LOGGER.fine(" recorded " + jerseyParameter);
- SyntheticQualifier syntheticQualifier = getSyntheticQualifierFor(jerseyParameter);
- // if there is no synthetic qualifier, add to the parameter the annotation that was on the method itself
- Annotation addedAnnotation = syntheticQualifier == null ? annotation : null;
- parameterToPatchInfoMap.put(parameter, new PatchInformation(jerseyParameter, syntheticQualifier, addedAnnotation, false));
- }
- break;
- }
- }
- }
- }
- }
-
- return mustPatch;
- }
-
- private <T> boolean isSetterMethod(AnnotatedMethod<T> method) {
- Method javaMethod = method.getJavaMember();
- if ((javaMethod.getModifiers() & Modifier.PUBLIC) != 0 &&
- (javaMethod.getReturnType() == Void.TYPE) &&
- (javaMethod.getName().startsWith("set"))) {
- List<AnnotatedParameter<T>> parameters = method.getParameters();
- if (parameters.size() == 1) {
- return true;
- }
- }
-
- return false;
- }
-
- private <T> boolean processAnnotatedField(AnnotatedField<? super T> field,
- Class<T> token,
- boolean classHasEncodedAnnotation,
- Map<AnnotatedField<? super T>, PatchInformation> fieldToPatchInfoMap) {
- boolean mustPatch = false;
- for (Annotation annotation : field.getAnnotations()) {
- if (knownParameterQualifiers.contains(annotation.annotationType())) {
- boolean mustAddInjectAnnotation = !field.isAnnotationPresent(Inject.class);
-
- if (field.isAnnotationPresent(Encoded.class) ||
- classHasEncodedAnnotation ||
- mustAddInjectAnnotation ||
- field.isAnnotationPresent(DefaultValue.class)) {
- mustPatch = true;
- }
-
- Set<DiscoveredParameter> discovered = discoveredParameterMap.get(annotation.annotationType());
- if (discovered != null) {
- boolean encoded = field.isAnnotationPresent(Encoded.class) || classHasEncodedAnnotation;
- DefaultValue defaultValue = field.getAnnotation(DefaultValue.class);
- DiscoveredParameter parameter = new DiscoveredParameter(annotation, field.getBaseType(), defaultValue, encoded);
- discovered.add(parameter);
- LOGGER.fine(" recorded " + parameter);
- fieldToPatchInfoMap.put(field, new PatchInformation(parameter, getSyntheticQualifierFor(parameter), mustAddInjectAnnotation));
- }
- }
- }
-
- return mustPatch;
- }
-
- private <T> void patchAnnotatedCallable(AnnotatedCallable<? super T> callable,
- AnnotatedCallableImpl<T> newCallable,
- Map<AnnotatedParameter<? super T>, PatchInformation> parameterToPatchInfoMap) {
- List<AnnotatedParameter<T>> newParams = new ArrayList<AnnotatedParameter<T>>();
- for (AnnotatedParameter<? super T> parameter : callable.getParameters()) {
- PatchInformation patchInfo = parameterToPatchInfoMap.get(parameter);
- if (patchInfo != null) {
- Set<Annotation> annotations = new HashSet<Annotation>();
- // in reality, this cannot happen
- if (patchInfo.mustAddInject()) {
- annotations.add(injectAnnotationLiteral);
- }
-
- if (patchInfo.getSyntheticQualifier() != null) {
- annotations.add(patchInfo.getSyntheticQualifier());
- Annotation skippedQualifier = patchInfo.getParameter().getAnnotation();
- for (Annotation annotation : parameter.getAnnotations()) {
- if (annotation != skippedQualifier) {
- annotations.add(annotation);
- }
- }
- }
- else {
- annotations.addAll(parameter.getAnnotations());
- }
- if (patchInfo.getAnnotation() != null) {
- annotations.add(patchInfo.getAnnotation());
- }
- newParams.add(new AnnotatedParameterImpl<T>(parameter, annotations, newCallable));
- }
- else {
- newParams.add(new AnnotatedParameterImpl<T>(parameter, newCallable));
- }
- }
- newCallable.setParameters(newParams);
- }
-
- private <T> void copyParametersOfAnnotatedCallable(AnnotatedCallable<? super T> callable, AnnotatedCallableImpl<T> newCallable) {
- // copy and reparent all the parameters
- List<AnnotatedParameter<T>> newParams = new ArrayList<AnnotatedParameter<T>>();
- for (AnnotatedParameter<? super T> parameter : callable.getParameters()) {
- newParams.add(new AnnotatedParameterImpl<T>(parameter, newCallable));
- }
- newCallable.setParameters(newParams);
- }
-
- private SyntheticQualifier getSyntheticQualifierFor(DiscoveredParameter parameter) {
- SyntheticQualifier result = syntheticQualifierMap.get(parameter);
- if (result == null) {
- // only create a synthetic qualifier if we're dealing with @DefaultValue
- // or @Encoded; this way the application can still use vanilla param
- // annotations as qualifiers
- if (parameter.isEncoded() || parameter.getDefaultValue() != null) {
- result = new SyntheticQualifierAnnotationImpl(nextSyntheticQualifierValue++);
- syntheticQualifierMap.put(parameter, result);
- LOGGER.fine(" created synthetic qualifier " + result);
- }
- }
- return result;
- }
-
- // taken from ReflectionHelper
- private static Class getClassOfType(Type type) {
- if (type instanceof Class) {
- return (Class)type;
- } else if (type instanceof GenericArrayType) {
- GenericArrayType arrayType = (GenericArrayType)type;
- Type t = arrayType.getGenericComponentType();
- if (t instanceof Class) {
- Class c = (Class)t;
- try {
- // TODO is there a better way to get the Class object
- // representing an array
- Object o = Array.newInstance(c, 0);
- return o.getClass();
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- }
- } else if (type instanceof ParameterizedType) {
- ParameterizedType subType = (ParameterizedType)type;
- Type t = subType.getRawType();
- if (t instanceof Class) {
- return (Class)t;
- }
- }
- return null;
- }
-
- <T> void processInjectionTarget(@Observes ProcessInjectionTarget<T> event) {
- LOGGER.fine("Handling ProcessInjectionTarget event for " + event.getAnnotatedType().getJavaClass().getName());
- }
-
- /*
- void processBean(@Observes ProcessBean<?> event) {
- LOGGER.fine("Handling ProcessBean event for " + event.getBean().getBeanClass().getName());
- }
- */
-
- void processManagedBean(@Observes ProcessManagedBean<?> event) {
- LOGGER.fine("Handling ProcessManagedBean event for " + event.getBean().getBeanClass().getName());
-
- // TODO - here we should check that all the rules have been followed
- // and call addDefinitionError for each problem we encountered
-
- Bean<?> bean = event.getBean();
- for (InjectionPoint injectionPoint : bean.getInjectionPoints()) {
- StringBuilder sb = new StringBuilder();
- sb.append(" found injection point ");
- sb.append(injectionPoint.getType());
- for (Annotation annotation : injectionPoint.getQualifiers()) {
- sb.append(" ");
- sb.append(annotation);
- }
- LOGGER.fine(sb.toString());
- }
- }
-
- void afterBeanDiscovery(@Observes AfterBeanDiscovery event) {
- LOGGER.fine("Handling AfterBeanDiscovery event");
-
- addPredefinedContextBeans(event);
-
- // finally define beans for all qualifiers we discovered
-
- BeanGenerator beanGenerator = new BeanGenerator("com/sun/jersey/server/impl/cdi/generated/Bean");
-
- for (Map.Entry<Class<? extends Annotation>, Set<DiscoveredParameter>> entry : discoveredParameterMap.entrySet()) {
- Class<? extends Annotation> qualifier = entry.getKey();
- for (DiscoveredParameter parameter : entry.getValue()) {
- Annotation annotation = parameter.getAnnotation();
- Class<?> klass = getClassOfType(parameter.getType());
-
- if (annotation.annotationType() == Context.class &&
- staticallyDefinedContextBeans.contains(klass) &&
- !parameter.isEncoded() &&
- parameter.getDefaultValue() == null) {
- continue;
- }
-
- SyntheticQualifier syntheticQualifier = syntheticQualifierMap.get(parameter);
- Annotation theQualifier = syntheticQualifier != null ? syntheticQualifier : annotation;
-
- Set<Annotation> annotations = new HashSet<Annotation>();
- annotations.add(theQualifier);
-
- // TODO - here we pass a single annotation as the second argument,
- // i.e. the qualifier itself, but to be true to Jersey semantics we
- // should pass in all the annotations that were on the original program
- // element.
- // The problem here is that (1) we don't have the original program
- // element any more and (2) a single DiscoveredParameter may have
- // been encountered in multiple places with different annotations
-
- Parameter jerseyParameter = new Parameter(
- new Annotation[]{ annotation },
- annotation,
- paramQualifiersMap.get(annotation.annotationType()),
- parameter.getValue(),
- parameter.getType(),
- klass,
- parameter.isEncoded(),
- (parameter.getDefaultValue() == null ? null : parameter.getDefaultValue().value()));
- Class<?> beanClass = beanGenerator.createBeanClass();
- ParameterBean bean = new ParameterBean(beanClass, parameter.getType(), annotations, parameter, jerseyParameter);
- toBeInitializedLater.add(bean);
- event.addBean(bean);
- LOGGER.fine("Added bean for parameter " + parameter + " and qualifier " + theQualifier);
- }
- }
-
- }
-
- /*
- * Adds a CDI bean for each @Context type we support out of the box
- */
- private void addPredefinedContextBeans(AfterBeanDiscovery event) {
- // all standard types first
-
- // @Context Application
- event.addBean(new PredefinedBean<Application>(Application.class, contextAnnotationLiteral));
-
- // @Context HttpHeaders
- event.addBean(new PredefinedBean<HttpHeaders>(HttpHeaders.class, contextAnnotationLiteral));
-
- // @Context Providers
- event.addBean(new PredefinedBean<Providers>(Providers.class, contextAnnotationLiteral));
-
- // @Context Request
- event.addBean(new PredefinedBean<Request>(Request.class, contextAnnotationLiteral));
-
- // @Context SecurityContext
- event.addBean(new PredefinedBean<SecurityContext>(SecurityContext.class, contextAnnotationLiteral));
-
- // @Context UriInfo
- event.addBean(new PredefinedBean<UriInfo>(UriInfo.class, contextAnnotationLiteral));
-
- // now the Jersey extensions
-
- // @Context ExceptionMapperContext
- event.addBean(new PredefinedBean<ExceptionMapperContext>(ExceptionMapperContext.class, contextAnnotationLiteral));
-
- // @Context ExtendedUriInfo
- event.addBean(new PredefinedBean<ExtendedUriInfo>(ExtendedUriInfo.class, contextAnnotationLiteral));
-
- // @Context FeaturesAndProperties
- event.addBean(new PredefinedBean<FeaturesAndProperties>(FeaturesAndProperties.class, contextAnnotationLiteral));
-
- // @Context HttpContext
- event.addBean(new PredefinedBean<HttpContext>(HttpContext.class, contextAnnotationLiteral));
-
- // @Context HttpRequestContext
- event.addBean(new PredefinedBean<HttpRequestContext>(HttpRequestContext.class, contextAnnotationLiteral));
-
- // @Context HttpResponseContext
- event.addBean(new PredefinedBean<HttpResponseContext>(HttpResponseContext.class, contextAnnotationLiteral));
-
- // @Context MessageBodyWorkers
- event.addBean(new PredefinedBean<MessageBodyWorkers>(MessageBodyWorkers.class, contextAnnotationLiteral));
-
- // @Context ResourceContext
- event.addBean(new PredefinedBean<ResourceContext>(ResourceContext.class, contextAnnotationLiteral));
-
- // @Context WebApplication
- event.addBean(new ProviderBasedBean<WebApplication>(WebApplication.class, new Provider<WebApplication>() {
- public WebApplication get() {
- return webApplication;
- }
- }, contextAnnotationLiteral));
-
- }
-
- void setWebApplication(WebApplication wa) {
- webApplication = wa;
- }
-
- WebApplication getWebApplication() {
- return webApplication;
- }
-
- void setResourceConfig(ResourceConfig rc) {
- resourceConfig = rc;
- }
-
- ResourceConfig getResourceConfig() {
- return resourceConfig;
- }
-
- /*
- * Called after the WebApplication and ResourceConfig have been set,
- * i.e. when Jersey is in a somewhat initialized state.
- *
- * By contrast, all the CDI driven code earlier in this source file
- * runs before Jersey gets a chance to initialize itself.
- */
- void lateInitialize() {
- try {
- for (InitializedLater object : toBeInitializedLater) {
- object.later();
- }
- }
- finally {
- // clear the JNDI reference as soon as possible
- if (!lookupExtensionInBeanManager) {
- try {
- InitialContext ic = InitialContextHelper.getInitialContext();
- if (ic != null) {
- lookupJerseyConfigJNDIContext(ic).unbind(JNDI_CDIEXTENSION_NAME);
- }
- } catch (NamingException ex) {
- throw new RuntimeException(ex);
- }
- }
- }
- }
-
- /*
- * Constructs an object by delegating to the ServerInjectableProviderFactory of the WebApplication
- */
- class PredefinedBean<T> extends AbstractBean<T> {
-
- private Annotation qualifier;
-
- public PredefinedBean(Class<T> klass, Annotation qualifier) {
- super(klass, qualifier);
- this.qualifier = qualifier;
- }
-
- @Override
- public T create(CreationalContext<T> creationalContext) {
- Injectable<T> injectable = webApplication.getServerInjectableProviderFactory().
- getInjectable(qualifier.annotationType(), null, qualifier, getBeanClass(), ComponentScope.Singleton);
- if (injectable == null) {
- Errors.error("No injectable for " + getBeanClass().getName());
- return null;
- }
- return injectable.getValue();
- }
- }
-
- /*
- * Constructs an object by delegating to the Injectable for a Jersey parameter
- */
- class ParameterBean<T> extends AbstractBean<T> implements InitializedLater {
- private DiscoveredParameter discoveredParameter;
- private Parameter parameter;
- private Injectable<T> injectable;
- private boolean processed = false;
-
- public ParameterBean(Class<?> klass, Type type, Set<Annotation> qualifiers,
- DiscoveredParameter discoveredParameter, Parameter parameter) {
- super(klass, type, qualifiers);
- this.discoveredParameter = discoveredParameter;
- this.parameter = parameter;
- }
-
- public void later() {
- if (injectable != null) {
- return;
- }
- if (processed)
- return;
-
- processed = true;
- boolean registered = webApplication.getServerInjectableProviderFactory().
- isParameterTypeRegistered(parameter);
- if (!registered) {
- Errors.error("Parameter type not registered " + discoveredParameter);
- }
- // TODO - here it just doesn't seem possible to remove the cast
- injectable = (Injectable<T>) webApplication.getServerInjectableProviderFactory().
- getInjectable(parameter, ComponentScope.PerRequest);
- if (injectable == null) {
- Errors.error("No injectable for parameter " + discoveredParameter);
- }
- }
-
- @Override
- public T create(CreationalContext<T> creationalContext) {
- if (injectable == null) {
- later();
- if (injectable == null) {
- return null;
- }
- }
-
- try {
- return injectable.getValue();
- } catch (IllegalStateException e) {
- if (injectable instanceof AbstractHttpContextInjectable) {
- return (T)((AbstractHttpContextInjectable)injectable).getValue(webApplication.getThreadLocalHttpContext());
- }
- else {
- throw e;
- }
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/DiscoveredParameter.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/DiscoveredParameter.java
deleted file mode 100644
index ce41a9b5f2a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/DiscoveredParameter.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import javax.ws.rs.DefaultValue;
-
-/**
- * Records all information about a JAX-RS-related parameter.
- *
- * @author robc
- */
-public class DiscoveredParameter {
-
- private Annotation annotation;
- private Type type;
- private DefaultValue defaultValue;
- private boolean encoded;
-
- public DiscoveredParameter(Annotation annotation, Type type, DefaultValue defaultValue, boolean encoded) {
- this.annotation = annotation;
- this.type = type;
- this.defaultValue = defaultValue;
- this.encoded = encoded;
- }
-
- public Annotation getAnnotation() {
- return annotation;
- }
-
- public Type getType() {
- return type;
- }
-
- public DefaultValue getDefaultValue() {
- return defaultValue;
- }
-
- public boolean isEncoded() {
- return encoded;
- }
-
- public String getValue() {
- try {
- // Annotation[] as, Annotation a, Source source, String sourceName, Type type, Class<?> clazz)
- Method valueMethod = annotation.annotationType().getDeclaredMethod("value");
- String name = (String)valueMethod.invoke(annotation);
- return name;
- }
- catch (NoSuchMethodException e) {
- return null;
- }
- catch (IllegalAccessException e) {
- // wrap and rethrow for now
- throw new RuntimeException(e);
- }
- catch (InvocationTargetException e) {
- // wrap and rethrow for now
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public int hashCode() {
- int result = 17;
- result = 31 * result + (annotation == null ? 0 : annotation.hashCode());
- result = 31 * result + (type == null ? 0 : type.hashCode());
- result = 31 * result + (defaultValue == null ? 0 : defaultValue.hashCode());
- result = 31 * result + (encoded ? 7 : 11);
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
-
- if (obj == null) {
- return false;
- }
-
- if (obj.getClass() != this.getClass()) {
- return false;
- }
-
- DiscoveredParameter that = (DiscoveredParameter) obj;
-
- return (annotation == null ? that.annotation == null : annotation.equals(that.annotation)) &&
- (type == null ? that.type == null : type.equals(that.type)) &&
- (defaultValue == null ? that.defaultValue == null : defaultValue.equals(that.defaultValue)) &&
- (this.encoded == that.encoded);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("DiscoveredParameter(");
- sb.append(annotation);
- sb.append(',');
- sb.append(type);
- sb.append(',');
- sb.append(defaultValue);
- sb.append(',');
- sb.append(encoded);
- sb.append(')');
- return sb.toString();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/InitializedLater.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/InitializedLater.java
deleted file mode 100644
index f96ace78cdd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/InitializedLater.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-/**
- * An interface for objects to be initialized later, when Jersey is ready for use.
- *
- * @author robc
- */
-public interface InitializedLater {
-
- public void later();
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/ProviderBasedBean.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/ProviderBasedBean.java
deleted file mode 100644
index 53cbcdbd4dc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/ProviderBasedBean.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.inject.Provider;
-
-/**
- * A CDI Bean implementation that delegates bean creation to a Provider.
- *
- * @author robc
- */
-public class ProviderBasedBean<T> extends AbstractBean<T> {
-
- private Provider<T> provider;
-
- public ProviderBasedBean(Class<?> klass, Provider<T> provider, Annotation qualifier) {
- super(klass, qualifier);
- this.provider = provider;
- }
-
- public ProviderBasedBean(Class<?> klass, Type type, Provider<T> provider, Annotation qualifier) {
- super(klass, type, qualifier);
- this.provider = provider;
- }
-
- @Override
- public T create(CreationalContext<T> creationalContext) {
- return provider.get();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/SyntheticQualifier.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/SyntheticQualifier.java
deleted file mode 100644
index 1367142452f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/SyntheticQualifier.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import javax.inject.Qualifier;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * A CDI qualifier introduced by Jersey to make an injection point unique.
- *
- * This is needed because the subset semantics used by CDI when dealing
- * with multiple qualifiers would end up making plain-looking JAX-RS
- * dependencies ambiguous if we simply turned @DefaultValue and/or @Encoded
- * into qualifiers.
- *
- * @author robc
- */
-@Qualifier
-@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface SyntheticQualifier {
-
- /**
- * A unique value for the qualifier.
- */
- int value();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/Utils.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/Utils.java
deleted file mode 100644
index c20977b9c41..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/cdi/Utils.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.cdi;
-
-import java.util.Collections;
-import java.util.Set;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-/**
- * Utility methods for CDI BeanManager and Bean classes.
- *
- * @author robc
- * @author Paul.Sandoz@Sun.Com
- */
-public class Utils {
-
- private Utils() {}
-
- public static Bean<?> getBean(BeanManager bm, Class<?> c) {
- final Set<Bean<?>> bs = bm.getBeans(c);
- if (bs.isEmpty()) {
- return null;
- }
-
- try {
- return bm.resolve(bs);
- } catch(AmbiguousResolutionException ex) {
- // Check if there is a shared base class of c
- // If so reduce the set of beans whose class equals c and resolve
- if (isSharedBaseClass(c, bs)) {
- try {
- return bm.resolve(getBaseClassSubSet(c, bs));
- } catch (AmbiguousResolutionException ex2) {
- return null;
- }
- }
- return null;
- }
- }
-
- public static <T> T getInstance(BeanManager bm, Class<T> c) {
- Bean<?> b = getBean(bm, c);
- if (b == null) {
- return null;
- }
-
- CreationalContext<?> cc = bm.createCreationalContext(b);
- return c.cast(bm.getReference(b, c, cc));
- }
-
- private static boolean isSharedBaseClass(Class<?> c, Set<Bean<?>> bs) {
- for (Bean<?> b : bs) {
- if (!c.isAssignableFrom(b.getBeanClass())) {
- return false;
- }
- }
- return true;
- }
-
- private static Set<Bean<?>> getBaseClassSubSet(Class<?> c, Set<Bean<?>> bs) {
- for (Bean<?> b : bs) {
- if (c == b.getBeanClass()) {
- return Collections.<Bean<?>>singleton(b);
- }
- }
- return bs;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/IoCResourceFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/IoCResourceFactory.java
deleted file mode 100644
index ae82972cf22..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/IoCResourceFactory.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.component;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCManagedComponentProvider;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCFullyManagedComponentProvider;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.server.spi.component.ResourceComponentInjector;
-import com.sun.jersey.server.spi.component.ResourceComponentProvider;
-import com.sun.jersey.server.spi.component.ResourceComponentProviderFactory;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class IoCResourceFactory extends ResourceFactory {
- private final List<IoCComponentProviderFactory> factories;
-
- public IoCResourceFactory(
- ResourceConfig config,
- ServerInjectableProviderContext ipc,
- List<IoCComponentProviderFactory> factories) {
- super(config, ipc);
- this.factories = factories;
- }
-
- @Override
- public ResourceComponentProvider getComponentProvider(ComponentContext cc, Class c) {
- IoCComponentProvider icp = null;
- for (IoCComponentProviderFactory f : factories) {
- icp = f.getComponentProvider(cc, c);
- if (icp != null)
- break;
- }
- return (icp == null) ? super.getComponentProvider(cc, c) : wrap(c, icp);
- }
-
- private ResourceComponentProvider wrap(Class c, IoCComponentProvider icp) {
- if (icp instanceof IoCManagedComponentProvider) {
- IoCManagedComponentProvider imcp = (IoCManagedComponentProvider)icp;
- if (imcp.getScope() == ComponentScope.PerRequest) {
- return new PerRequestWrapper(getInjectableProviderContext(), imcp);
- } else if (imcp.getScope() == ComponentScope.Singleton) {
- return new SingletonWrapper(getInjectableProviderContext(), imcp);
- } else {
- return new UndefinedWrapper(getInjectableProviderContext(), imcp);
- }
- } else if (icp instanceof IoCFullyManagedComponentProvider) {
- IoCFullyManagedComponentProvider ifmcp = (IoCFullyManagedComponentProvider)icp;
- return new FullyManagedWrapper(ifmcp);
- } else {
- ResourceComponentProviderFactory rcpf = getComponentProviderFactory(c);
- return rcpf.getComponentProvider(icp, c);
- }
- }
-
- private static class FullyManagedWrapper implements ResourceComponentProvider {
- private final IoCFullyManagedComponentProvider ifmcp;
-
- FullyManagedWrapper(IoCFullyManagedComponentProvider ifmcp) {
- this.ifmcp = ifmcp;
- }
-
- public void init(AbstractResource abstractResource) {
- }
-
- public ComponentScope getScope() {
- return ifmcp.getScope();
- }
-
- public Object getInstance(HttpContext hc) {
- return ifmcp.getInstance();
- }
-
- public Object getInstance() {
- throw new IllegalStateException();
- }
-
- public void destroy() {
- }
- }
-
- private static class PerRequestWrapper implements ResourceComponentProvider {
- private final ServerInjectableProviderContext ipc;
- private final IoCManagedComponentProvider imcp;
- private ResourceComponentInjector rci;
-
- PerRequestWrapper(ServerInjectableProviderContext ipc, IoCManagedComponentProvider imcp) {
- this.ipc = ipc;
- this.imcp = imcp;
- }
-
- public void init(AbstractResource abstractResource) {
- rci = new ResourceComponentInjector(
- ipc,
- ComponentScope.PerRequest,
- abstractResource);
- }
-
- public ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- public Object getInstance(HttpContext hc) {
- Object o = imcp.getInstance();
- rci.inject(hc, imcp.getInjectableInstance(o));
- return o;
- }
-
- public Object getInstance() {
- throw new IllegalStateException();
- }
-
- public void destroy() {
- }
- }
-
- private static class SingletonWrapper implements ResourceComponentProvider {
- private final ServerInjectableProviderContext ipc;
- private final IoCManagedComponentProvider imcp;
- private Object o;
-
- SingletonWrapper(ServerInjectableProviderContext ipc, IoCManagedComponentProvider imcp) {
- this.ipc = ipc;
- this.imcp = imcp;
- }
-
- public void init(AbstractResource abstractResource) {
- ResourceComponentInjector rci = new ResourceComponentInjector(
- ipc,
- ComponentScope.Singleton,
- abstractResource);
- o = imcp.getInstance();
- rci.inject(null, imcp.getInjectableInstance(o));
- }
-
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public Object getInstance(HttpContext hc) {
- return o;
- }
-
- public Object getInstance() {
- throw new IllegalStateException();
- }
-
- public void destroy() {
- }
- }
-
- private static class UndefinedWrapper implements ResourceComponentProvider {
- private final ServerInjectableProviderContext ipc;
- private final IoCManagedComponentProvider imcp;
- private ResourceComponentInjector rci;
-
- UndefinedWrapper(ServerInjectableProviderContext ipc, IoCManagedComponentProvider imcp) {
- this.ipc = ipc;
- this.imcp = imcp;
- }
-
- public void init(AbstractResource abstractResource) {
- rci = new ResourceComponentInjector(
- ipc,
- ComponentScope.Undefined,
- abstractResource);
- }
-
- public ComponentScope getScope() {
- return ComponentScope.Undefined;
- }
-
- public Object getInstance(HttpContext hc) {
- Object o = imcp.getInstance();
- rci.inject(hc, imcp.getInjectableInstance(o));
- return o;
- }
-
- public Object getInstance() {
- throw new IllegalStateException();
- }
-
- public void destroy() {
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/ResourceFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/ResourceFactory.java
deleted file mode 100644
index a729aecc2c6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/component/ResourceFactory.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.component;
-
-import com.sun.jersey.server.spi.component.*;
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.component.ComponentConstructor;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentInjector;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.server.impl.resource.PerRequestFactory;
-import com.sun.jersey.spi.inject.Errors;
-import java.lang.annotation.Annotation;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ResourceFactory {
- private final ResourceConfig config;
-
- private final ServerInjectableProviderContext ipc;
-
- private final Map<Class, ResourceComponentProviderFactory> factories;
-
- public ResourceFactory(ResourceConfig config, ServerInjectableProviderContext ipc) {
- this.config = config;
- this.ipc = ipc;
- this.factories = new HashMap<Class, ResourceComponentProviderFactory>();
- }
-
- public ServerInjectableProviderContext getInjectableProviderContext() {
- return ipc;
- }
-
- public ComponentScope getScope(Class c) {
- return getComponentProviderFactory(c).getScope(c);
- }
-
- public ResourceComponentProvider getComponentProvider(ComponentContext cc, Class c) {
- return getComponentProviderFactory(c).getComponentProvider(c);
- }
-
- protected ResourceComponentProviderFactory getComponentProviderFactory(Class c) {
- Class<? extends ResourceComponentProviderFactory> providerFactoryClass = null;
- Class<? extends Annotation> scope = null;
-
- // Use annotations to identify the correct provider, note that
- // @ResourceComponentProviderClass is a meta-annotation so we look for annotations
- // on the annotations of the resource class
- for (Annotation a: c.getAnnotations()) {
- Class<? extends Annotation> annotationType = a.annotationType();
- ResourceComponentProviderFactoryClass rf = annotationType.getAnnotation(
- ResourceComponentProviderFactoryClass.class);
- if (rf != null && providerFactoryClass == null) {
- providerFactoryClass = rf.value();
- scope = annotationType;
- } else if (rf != null && providerFactoryClass != null) {
- Errors.error("Class " + c.getName() + " is annotated with multiple scopes: "
- + scope.getName() + " and " + annotationType.getName());
- }
- }
-
- if (providerFactoryClass == null) {
- Object v = config.getProperties().
- get(ResourceConfig.PROPERTY_DEFAULT_RESOURCE_COMPONENT_PROVIDER_FACTORY_CLASS);
- if (v == null) {
- // Use default provider if none specified
- providerFactoryClass = PerRequestFactory.class;
- } else if (v instanceof String) {
- try {
- providerFactoryClass = getSubclass(ReflectionHelper.classForNameWithException((String)v));
- } catch (ClassNotFoundException ex) {
- throw new ContainerException(ex);
- }
- } else if (v instanceof Class) {
- providerFactoryClass = getSubclass((Class)v);
- } else {
- throw new IllegalArgumentException("Property value for "
- + ResourceConfig.PROPERTY_DEFAULT_RESOURCE_COMPONENT_PROVIDER_FACTORY_CLASS
- + " of type Class or String");
- }
- }
-
- ResourceComponentProviderFactory rcpf = factories.get(providerFactoryClass);
- if (rcpf == null) {
- rcpf = getInstance(providerFactoryClass);
- factories.put(providerFactoryClass, rcpf);
- }
-
- return rcpf;
- }
-
- private Class<? extends ResourceComponentProviderFactory> getSubclass(Class<?> c) {
- if (ResourceComponentProviderFactory.class.isAssignableFrom(c)) {
- return c.asSubclass(ResourceComponentProviderFactory.class);
- } else {
- throw new IllegalArgumentException("Property value for "
- + ResourceConfig.PROPERTY_DEFAULT_RESOURCE_COMPONENT_PROVIDER_FACTORY_CLASS
- + " of type " + c + " not of a subclass of " + ResourceComponentProviderFactory.class);
- }
-
- }
-
- private ResourceComponentProviderFactory getInstance(
- Class<? extends ResourceComponentProviderFactory> providerFactoryClass) {
- try {
- ComponentInjector<ResourceComponentProviderFactory> ci =
- new ComponentInjector(ipc, providerFactoryClass);
-
- ComponentConstructor<ResourceComponentProviderFactory> cc =
- new ComponentConstructor(ipc, providerFactoryClass, ci);
-
- return cc.getInstance();
- } catch (Exception ex) {
- throw new ContainerException("Unable to create resource component provider", ex);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.java
deleted file mode 100644
index bf04f2966f2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.server.impl.application.WebApplicationImpl;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.container.WebApplicationProvider;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WebApplicationProviderImpl implements WebApplicationProvider {
-
- public WebApplication createWebApplication() throws ContainerException {
- return new WebApplicationImpl();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.java
deleted file mode 100644
index 06624dfd7ef..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.filter;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.spi.container.ResourceFilter;
-import com.sun.jersey.spi.container.ResourceFilterFactory;
-import com.sun.jersey.spi.container.ResourceFilters;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class AnnotationResourceFilterFactory implements ResourceFilterFactory {
- private FilterFactory ff;
-
- public AnnotationResourceFilterFactory(FilterFactory ff) {
- this.ff = ff;
- }
-
- public List<ResourceFilter> create(AbstractMethod am) {
- ResourceFilters rfs = am.getAnnotation(ResourceFilters.class);
- if (rfs == null)
- rfs = am.getResource().getAnnotation(ResourceFilters.class);
- if (rfs == null)
- return null;
-
- return getResourceFilters(rfs.value());
- }
-
- private List<ResourceFilter> getResourceFilters(Class<? extends ResourceFilter>[] classes) {
- if (classes == null || classes.length == 0)
- return null;
-
- return ff.getResourceFilters(classes);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/FilterFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/FilterFactory.java
deleted file mode 100644
index e946ecfeec7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/FilterFactory.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.container.filter;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.container.ResourceFilter;
-import com.sun.jersey.spi.container.ResourceFilterFactory;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Logger;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class FilterFactory {
- private static final Logger LOGGER = Logger.getLogger(FilterFactory.class.getName());
-
- private final ProviderServices providerServices;
-
- private final List<ContainerRequestFilter> requestFilters = new LinkedList<ContainerRequestFilter>();
-
- private final List<ContainerResponseFilter> responseFilters = new LinkedList<ContainerResponseFilter>();
-
- private final List<ResourceFilterFactory> resourceFilterFactories = new LinkedList<ResourceFilterFactory>();
-
- public FilterFactory(ProviderServices providerServices) {
- this.providerServices = providerServices;
- }
-
- public void init(ResourceConfig resourceConfig) {
- // Initiate request filters
- requestFilters.addAll(
- getFilters(ContainerRequestFilter.class,resourceConfig.getContainerRequestFilters())
- );
-
- requestFilters.addAll(providerServices.getServices(ContainerRequestFilter.class));
-
- // Initiate response filters
- responseFilters.addAll(
- getFilters(ContainerResponseFilter.class, resourceConfig.getContainerResponseFilters())
- );
-
- responseFilters.addAll(providerServices.getServices(ContainerResponseFilter.class));
-
- // Initiate resource filter factories
- resourceFilterFactories.addAll(
- getFilters(ResourceFilterFactory.class, resourceConfig.getResourceFilterFactories())
- );
-
- resourceFilterFactories.addAll(providerServices.getServices(ResourceFilterFactory.class));
- resourceFilterFactories.add(new AnnotationResourceFilterFactory(this));
- }
-
- public List<ContainerRequestFilter> getRequestFilters() {
- return requestFilters;
- }
-
- public List<ContainerResponseFilter> getResponseFilters() {
- return responseFilters;
- }
-
- public List<ResourceFilter> getResourceFilters(AbstractMethod am) {
- List<ResourceFilter> resourceFilters = new LinkedList<ResourceFilter>();
- for (ResourceFilterFactory rff : resourceFilterFactories) {
- List<ResourceFilter> rfs = rff.create(am);
- if (rfs != null)
- resourceFilters.addAll(rfs);
- }
- return resourceFilters;
- }
-
- public List<ResourceFilter> getResourceFilters(Class<? extends ResourceFilter>[] classes) {
- if (classes == null || classes.length == 0)
- return Collections.EMPTY_LIST;
-
- return providerServices.getInstances(ResourceFilter.class, classes);
- }
-
- public static List<ContainerRequestFilter> getRequestFilters(List<ResourceFilter> resourceFilters) {
- final List<ContainerRequestFilter> filters = new LinkedList<ContainerRequestFilter>();
- for (ResourceFilter rf : resourceFilters) {
- ContainerRequestFilter crf = rf.getRequestFilter();
- if (crf != null)
- filters.add(crf);
- }
- return filters;
- }
-
- public static List<ContainerResponseFilter> getResponseFilters(List<ResourceFilter> resourceFilters) {
- final List<ContainerResponseFilter> filters = new LinkedList<ContainerResponseFilter>();
- for (ResourceFilter rf : resourceFilters) {
- ContainerResponseFilter crf = rf.getResponseFilter();
- if (crf != null)
- filters.add(crf);
- }
- return filters;
- }
-
- private <T> List<T> getFilters(Class<T> c, List<?> l) {
- List<T> f = new LinkedList<T>();
- for (Object o : l) {
- if (o instanceof String) {
- f.addAll(providerServices.getInstances(c,
- ResourceConfig.getElements(new String[] {(String)o}, ResourceConfig.COMMON_DELIMITERS)));
- } else if (o instanceof String[]) {
- f.addAll(providerServices.getInstances(c,
- ResourceConfig.getElements((String[])o, ResourceConfig.COMMON_DELIMITERS)));
- } else if (c.isInstance(o)) {
- f.add(c.cast(o));
- } else if (o instanceof Class) {
- Class fc = (Class)o;
- if (c.isAssignableFrom(fc)) {
- f.addAll(providerServices.getInstances(c, new Class[] {fc}));
- } else {
- LOGGER.severe("The filter, of type" +
- o.getClass().getName() +
- ", MUST be of the type Class<? extends" + c.getName() + ">" +
- ". The filter is ignored.");
- }
- } else {
- LOGGER.severe("The filter, of type" +
- o.getClass().getName() +
- ", MUST be of the type String, String[], Class<? extends " + c.getName() + ">, or an instance of " + c.getName() +
- ". The filter is ignored.");
- }
- }
- providerServices.getComponentProviderFactory().injectOnProviderInstances(f);
- return f;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/NormalizeFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/NormalizeFilter.java
deleted file mode 100644
index b8cb7b77f58..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/filter/NormalizeFilter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.container.filter;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.server.impl.uri.UriHelper;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import java.net.URI;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class NormalizeFilter implements ContainerRequestFilter {
- @Context ResourceConfig resourceConfig;
-
- public ContainerRequest filter(ContainerRequest request) {
- if (resourceConfig.getFeature(ResourceConfig.FEATURE_NORMALIZE_URI)) {
- final URI uri = request.getRequestUri();
- final URI normalizedUri = UriHelper.normalize(uri,
- !resourceConfig.getFeature(ResourceConfig.FEATURE_CANONICALIZE_URI_PATH));
-
- if (uri != normalizedUri) {
- if (resourceConfig.getFeature(ResourceConfig.FEATURE_REDIRECT)) {
- throw new WebApplicationException(
- Response.temporaryRedirect(normalizedUri).build());
- } else {
- final URI baseUri = UriHelper.normalize(request.getBaseUri(),
- !resourceConfig.getFeature(ResourceConfig.FEATURE_CANONICALIZE_URI_PATH));
- request.setUris(baseUri, normalizedUri);
- }
- }
- }
- return request;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.java
deleted file mode 100644
index 6f0f8d8263d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.grizzly;
-
-import com.sun.grizzly.tcp.http11.GrizzlyAdapter;
-import com.sun.grizzly.tcp.http11.GrizzlyRequest;
-import com.sun.grizzly.tcp.http11.GrizzlyResponse;
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.container.grizzly.GrizzlyServerFactory;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.header.InBoundHeaders;
-import com.sun.jersey.server.impl.ThreadLocalInvoker;
-import com.sun.jersey.spi.container.ContainerListener;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseWriter;
-import com.sun.jersey.spi.container.ReloadListener;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.GenericEntity;
-
-/**
- *
- * @author Marc.Hadley@Sun.Com
- */
-public final class GrizzlyContainer extends GrizzlyAdapter implements ContainerListener {
-
- private WebApplication application;
-
- private String basePath = "/";
-
- private final ThreadLocalInvoker<GrizzlyRequest> requestInvoker =
- new ThreadLocalInvoker<GrizzlyRequest>();
-
- private final ThreadLocalInvoker<GrizzlyResponse> responseInvoker =
- new ThreadLocalInvoker<GrizzlyResponse>();
-
- private static class ContextInjectableProvider<T> extends
- SingletonTypeInjectableProvider<Context, T> {
-
- protected ContextInjectableProvider(Type type, T instance) {
- super(type, instance);
- }
- }
-
- public GrizzlyContainer(ResourceConfig rc, WebApplication app) throws ContainerException {
- this.application = app;
-
- setAllowEncodedSlash(rc.getFeature(GrizzlyServerFactory.FEATURE_ALLOW_ENCODED_SLASH));
-
- GenericEntity<ThreadLocal<GrizzlyRequest>> requestThreadLocal =
- new GenericEntity<ThreadLocal<GrizzlyRequest>>(requestInvoker.getImmutableThreadLocal()) {};
- rc.getSingletons().add(new ContextInjectableProvider<ThreadLocal<GrizzlyRequest>>(
- requestThreadLocal.getType(), requestThreadLocal.getEntity()));
-
- GenericEntity<ThreadLocal<GrizzlyResponse>> responseThreadLocal =
- new GenericEntity<ThreadLocal<GrizzlyResponse>>(responseInvoker.getImmutableThreadLocal()) {};
- rc.getSingletons().add(new ContextInjectableProvider<ThreadLocal<GrizzlyResponse>>(
- responseThreadLocal.getType(), responseThreadLocal.getEntity()));
- }
-
- private final static class Writer implements ContainerResponseWriter {
- final GrizzlyResponse response;
-
- Writer(GrizzlyResponse response) {
- this.response = response;
- }
-
- public OutputStream writeStatusAndHeaders(long contentLength,
- ContainerResponse cResponse) throws IOException {
- response.setStatus(cResponse.getStatus());
-
- if (contentLength != -1 && contentLength < Integer.MAX_VALUE)
- response.setContentLength((int)contentLength);
-
- for (Map.Entry<String, List<Object>> e : cResponse.getHttpHeaders().entrySet()) {
- for (Object value : e.getValue()) {
- response.addHeader(e.getKey(), ContainerResponse.getHeaderValue(value));
- }
- }
-
- String contentType = response.getHeader("Content-Type");
- if (contentType != null) {
- response.setContentType(contentType);
- }
-
- return response.getOutputStream();
- }
-
- public void finish() throws IOException {
- }
- }
-
- public void service(GrizzlyRequest request, GrizzlyResponse response) {
- try {
- requestInvoker.set(request);
- responseInvoker.set(response);
-
- _service(request, response);
- } finally {
- requestInvoker.set(null);
- responseInvoker.set(null);
- }
- }
-
- private void _service(GrizzlyRequest request, GrizzlyResponse response) {
- WebApplication _application = application;
-
- final URI baseUri = getBaseUri(request);
- /*
- * request.unparsedURI() is a URI in encoded form that contains
- * the URI path and URI query components.
- */
- final URI requestUri = baseUri.resolve(
- request.getRequest().unparsedURI().toString());
-
- /**
- * Check if the request URI path starts with the base URI path
- */
- if (!requestUri.getRawPath().startsWith(basePath)) {
- response.setStatus(404);
- return;
- }
-
- try {
- final ContainerRequest cRequest = new ContainerRequest(
- _application,
- request.getMethod(),
- baseUri,
- requestUri,
- getHeaders(request),
- request.getInputStream());
-
- _application.handleRequest(cRequest, new Writer(response));
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- @Override
- public void afterService(GrizzlyRequest request, GrizzlyResponse response)
- throws Exception {
- }
-
- @Override
- public void setResourcesContextPath(String resourcesContextPath) {
- super.setResourcesContextPath(resourcesContextPath);
-
- if (resourcesContextPath == null || resourcesContextPath.length() == 0) {
- basePath = "/";
- } else if (resourcesContextPath.charAt(resourcesContextPath.length() - 1) != '/') {
- basePath = resourcesContextPath + "/";
- } else {
- basePath = resourcesContextPath;
- }
-
- if (basePath.charAt(0) != '/')
- throw new IllegalArgumentException("The resource context path, " + resourcesContextPath +
- ", must start with a '/'");
- }
-
- private URI getBaseUri(GrizzlyRequest request) {
- try {
- return new URI(
- request.getScheme(),
- null,
- request.getServerName(),
- request.getServerPort(),
- basePath,
- null, null);
- } catch (URISyntaxException ex) {
- throw new IllegalArgumentException(ex);
- }
- }
-
- private InBoundHeaders getHeaders(GrizzlyRequest request) {
- InBoundHeaders rh = new InBoundHeaders();
-
- Enumeration names = request.getHeaderNames();
- while (names.hasMoreElements()) {
- String name = (String)names.nextElement();
- String value = request.getHeader(name);
- rh.add(name, value);
- }
-
- return rh;
- }
-
- // ContainerListener
-
- @Override
- public void onReload() {
- WebApplication oldApplication = application;
- application = application.clone();
-
- if (application.getFeaturesAndProperties() instanceof ReloadListener)
- ((ReloadListener) application.getFeaturesAndProperties()).onReload();
-
- oldApplication.destroy();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.java
deleted file mode 100644
index 6a4e9384086..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.grizzly;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.spi.container.ContainerProvider;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.grizzly.tcp.Adapter;
-
-/**
- *
- * @author Marc.Hadley@Sun.Com
- */
-public class GrizzlyContainerProvider implements ContainerProvider<Adapter> {
-
- public GrizzlyContainerProvider() {
- Class<?> c = Adapter.class;
- }
-
- public Adapter createContainer(Class<Adapter> type,
- ResourceConfig resourceConfig,
- WebApplication application) throws ContainerException {
- if (type != Adapter.class)
- return null;
-
- return new GrizzlyContainer(resourceConfig, application);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.java
deleted file mode 100644
index 0a5b8fe8f5f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.httpserver;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.core.header.InBoundHeaders;
-import com.sun.jersey.server.impl.application.WebApplicationImpl;
-import com.sun.jersey.spi.container.ContainerListener;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseWriter;
-import com.sun.jersey.spi.container.ReloadListener;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.net.httpserver.Headers;
-import com.sun.net.httpserver.HttpExchange;
-import com.sun.net.httpserver.HttpHandler;
-import com.sun.net.httpserver.HttpsExchange;
-
-import javax.ws.rs.core.UriBuilder;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * A {@link HttpHandler} for a {@link WebApplicationImpl}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class HttpHandlerContainer implements HttpHandler, ContainerListener {
-
- private WebApplication application;
-
- public HttpHandlerContainer(WebApplication app) throws ContainerException {
- this.application = app;
- }
-
- private final static class Writer implements ContainerResponseWriter {
- final HttpExchange exchange;
-
- Writer(HttpExchange exchange) {
- this.exchange = exchange;
- }
-
- public OutputStream writeStatusAndHeaders(long contentLength,
- ContainerResponse cResponse) throws IOException {
- Headers eh = exchange.getResponseHeaders();
- for (Map.Entry<String, List<Object>> e : cResponse.getHttpHeaders().entrySet()) {
- List<String> values = new ArrayList<String>();
- for (Object v : e.getValue())
- values.add(ContainerResponse.getHeaderValue(v));
- eh.put(e.getKey(), values);
- }
-
- if (cResponse.getStatus() == 204) {
- // Work around bug in LW HTTP server
- // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6886436
- exchange.sendResponseHeaders(cResponse.getStatus(), -1);
- } else {
- exchange.sendResponseHeaders(cResponse.getStatus(),
- getResponseLength(contentLength));
- }
- return exchange.getResponseBody();
- }
-
- public void finish() throws IOException {
- }
-
- private long getResponseLength(long contentLength) {
- if (contentLength == 0)
- return -1;
- if (contentLength < 0)
- return 0;
- return contentLength;
- }
- }
-
- public void handle(HttpExchange exchange) throws IOException {
- WebApplication _application = application;
-
- /**
- * This is a URI that contains the path, query and
- * fragment components.
- */
- URI exchangeUri = exchange.getRequestURI();
-
- /**
- * The base path specified by the HTTP context of the HTTP handler.
- * It is in decoded form.
- */
- String decodedBasePath = exchange.getHttpContext().getPath();
-
- // Ensure that the base path ends with a '/'
- if (!decodedBasePath.endsWith("/")) {
- if (decodedBasePath.equals(exchangeUri.getPath())) {
- /**
- * This is an edge case where the request path
- * does not end in a '/' and is equal to the context
- * path of the HTTP handler.
- * Both the request path and base path need to end in a '/'
- * Currently the request path is modified.
- * TODO support redirection in accordance with resource
- * configuration feature.
- */
- exchangeUri = UriBuilder.fromUri(exchangeUri).
- path("/").build();
- }
- decodedBasePath += "/";
- }
-
- /*
- * The following is madness, there is no easy way to get
- * the complete URI of the HTTP request!!
- *
- * TODO this is missing the user information component, how
- * can this be obtained?
- */
- String scheme = (exchange instanceof HttpsExchange) ? "https" : "http";
-
- URI baseUri = null;
- try {
- List<String> hostHeader = exchange.getRequestHeaders().get("Host");
- if (hostHeader != null) {
- StringBuilder sb = new StringBuilder(scheme);
- sb.append("://").append(hostHeader.get(0)).append(decodedBasePath);
- baseUri = new URI(sb.toString());
- } else {
- InetSocketAddress addr = exchange.getLocalAddress();
- baseUri = new URI(scheme, null, addr.getHostName(), addr.getPort(),
- decodedBasePath, null, null);
- }
- } catch (URISyntaxException ex) {
- throw new IllegalArgumentException(ex);
- }
-
- final URI requestUri = baseUri.resolve(exchangeUri);
-
- final ContainerRequest cRequest = new ContainerRequest(
- _application,
- exchange.getRequestMethod(),
- baseUri,
- requestUri,
- getHeaders(exchange),
- exchange.getRequestBody()
- );
-
- try {
- _application.handleRequest(cRequest, new Writer(exchange));
- } catch (RuntimeException e) {
- e.printStackTrace();
- exchange.getResponseHeaders().clear();
- exchange.sendResponseHeaders(500, -1);
- } catch (IOException ex) {
- ex.printStackTrace();
- exchange.getResponseHeaders().clear();
- exchange.sendResponseHeaders(500, -1);
- throw ex;
- }
- exchange.getResponseBody().flush();
- exchange.close();
- }
-
- private InBoundHeaders getHeaders(HttpExchange exchange) {
- InBoundHeaders rh = new InBoundHeaders();
-
- Headers eh = exchange.getRequestHeaders();
- for (Entry<String, List<String>> e : eh.entrySet()) {
- rh.put(e.getKey(), e.getValue());
- }
-
- return rh;
- }
-
- // ContainerListener
-
- public void onReload() {
- WebApplication oldApplication = application;
- application = application.clone();
-
- if (application.getFeaturesAndProperties() instanceof ReloadListener)
- ((ReloadListener) application.getFeaturesAndProperties()).onReload();
-
- oldApplication.destroy();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.java
deleted file mode 100644
index b961f54c1a1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.httpserver;
-
-import com.sun.net.httpserver.HttpHandler;
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.spi.container.ContainerProvider;
-import com.sun.jersey.spi.container.WebApplication;
-
-/**
- * HTTP handler container provider.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class HttpHandlerContainerProvider implements ContainerProvider<HttpHandler> {
-
- public HttpHandler createContainer(
- Class<HttpHandler> type,
- ResourceConfig resourceConfig,
- WebApplication application) throws ContainerException {
- if (type != HttpHandler.class)
- return null;
-
- return new HttpHandlerContainer(application);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/Include.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/Include.java
deleted file mode 100644
index d8411a24233..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/Include.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.container.servlet;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.tagext.SimpleTagSupport;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-/**
- * Includes a side JSP file for the "resolvingClass" class.
- *
- * <p>
- * This tag looks for a side JSP file of the given name
- * from the inheritance hierarchy of the "resolvingClass" class,
- * and includes the contents of it, just like &lt;jsp:include>.
- *
- * <p>
- * For example, if the "resolvingClass" class is the <tt>Foo</tt> class,
- * which looks like the following:
- *
- * <pre>
- * class Foo extends Bar { ... }
- * class Bar extends Zot { ... }
- * </pre>
- *
- * <p>
- * And if you write:
- * <pre><xmp>
- * <st:include page="abc.jsp"/>
- * </xmp></pre>
- * then, it looks for the following files in this order,
- * and includes the first one found.
- * <ol>
- * <li>a side-file of the Foo class named abc.jsp (/WEB-INF/Foo/abc.jsp)
- * <li>a side-file of the Bar class named abc.jsp (/WEB-INF/Bar/abc.jsp)
- * <li>a side-file of the Zot class named abc.jsp (/WEB-INF/Zot/abc.jsp)
- * </ol>
- *
- * @author Kohsuke Kawaguchi
- * @author Paul.Sandoz@Sun.Com
- */
-public class Include extends SimpleTagSupport {
-
- private Class<?> resolvingClass;
- private String page;
-
- /**
- * Specifies the name of the JSP to be included.
- */
- public void setPage(String page) {
- this.page = page;
- }
-
- /**
- * Specifies the resolving class for which JSP will be included.
- */
- public void setResolvingClass(Class<?> resolvingClass) {
- this.resolvingClass = resolvingClass;
- }
-
- private Object getPageObject(String name) {
- return getJspContext().getAttribute(name, PageContext.PAGE_SCOPE);
- }
-
- public void doTag() throws JspException, IOException {
- Class<?> resolvingClass = (Class<?>)getJspContext().getAttribute("resolvingClass", PageContext.REQUEST_SCOPE);
- final Class<?> oldResolvingClass = resolvingClass;
- if (this.resolvingClass != null) {
- resolvingClass = this.resolvingClass;
- }
-
- ServletConfig cfg = (ServletConfig) getPageObject(PageContext.CONFIG);
- ServletContext sc = cfg.getServletContext();
-
- String basePath = (String)getJspContext().getAttribute("_basePath", PageContext.REQUEST_SCOPE);
- for (Class c = resolvingClass; c != Object.class; c = c.getSuperclass()) {
- String name = basePath + "/" + c.getName().replace('.', '/') + '/' + page;
- if (sc.getResource(name) != null) {
- // Tomcat returns a RequestDispatcher even if the JSP file doesn't exist.
- // so check if the resource exists first.
- RequestDispatcher disp = sc.getRequestDispatcher(name);
- if (disp != null) {
- getJspContext().setAttribute("resolvingClass", resolvingClass, PageContext.REQUEST_SCOPE);
- try {
- HttpServletRequest request = (HttpServletRequest) getPageObject(PageContext.REQUEST);
- disp.include(
- request,
- new Wrapper(
- (HttpServletResponse) getPageObject(PageContext.RESPONSE),
- new PrintWriter(getJspContext().getOut())));
- } catch (ServletException e) {
- throw new JspException(e);
- } finally {
- getJspContext().setAttribute("resolvingClass", oldResolvingClass, PageContext.REQUEST_SCOPE);
- }
- return;
- }
- }
- }
-
- throw new JspException("Unable to find '" + page + "' for " + resolvingClass);
- }
-}
-
-class Wrapper extends HttpServletResponseWrapper {
-
- private final PrintWriter pw;
-
- public Wrapper(HttpServletResponse httpServletResponse, PrintWriter w) {
- super(httpServletResponse);
- this.pw = w;
- }
-
- public PrintWriter getWriter() throws IOException {
- return pw;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.java
deleted file mode 100644
index a139cb13a62..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.servlet;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.view.Viewable;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.spi.container.servlet.ServletContainer;
-import com.sun.jersey.spi.template.ViewProcessor;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Context;
-
-/**
- * A JSP template processor.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class JSPTemplateProcessor implements ViewProcessor<String> {
- private @Context HttpContext hc;
-
- private @Context ServletContext servletContext;
-
- private @Context ThreadLocal<HttpServletRequest> requestInvoker;
-
- private @Context ThreadLocal<HttpServletResponse> responseInvoker;
-
- private final String basePath;
-
- public JSPTemplateProcessor(
- @Context ResourceConfig resourceConfig) {
-
- String path = (String)resourceConfig.getProperties().get(
- ServletContainer.JSP_TEMPLATES_BASE_PATH);
- if (path == null)
- this.basePath = "";
- else if (path.charAt(0) == '/') {
- this.basePath = path;
- } else {
- this.basePath = "/" + path;
- }
- }
-
- public String resolve(String path) {
- if (servletContext == null)
- return null;
-
- if (basePath != "")
- path = basePath + path;
-
- try {
- if (servletContext.getResource(path) != null) {
- return path;
- }
-
- if (!path.endsWith(".jsp")) {
- path = path + ".jsp";
- if (servletContext.getResource(path) != null) {
- return path;
- }
- }
- } catch (MalformedURLException ex) {
- // TODO log
- }
-
- return null;
- }
-
- public void writeTo(String resolvedPath, Viewable viewable, OutputStream out) throws IOException {
- if (hc.isTracingEnabled()) {
- hc.trace(String.format("forwarding view to JSP page: \"%s\", it = %s",
- resolvedPath,
- ReflectionHelper.objectToString(viewable.getModel())));
- }
-
- // Commit the status and headers to the HttpServletResponse
- out.flush();
-
- RequestDispatcher d = servletContext.getRequestDispatcher(resolvedPath);
- if (d == null) {
- throw new ContainerException("No request dispatcher for: " + resolvedPath);
- }
-
- d = new RequestDispatcherWrapper(d, basePath, hc, viewable);
-
- try {
- d.forward(requestInvoker.get(), responseInvoker.get());
- } catch (Exception e) {
- throw new ContainerException(e);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.java
deleted file mode 100644
index a4e3d140d89..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.container.servlet;
-
-import com.sun.jersey.api.core.DefaultResourceConfig;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.server.impl.application.DeferredResourceConfig;
-import com.sun.jersey.spi.container.servlet.ServletContainer;
-
-import javax.servlet.ServletContainerInitializer;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletRegistration;
-import javax.servlet.annotation.HandlesTypes;
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.Provider;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-
-/*
-It is RECOMMENDED that implementations support the Servlet 3 framework
- pluggability mechanism to enable portability between containers and to avail
- themselves of container-supplied class scanning facilities.
- When using the pluggability mechanism the following conditions MUST be met:
-
-- If no Application subclass is present the added servlet MUST be
- named "javax.ws.rs.core.Application" and all root resource classes and
- providers packaged in the web application MUST be included in the published
- JAX-RS application. The application MUST be packaged with a web.xml that
- specifies a servlet mapping for the added servlet.
-
-- If an Application subclass is present and there is already a servlet defined
- that has a servlet initialization parameter named "javax.ws.rs.Application"
- whose value is the fully qualified name of the Application subclass then no
- servlet should be added by the JAX-RS implementation's ContainerInitializer
- since the application is already being handled by an existing servlet.
-
-- If an application subclass is present that is not being handled by an
- existing servlet then the servlet added by the ContainerInitializer MUST be
- named with the fully qualified name of the Application subclass. If the
- Application subclass is annotated with @PathPrefix and no servlet-mapping
- exists for the added servlet then a new servlet mapping is added with the
- value of the @PathPrefix annotation with "/*" appended otherwise the existing
- mapping is used. If the Application subclass is not annotated with @PathPrefix
- then the application MUST be packaged with a web.xml that specifies a servlet
- mapping for the added servlet. It is an error for more than one Application
- to be deployed at the same effective servlet mapping.
-
-In either of the latter two cases, if both Application#getClasses and
- Application#getSingletons return an empty list then all root resource classes
- and providers packaged in the web application MUST be included in the
- published JAX-RS application. If either getClasses or getSingletons return a
- non-empty list then only those classes or singletons returned MUST be included
- in the published JAX-RS application.
-
-If not using the Servlet 3 framework pluggability mechanism
- (e.g. in a pre-Servet 3.0 container), the servlet-class or filter-class
- element of the web.xml descriptor SHOULD name the JAX-RS
- implementation-supplied Servlet or Filter class respectively. The
- application-supplied subclass of Application SHOULD be identied using an
- init-param with a param-name of javax.ws.rs.Application.
-
- */
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@HandlesTypes({Path.class, Provider.class, Application.class, ApplicationPath.class})
-public class JerseyServletContainerInitializer implements ServletContainerInitializer {
-
- private static final Logger LOGGER =
- Logger.getLogger(JerseyServletContainerInitializer.class.getName());
-
- @Override
- public void onStartup(Set<Class<?>> classes, ServletContext sc) {
- if (classes == null) {
- classes = Collections.<Class<?>>emptySet();
- }
- final int nOfRegisterations = sc.getServletRegistrations().size();
- for (Class<? extends Application> a : getApplicationClasses(classes)) {
- final ServletRegistration appReg = sc.getServletRegistration(a.getName());
- if (appReg != null) {
- // Servlet is registered with app name
-
- addServletWithExistingRegistration(sc, appReg, a, classes);
- } else {
- // Servlet is not registered with app name
-
- final List<ServletRegistration> srs = getInitParamDeclaredRegistrations(sc, a);
- if (!srs.isEmpty()) {
- // List of servlets registered with app name in init param
-
- for (ServletRegistration sr : srs) {
- addServletWithExistingRegistration(sc, sr, a, classes);
- }
- } else {
- addServletWithApplication(sc, a, classes);
- }
- }
- }
-
- if (nOfRegisterations == sc.getServletRegistrations().size()) {
- // No app was registered
- addServletWithDefaultConfiguration(sc, classes);
- }
- }
-
- private List<ServletRegistration> getInitParamDeclaredRegistrations(ServletContext sc, Class<? extends Application> a) {
- final List<ServletRegistration> srs = new ArrayList<ServletRegistration>(1);
- for (ServletRegistration sr : sc.getServletRegistrations().values()) {
-
- Map<String, String> ips = sr.getInitParameters();
- if (ips.containsKey(ServletContainer.APPLICATION_CONFIG_CLASS)) {
- if (ips.get(ServletContainer.APPLICATION_CONFIG_CLASS).equals(a.getName())) {
- if (sr.getClassName() == null) {
- srs.add(sr);
- }
- }
- } else if (ips.containsKey(ServletContainer.RESOURCE_CONFIG_CLASS)) {
- if (ips.get(ServletContainer.RESOURCE_CONFIG_CLASS).equals(a.getName())) {
- if (sr.getClassName() == null) {
- srs.add(sr);
- }
- }
- }
- }
-
- return srs;
- }
-
- private void addServletWithDefaultConfiguration(ServletContext sc, Set<Class<?>> classes) {
- ServletRegistration appReg = sc.getServletRegistration(Application.class.getName());
- if (appReg != null && appReg.getClassName() == null) {
- final Set<Class<?>> x = getRootResourceAndProviderClasses(classes);
- final ServletContainer s = new ServletContainer(
- new DefaultResourceConfig(x));
- appReg = sc.addServlet(appReg.getName(), s);
-
- if (appReg.getMappings().isEmpty()) {
- // Error
- LOGGER.severe("The Jersey servlet application, named " +
- appReg.getName() +
- ", has no servlet mapping");
- } else {
- LOGGER.info("Registering the Jersey servlet application, named " +
- appReg.getName() +
- ", with the following root resource and provider classes: " + x);
- }
- }
- }
-
- private void addServletWithApplication(ServletContext sc,
- Class<? extends Application> a, Set<Class<?>> classes) {
- final ApplicationPath ap = a.getAnnotation(ApplicationPath.class);
- if (ap != null) {
- // App is annotated with ApplicationPath
-
- final ServletContainer s = new ServletContainer(
- new DeferredResourceConfig(a, getRootResourceAndProviderClasses(classes)));
-
- final String mapping = createMappingPath(ap);
- if (!mappingExists(sc, mapping)) {
- sc.addServlet(a.getName(), s).
- addMapping(mapping);
-
- LOGGER.info("Registering the Jersey servlet application, named " +
- a.getName() +
- ", at the servlet mapping, "
- + mapping +
- ", with the Application class of the same name");
- } else {
- LOGGER.severe("Mapping conflict. " +
- "A Servlet declaration exists with same mapping as the Jersey servlet application, named " +
- a.getName() +
- ", at the servlet mapping, "
- + mapping +
- ". The Jersey servlet is not deployed.");
- }
- }
- }
-
- private void addServletWithExistingRegistration(ServletContext sc, ServletRegistration sr,
- Class<? extends Application> a, Set<Class<?>> classes) {
- if (sr.getClassName() == null) {
-
- final ResourceConfig rc = new DeferredResourceConfig(a, getRootResourceAndProviderClasses(classes));
- final Map<String, Object> initParams = new HashMap<String, Object>();
- for(Map.Entry<String, String> entry : sr.getInitParameters().entrySet())
- initParams.put(entry.getKey(), entry.getValue());
-
- rc.setPropertiesAndFeatures(initParams);
-
- final ServletContainer s = new ServletContainer(rc);
- sr = sc.addServlet(a.getName(), s);
- if (sr.getMappings().isEmpty()) {
- final ApplicationPath ap = a.getAnnotation(ApplicationPath.class);
- if (ap != null) {
- final String mapping = createMappingPath(ap);
- if (!mappingExists(sc, mapping)) {
- sr.addMapping(mapping);
-
- LOGGER.info("Registering the Jersey servlet application, named " +
- a.getName() +
- ", at the servlet mapping, "
- + mapping +
- ", with the Application class of the same name");
- } else {
- LOGGER.severe("Mapping conflict. " +
- "A Servlet registration exists with same mapping as the Jersey servlet application, named " +
- a.getName() +
- ", at the servlet mapping, "
- + mapping +
- ". The Jersey servlet is not deployed.");
- }
- } else {
- // Error
- LOGGER.severe("The Jersey servlet application, named " +
- a.getName() +
- ", is not annotated with " + ApplicationPath.class.getSimpleName() + " " +
- "and has no servlet mapping");
- }
- } else {
- LOGGER.info("Registering the Jersey servlet application, named " +
- a.getName() +
- ", with the Application class of the same name");
- }
- }
- }
-
- private boolean mappingExists(ServletContext sc, String mapping) {
- for (ServletRegistration sr : sc.getServletRegistrations().values()) {
- for (String declaredMapping : sr.getMappings()) {
- if (mapping.equals(declaredMapping)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- private String createMappingPath(ApplicationPath ap) {
- String path = ap.value();
- if (!path.startsWith("/")) {
- path = "/" + path;
- }
-
- if (!path.endsWith("/*")) {
- if (path.endsWith("/")) {
- path += "*";
- } else {
- path += "/*";
- }
- }
-
- return path;
- }
-
- private Set<Class<? extends Application>> getApplicationClasses(Set<Class<?>> classes) {
- Set<Class<? extends Application>> s = new LinkedHashSet<Class<? extends Application>>();
- for (Class<?> c : classes) {
- if (Application.class != c && Application.class.isAssignableFrom(c)) {
- s.add(c.asSubclass(Application.class));
- }
- }
-
- return s;
- }
-
- private Set<Class<?>> getRootResourceAndProviderClasses(Set<Class<?>> classes) {
- // TODO filter out any classes from the Jersey jars
- Set<Class<?>> s = new LinkedHashSet<Class<?>>();
- for (Class<?> c : classes) {
- if (c.isAnnotationPresent(Path.class) || c.isAnnotationPresent(Provider.class))
- s.add(c);
- }
-
- return s;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.java
deleted file mode 100644
index 2c41ed8aba1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.servlet;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCInstantiatedComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCProxiedComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCDestroyable;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.server.spi.component.ResourceComponentConstructor;
-import com.sun.jersey.server.spi.component.ResourceComponentDestructor;
-import com.sun.jersey.server.spi.component.ResourceComponentInjector;
-import com.sun.jersey.server.spi.component.ResourceComponentProvider;
-import com.sun.jersey.server.spi.component.ResourceComponentProviderFactory;
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-
-/**
- * A provider that maintains a per session resource class instance
- */
-public final class PerSessionFactory implements ResourceComponentProviderFactory {
-
- private final ServerInjectableProviderContext sipc;
-
- private final ServletContext sc;
-
- private final HttpServletRequest hsr;
-
- private final HttpContext threadLocalHc;
-
- private final String abstractPerSessionMapPropertyName;
-
- private final ConcurrentHashMap<Class, AbstractPerSession> abstractPerSessionMap =
- new ConcurrentHashMap<Class, AbstractPerSession>();
-
- public PerSessionFactory(
- @Context ServerInjectableProviderContext sipc,
- @Context ServletContext sc,
- @Context HttpServletRequest hsr,
- @Context HttpContext threadLocalHc) {
- this.hsr = hsr;
- this.sc = sc;
- this.sipc = sipc;
- this.threadLocalHc = threadLocalHc;
-
- abstractPerSessionMapPropertyName = this.toString();
-
- sc.setAttribute(abstractPerSessionMapPropertyName, abstractPerSessionMap);
- }
-
- @Override
- public ComponentScope getScope(Class c) {
- return ComponentScope.Undefined;
- }
-
- @Override
- public ResourceComponentProvider getComponentProvider(Class c) {
- return new PerSesson();
- }
-
- @Override
- public ResourceComponentProvider getComponentProvider(IoCComponentProvider icp, Class c) {
- if (icp instanceof IoCInstantiatedComponentProvider) {
- return new PerSessonInstantiated((IoCInstantiatedComponentProvider)icp);
- } else if (icp instanceof IoCProxiedComponentProvider) {
- return new PerSessonProxied((IoCProxiedComponentProvider)icp);
- }
- throw new IllegalStateException();
- }
-
- private static class SessionMap extends HashMap<String, Object>
- implements HttpSessionBindingListener {
-
- private final String abstractPerSessionMapPropertyName;
-
- SessionMap(String abstractPerSessionMapPropertyName) {
- this.abstractPerSessionMapPropertyName = abstractPerSessionMapPropertyName;
- }
-
- @Override
- public void valueBound(HttpSessionBindingEvent hsbe) {
- }
-
- @Override
- public void valueUnbound(HttpSessionBindingEvent hsbe) {
- final ServletContext sc = hsbe.getSession().getServletContext();
- final Map<Class, AbstractPerSession> abstractPerSessionMap =
- (Map<Class, AbstractPerSession>)sc.getAttribute(abstractPerSessionMapPropertyName);
-
- for (final Object o : values()) {
- final AbstractPerSession aps = abstractPerSessionMap.get(o.getClass());
- if (aps != null) {
- aps.destroy(o);
- }
- }
- }
- }
-
- private abstract class AbstractPerSession implements ResourceComponentProvider {
- private static final String SCOPE_PER_SESSION = "com.sun.jersey.scope.PerSession";
-
- private ResourceComponentDestructor rcd;
-
- private Class c;
-
- @Override
- public void init(AbstractResource abstractResource) {
- this.rcd = new ResourceComponentDestructor(abstractResource);
- this.c = abstractResource.getResourceClass();
- }
-
- @Override
- public final Object getInstance() {
- return getInstance(threadLocalHc);
- }
-
- @Override
- public final ComponentScope getScope() {
- return ComponentScope.Undefined;
- }
-
- @Override
- public final Object getInstance(HttpContext hc) {
- HttpSession hs = hsr.getSession();
-
- synchronized(hs) {
- SessionMap sm = (SessionMap)hs.getAttribute(SCOPE_PER_SESSION);
- if (sm == null) {
- sm = new SessionMap(abstractPerSessionMapPropertyName);
- hs.setAttribute(SCOPE_PER_SESSION, sm);
- }
-
- abstractPerSessionMap.putIfAbsent(c, this);
-
- Object o = sm.get(c.getName());
- if (o != null) {
- return o;
- }
-
- o = _getInstance(hc);
- sm.put(c.getName(), o);
- return o;
- }
- }
-
- protected abstract Object _getInstance(HttpContext hc);
-
- @Override
- public final void destroy() {
- }
-
- public void destroy(Object o) {
- try {
- rcd.destroy(o);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to destroy resource", ex);
- } catch (InvocationTargetException ex) {
- throw new ContainerException("Unable to destroy resource", ex);
- } catch (RuntimeException ex) {
- throw new ContainerException("Unable to destroy resource", ex);
- }
- }
- }
-
- private final class PerSesson extends AbstractPerSession {
- private ResourceComponentConstructor rcc;
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- this.rcc = new ResourceComponentConstructor(
- sipc,
- ComponentScope.Undefined,
- abstractResource);
- }
-
- @Override
- protected Object _getInstance(HttpContext hc) {
- try {
- return rcc.construct(hc);
- } catch (InstantiationException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (InvocationTargetException ex) {
- // Propagate the target exception so it may be mapped to a response
- throw new MappableContainerException(ex.getTargetException());
- } catch (WebApplicationException ex) {
- throw ex;
- } catch (RuntimeException ex) {
- throw new ContainerException("Unable to create resource", ex);
- }
- }
- }
-
- private final class PerSessonInstantiated extends AbstractPerSession {
- private final IoCInstantiatedComponentProvider iicp;
-
- private final IoCDestroyable destroyable;
-
- private ResourceComponentInjector rci;
-
- PerSessonInstantiated(IoCInstantiatedComponentProvider iicp) {
- this.iicp = iicp;
- this.destroyable = (iicp instanceof IoCDestroyable)
- ? (IoCDestroyable) iicp : null;
- }
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- if (destroyable == null) {
- this.rci = new ResourceComponentInjector(
- sipc,
- ComponentScope.Undefined,
- abstractResource);
- }
- }
-
- @Override
- protected Object _getInstance(HttpContext hc) {
- Object o = iicp.getInstance();
- if (destroyable == null) {
- rci.inject(hc, iicp.getInjectableInstance(o));
- }
- return o;
- }
-
- @Override
- public void destroy(Object o) {
- if (destroyable != null) {
- destroyable.destroy(o);
- } else {
- super.destroy(o);
- }
- }
- }
-
- private final class PerSessonProxied extends AbstractPerSession {
- private final IoCProxiedComponentProvider ipcp;
-
- private ResourceComponentConstructor rcc;
-
- PerSessonProxied(IoCProxiedComponentProvider ipcp) {
- this.ipcp = ipcp;
- }
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- this.rcc = new ResourceComponentConstructor(
- sipc,
- ComponentScope.Undefined,
- abstractResource);
- }
-
- @Override
- protected Object _getInstance(HttpContext hc) {
- try {
- return ipcp.proxy(rcc.construct(hc));
- } catch (InstantiationException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (InvocationTargetException ex) {
- // Propagate the target exception so it may be mapped to a response
- throw new MappableContainerException(ex.getTargetException());
- } catch (WebApplicationException ex) {
- throw ex;
- } catch (RuntimeException ex) {
- throw new ContainerException("Unable to create resource", ex);
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.java
deleted file mode 100644
index 03f84395136..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.servlet;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.view.Viewable;
-import java.io.IOException;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class RequestDispatcherWrapper implements RequestDispatcher {
- private final RequestDispatcher d;
-
- private final String basePath;
-
- private final HttpContext hc;
-
- private final Viewable v;
-
- public RequestDispatcherWrapper(RequestDispatcher d, String basePath, HttpContext hc, Viewable v) {
- this.d = d;
- this.basePath = basePath;
- this.hc = hc;
- this.v = v;
- }
-
- public void forward(ServletRequest req, ServletResponse rsp) throws ServletException, IOException {
- final Object oldIt = req.getAttribute("it");
- final Object oldResolvingClass = req.getAttribute("resolvingClass");
-
- req.setAttribute("resolvingClass", v.getResolvingClass());
- req.setAttribute("it", v.getModel());
- req.setAttribute("httpContext", hc);
- req.setAttribute("_basePath", basePath);
- req.setAttribute("_request", req);
- req.setAttribute("_response", rsp);
-
- d.forward(req,rsp);
-
- req.setAttribute("resolvingClass", oldResolvingClass);
- req.setAttribute("it", oldIt);
- }
-
- public void include(ServletRequest req, ServletResponse rsp) throws ServletException, IOException {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.java
deleted file mode 100644
index 2cef463729b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.container.servlet;
-
-import com.sun.jersey.server.impl.ThreadLocalNamedInvoker;
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.container.servlet.ServletContainer;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.Type;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.PersistenceUnit;
-import javax.servlet.ServletConfig;
-
-/**
- * A servlet container for deploying root resource classes with support
- * for injecting persistence units.
- * <p>
- * Persistence units that may be injected must be configured in web.xml
- * in the normal way plus an additional servlet parameter to enable the
- * Jersey servlet to locate them in JNDI. E.g. with the following
- * persistence unit configuration:
- *
- * <persistence-unit-ref>
- * <persistence-unit-ref-name>persistence/widget</persistence-unit-ref-name>
- * <persistence-unit-name>WidgetPU</persistence-unit-name>
- * </persistence-unit-ref>
- *
- * the Jersey servlet requires an additional servlet parameter as
- * follows:
- *
- * <init-param>
- * <param-name>unit:WidgetPU</param-name>
- * <param-value>persistence/widget</param-value>
- * </init-param>
- *
- * Given the above, Jersey will inject the EntityManagerFactory found
- * at java:comp/env/persistence/widget in JNDI when encountering a
- * field or parameter annotated with @PersistenceUnit(unitName="WidgetPU").
- */
-public class ServletAdaptor extends ServletContainer {
- private Map<String, String> persistenceUnits =
- new HashMap<String, String>();
-
- @Override
- protected void configure(ServletConfig servletConfig, ResourceConfig rc, WebApplication wa) {
- super.configure(servletConfig, rc, wa);
-
- /**
- * Look for persistent units.
- */
- for (Enumeration e = servletConfig.getInitParameterNames() ; e.hasMoreElements() ;) {
- String key = (String)e.nextElement();
- String value = servletConfig.getInitParameter(key);
- if (key.startsWith("unit:")) {
- persistenceUnits.put(key.substring(5),"java:comp/env/"+value);
- }
- }
-
- rc.getSingletons().add(new InjectableProvider<PersistenceUnit, Type>() {
- @Override
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- @Override
- public Injectable<EntityManagerFactory> getInjectable(ComponentContext ic, PersistenceUnit pu, Type c) {
- if (!c.equals(EntityManagerFactory.class))
- return null;
-
- // TODO localize error message
- if (!persistenceUnits.containsKey(pu.unitName()))
- throw new ContainerException("Persistence unit '"+
- pu.unitName()+
- "' is not configured as a servlet parameter in web.xml");
- String jndiName = persistenceUnits.get(pu.unitName());
- ThreadLocalNamedInvoker<EntityManagerFactory> emfHandler =
- new ThreadLocalNamedInvoker<EntityManagerFactory>(jndiName);
- final EntityManagerFactory emf = (EntityManagerFactory) Proxy.newProxyInstance(
- this.getClass().getClassLoader(),
- new Class[] { EntityManagerFactory.class },
- emfHandler);
-
- return new Injectable<EntityManagerFactory>() {
- @Override
- public EntityManagerFactory getValue() {
- return emf;
- }
- };
- }
- });
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.java
deleted file mode 100644
index 1a351286089..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.ejb;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactoryInitializer;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCFullyManagedComponentProvider;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ejb.Singleton;
-import javax.ejb.Stateless;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-final class EJBComponentProviderFactory implements
- IoCComponentProviderFactory,
- IoCComponentProcessorFactoryInitializer {
-
- private static final Logger LOGGER = Logger.getLogger(
- EJBComponentProviderFactory.class.getName());
-
- private final EJBInjectionInterceptor interceptor;
-
- public EJBComponentProviderFactory(EJBInjectionInterceptor interceptor) {
- this.interceptor = interceptor;
- }
-
- // IoCComponentProviderFactory
-
- public IoCComponentProvider getComponentProvider(Class<?> c) {
- return getComponentProvider(null, c);
- }
-
- public IoCComponentProvider getComponentProvider(ComponentContext cc, Class<?> c) {
- String name = getName(c);
- if (name == null) {
- return null;
- }
-
- try {
- InitialContext ic = new InitialContext();
- Object o = lookup(ic, c, name);
-
- LOGGER.info("Binding the EJB class " + c.getName() +
- " to EJBManagedComponentProvider");
-
- return new EJBManagedComponentProvider(o);
- } catch (NamingException ex) {
- String message = "An instance of EJB class " + c.getName() +
- " could not be looked up using simple form name or the fully-qualified form name." +
- "Ensure that the EJB/JAX-RS component implements at most one interface.";
- LOGGER.log(Level.SEVERE, message, ex);
- throw new ContainerException(message);
- }
- }
-
- private String getName(Class<?> c) {
- String name = null;
- if (c.isAnnotationPresent(Stateless.class)) {
- name = c.getAnnotation(Stateless.class).name();
- } else if (c.isAnnotationPresent(Singleton.class)) {
- name = c.getAnnotation(Singleton.class).name();
- } else {
- return null;
- }
-
- if (name == null || name.length() == 0) {
- name = c.getSimpleName();
- }
- return name;
- }
-
- private Object lookup(InitialContext ic, Class<?> c, String name) throws NamingException {
- try {
- return lookupSimpleForm(ic, c, name);
- } catch (NamingException ex) {
- LOGGER.log(Level.WARNING, "An instance of EJB class " + c.getName() +
- " could not be looked up using simple form name. " +
- "Attempting to look up using the fully-qualified form name.", ex);
-
- return lookupFullyQualfiedForm(ic, c, name);
- }
- }
-
- private Object lookupSimpleForm(InitialContext ic, Class<?> c, String name) throws NamingException {
- String jndiName = "java:module/" + name;
- return ic.lookup(jndiName);
- }
-
- private Object lookupFullyQualfiedForm(InitialContext ic, Class<?> c, String name) throws NamingException {
- String jndiName = "java:module/" + name + "!" + c.getName();
- return ic.lookup(jndiName);
- }
-
-
- private static class EJBManagedComponentProvider implements IoCFullyManagedComponentProvider {
- private final Object o;
-
- EJBManagedComponentProvider(Object o) {
- this.o = o;
- }
-
- public ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public Object getInstance() {
- return o;
- }
- }
-
- // IoCComponentProcessorFactoryInitializer
-
- public void init(IoCComponentProcessorFactory cpf) {
- interceptor.setFactory(cpf);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.java
deleted file mode 100644
index f7fd8a184d0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.ejb;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.server.impl.InitialContextHelper;
-import java.lang.reflect.Method;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class EJBComponentProviderFactoryInitilizer {
- private static final Logger LOGGER = Logger.getLogger(
- EJBComponentProviderFactoryInitilizer.class.getName());
-
- public static void initialize(ResourceConfig rc) {
- try {
- InitialContext ic = InitialContextHelper.getInitialContext();
- if (ic == null) {
- return;
- }
- Object interceptorBinder = ic.
- lookup("java:org.glassfish.ejb.container.interceptor_binding_spi");
- // Some implementations of InitialContext return null instead of
- // throwing NamingException if there is no Object associated with
- // the name
- if (interceptorBinder == null) {
- LOGGER.config("The EJB interceptor binding API is not available. JAX-RS EJB support is disabled.");
- return;
- }
-
- Method interceptorBinderMethod = interceptorBinder.getClass().
- getMethod("registerInterceptor", java.lang.Object.class);
-
- EJBInjectionInterceptor interceptor = new EJBInjectionInterceptor();
-
- try {
- interceptorBinderMethod.invoke(interceptorBinder, interceptor);
- } catch (Exception ex) {
- LOGGER.log(Level.SEVERE, "Error when configuring to use the EJB interceptor binding API. JAX-RS EJB support is disabled.", ex);
- return;
- }
-
- rc.getSingletons().add(new EJBComponentProviderFactory(interceptor));
- rc.getClasses().add(EJBExceptionMapper.class);
- } catch (NamingException ex) {
- LOGGER.log(Level.CONFIG, "The EJB interceptor binding API is not available. JAX-RS EJB support is disabled.", ex);
- } catch (NoSuchMethodException ex) {
- LOGGER.log(Level.SEVERE, "The EJB interceptor binding API does not conform to what is expected. JAX-RS EJB support is disabled.", ex);
- } catch (SecurityException ex) {
- LOGGER.log(Level.SEVERE, "Security issue when configuring to use the EJB interceptor binding API. JAX-RS EJB support is disabled.", ex);
- } catch (LinkageError ex) {
- LOGGER.log(Level.SEVERE, "Linkage error when configuring to use the EJB interceptor binding API. JAX-RS EJB support is disabled.", ex);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.java
deleted file mode 100644
index 96ed8ecf6d2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.ejb;
-
-import com.sun.jersey.api.container.MappableContainerException;
-import javax.ejb.EJBException;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Providers;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class EJBExceptionMapper implements ExceptionMapper<EJBException> {
-
- private final Providers providers;
-
- public EJBExceptionMapper(@Context Providers providers) {
- this.providers = providers;
- }
-
- public Response toResponse(EJBException exception) {
- final Exception cause = exception.getCausedByException();
- if (cause != null) {
- final ExceptionMapper mapper = providers.getExceptionMapper(cause.getClass());
- if (mapper != null) {
- return mapper.toResponse(cause);
- } else if (cause instanceof WebApplicationException) {
- return ((WebApplicationException)cause).getResponse();
- }
- }
-
- // Re-throw so the exception can be passed through to the
- // servlet container
- throw new MappableContainerException((cause == null) ? exception : cause);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.java
deleted file mode 100644
index f844e21ef24..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.ejb;
-
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessor;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProcessorFactory;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import javax.annotation.ManagedBean;
-import javax.annotation.PostConstruct;
-import javax.interceptor.InvocationContext;
-import javax.ws.rs.ext.Provider;
-
-final class EJBInjectionInterceptor {
-
- private IoCComponentProcessorFactory cpf;
-
- private final ConcurrentMap<Class, IoCComponentProcessor> componentProcessorMap =
- new ConcurrentHashMap<Class, IoCComponentProcessor>();
-
- public void setFactory(IoCComponentProcessorFactory cpf) {
- this.cpf = cpf;
- }
-
- @PostConstruct
- private void init(final InvocationContext context) throws Exception {
- if (cpf == null) {
- // Not initialized
- return;
- }
-
- final Object beanInstance = context.getTarget();
- final IoCComponentProcessor icp = get(beanInstance.getClass());
- if (icp != null)
- icp.postConstruct(beanInstance);
-
- // Invoke next interceptor in chain
- context.proceed();
- }
-
- private static final IoCComponentProcessor NULL_COMPONENT_PROCESSOR = new IoCComponentProcessor() {
- public void preConstruct() {
- }
-
- public void postConstruct(Object o) {
- }
- };
-
- private IoCComponentProcessor get(final Class c) {
- IoCComponentProcessor cp = componentProcessorMap.get(c);
- if (cp != null) {
- return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
- }
-
- synchronized (componentProcessorMap) {
- cp = componentProcessorMap.get(c);
- if (cp != null) {
- return (cp == NULL_COMPONENT_PROCESSOR) ? null : cp;
- }
-
- final ComponentScope cs = c.isAnnotationPresent(ManagedBean.class)
- ? c.isAnnotationPresent(Provider.class)
- ? ComponentScope.Singleton
- : cpf.getScope(c)
- : ComponentScope.Singleton;
- cp = cpf.get(c, cs);
- if (cp != null) {
- componentProcessorMap.put(c, cp);
- } else {
- componentProcessorMap.put(c, NULL_COMPONENT_PROCESSOR);
- }
- }
- return cp;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.java
deleted file mode 100644
index c63d724a8c3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.ejb;
-
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchFactory;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.ejb.Local;
-import javax.ejb.Remote;
-import javax.ejb.Stateful;
-import javax.ejb.Stateless;
-
-import javax.ws.rs.core.Context;
-
-/**
- *
- * @author japod
- */
-public class EJBRequestDispatcherProvider implements ResourceMethodDispatchProvider {
-
- @Context
- ResourceMethodCustomInvokerDispatchFactory rdFactory;
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
-
- final AbstractResource declaringResource = abstractResourceMethod.getDeclaringResource();
-
- if (isSessionBean(declaringResource)) {
-
- final Class<?> resourceClass = declaringResource.getResourceClass();
- final Method javaMethod = abstractResourceMethod.getMethod();
-
- for (Class iFace: remoteAndLocalIfaces(resourceClass)) {
- try {
- final Method iFaceMethod = iFace.getDeclaredMethod(javaMethod.getName(), javaMethod.getParameterTypes());
- if (iFaceMethod != null) {
- return createDispatcher(abstractResourceMethod, iFaceMethod);
- }
- } catch (NoSuchMethodException ex) {
- } catch (SecurityException ex) {
- Logger.getLogger(EJBRequestDispatcherProvider.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- }
-
- return null;
- }
-
- private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
- final List<Class> allLocalOrRemoteIfaces = new LinkedList<Class>();
- if (resourceClass.isAnnotationPresent(Remote.class)) {
- allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value()));
- }
- if (resourceClass.isAnnotationPresent(Local.class)) {
- allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value()));
- }
- for (Class<?> i : resourceClass.getInterfaces()) {
- if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
- allLocalOrRemoteIfaces.add(i);
- }
- }
- return allLocalOrRemoteIfaces;
- }
-
- private RequestDispatcher createDispatcher(AbstractResourceMethod abstractResourceMethod, final Method iFaceMethod) {
- return rdFactory.getDispatcher(abstractResourceMethod, new JavaMethodInvoker() {
-
- @Override
- public Object invoke(Method m, Object o, Object... parameters) throws InvocationTargetException, IllegalAccessException {
- return iFaceMethod.invoke(o, parameters);
- }
- });
- }
-
- private boolean isSessionBean(AbstractResource ar) {
- return ar.isAnnotationPresent(Stateless.class) || ar.isAnnotationPresent(Stateful.class);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.java
deleted file mode 100644
index 210527686ed..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.inject;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.spi.inject.Injectable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * An injectable that obtains an injectable value given the {@link HttpContext}.
- *
- * @param <T> the type of the injectable value.
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractHttpContextInjectable<T> implements Injectable<T> {
-
- /**
- * This implementation throws an {@link IllegalStateException}.
- *
- */
- @Override
- public T getValue() {
- throw new IllegalStateException();
- }
-
- /**
- * Get the injectable value given the {@link HttpContext}.
- *
- * @param c the http context,
- * @return the value.
- *
- */
- public abstract T getValue(HttpContext c);
-
- /**
- * Transform a list of {@link Injectable} into a list of this class.
- *
- * @param l the list of injectable.
- * @return the list of this class.
- */
- public static List<AbstractHttpContextInjectable> transform(List<Injectable> l) {
- List<AbstractHttpContextInjectable> al = new ArrayList<AbstractHttpContextInjectable>(l.size());
-
- for (Injectable i : l) {
- al.add(transform(i));
- }
-
- return al;
- }
-
- /**
- * Transform a {@link Injectable} into an instance of this class.
- * <p>
- * @param i the injectable.
- * @return an instance of this class.
- */
- public static AbstractHttpContextInjectable transform(final Injectable i) {
- if (i == null) {
- return null;
- } else if (i instanceof AbstractHttpContextInjectable) {
- return (AbstractHttpContextInjectable)i;
- } else {
- return new AbstractHttpContextInjectable() {
- @Override
- public Object getValue(HttpContext c) {
- return i.getValue();
- }
- };
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/InjectableValuesProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/InjectableValuesProvider.java
deleted file mode 100644
index 9d7a1eb1b78..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/InjectableValuesProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.sun.jersey.server.impl.inject;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.spi.inject.Injectable;
-import java.util.List;
-import javax.ws.rs.WebApplicationException;
-
-
-/**
- * A hold of a list of injectable that obtains the injectable values
- * from that list.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class InjectableValuesProvider {
-
- private final List<AbstractHttpContextInjectable> is;
-
- /**
- * Create a new instance given a list of injectable.
- *
- * @param is the list of injectable.
- */
- public InjectableValuesProvider(List<Injectable> is) {
- this.is = AbstractHttpContextInjectable.transform(is);
- }
-
- public List<AbstractHttpContextInjectable> getInjectables() {
- return is;
- }
-
- /**
- * Get the injectable values.
- *
- * @param context the http contest.
- * @return the injectable values. Each element in the object array
- * is a value obtained from the injectable at the list index
- * that is the element index.
- */
- public Object[] getInjectableValues(HttpContext context) {
- final Object[] params = new Object[is.size()];
- try {
- int index = 0;
- for (AbstractHttpContextInjectable i : is) {
- params[index++] = i.getValue(context);
- }
- return params;
- } catch (WebApplicationException e) {
- throw e;
- } catch (ContainerException e) {
- throw e;
- } catch (RuntimeException e) {
- throw new ContainerException("Exception obtaining parameters", e);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.java
deleted file mode 100644
index f3695614c15..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.inject;
-
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProviderContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.reflect.AccessibleObject;
-import java.util.List;
-
-/**
- * The server context to obtain {@link Injectable} instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ServerInjectableProviderContext extends InjectableProviderContext {
- /**
- * Check if a parameter type is registered for injection.
- *
- * @param p the parameter, from which the parameter type is obtained.
- * @return if registered, otherwise false.
- */
- public boolean isParameterTypeRegistered(Parameter p);
-
- /**
- * Get an injectable given a parameter.
- *
- * @param p the parameter.
- * @param s the scope for which the injectable will be used
- * @return the injectable, otherwise null if an injectable could
- * not be found.
- */
- Injectable getInjectable(Parameter p, ComponentScope s);
-
- /**
- * Get an injectable given a parameter.
- *
- * @param ao the accessible object that is the target of injection
- * @param p the parameter.
- * @param s the scope for which the injectable will be used
- * @return the injectable, otherwise null if an injectable could
- * not be found.
- */
- Injectable getInjectable(AccessibleObject ao, Parameter p, ComponentScope s);
-
- /**
- * Get an injectable given a parameter.
- *
- * @param p the parameter.
- * @param s the scope for which the injectable will be used
- * @return the injectable and scope, otherwise null if an injectable could
- * not be found.
- */
- InjectableScopePair getInjectableiWithScope(Parameter p, ComponentScope s);
-
- /**
- * Get an injectable given a parameter.
- *
- * @param ao the accessible object that is the target of injection
- * @param p the parameter.
- * @param s the scope for which the injectable will be used
- * @return the injectable and scope, otherwise null if an injectable could
- * not be found.
- */
- InjectableScopePair getInjectableiWithScope(AccessibleObject ao, Parameter p, ComponentScope s);
-
- /**
- * Get a list of injectable given a list of parameter.
- *
- * @param ps the list of parameter.
- * @param s the scope for which the injectable will be used
- * @return the list of injectable, if an injectable for a parameter
- * could not be found the corresponding element in the
- * list will be null.
- */
- List<Injectable> getInjectable(List<Parameter> ps, ComponentScope s);
-
- /**
- * Get a list of injectable given a list of parameter.
- *
- * @param ao the accessible object that is the target of injection
- * @param ps the list of parameter.
- * @param s the scope for which the injectable will be used
- * @return the list of injectable, if an injectable for a parameter
- * could not be found the corresponding element in the
- * list will be null.
- */
- List<Injectable> getInjectable(AccessibleObject ao, List<Parameter> ps, ComponentScope s);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.java
deleted file mode 100644
index 6fcdecfc7f3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.inject;
-
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.AnnotatedContext;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.factory.InjectableProviderFactory;
-import com.sun.jersey.spi.inject.Injectable;
-import java.lang.reflect.AccessibleObject;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ServerInjectableProviderFactory extends InjectableProviderFactory
- implements ServerInjectableProviderContext {
-
- @Override
- public boolean isParameterTypeRegistered(Parameter p) {
- if (p.getAnnotation() == null) return false;
-
- if (isAnnotationRegistered(p.getAnnotation().annotationType(), p.getClass())) return true;
-
- return isAnnotationRegistered(p.getAnnotation().annotationType(), p.getParameterType().getClass());
- }
-
- @Override
- public InjectableScopePair getInjectableiWithScope(Parameter p, ComponentScope s) {
- return getInjectableiWithScope(null, p, s);
- }
-
- @Override
- public InjectableScopePair getInjectableiWithScope(AccessibleObject ao, Parameter p, ComponentScope s) {
- if (p.getAnnotation() == null) return null;
-
- ComponentContext ic = new AnnotatedContext(ao, p.getAnnotations());
-
- if (s == ComponentScope.PerRequest) {
- // Find a per request injectable with Parameter
- Injectable i = getInjectable(
- p.getAnnotation().annotationType(),
- ic,
- p.getAnnotation(),
- p,
- ComponentScope.PerRequest);
- if (i != null) return new InjectableScopePair(i, ComponentScope.PerRequest);
-
- // Find a per request, undefined or singleton injectable with parameter Type
- return getInjectableWithScope(
- p.getAnnotation().annotationType(),
- ic,
- p.getAnnotation(),
- p.getParameterType(),
- ComponentScope.PERREQUEST_UNDEFINED_SINGLETON
- );
- } else {
- // Find a undefined or singleton injectable with parameter Type
- return getInjectableWithScope(
- p.getAnnotation().annotationType(),
- ic,
- p.getAnnotation(),
- p.getParameterType(),
- ComponentScope.UNDEFINED_SINGLETON
- );
- }
- }
-
- @Override
- public Injectable getInjectable(Parameter p, ComponentScope s) {
- return getInjectable(null, p, s);
- }
-
- @Override
- public Injectable getInjectable(AccessibleObject ao, Parameter p, ComponentScope s) {
- InjectableScopePair isp = getInjectableiWithScope(ao, p, s);
- if (isp == null)
- return null;
- return isp.i;
- }
-
- @Override
- public List<Injectable> getInjectable(List<Parameter> ps, ComponentScope s) {
- return getInjectable(null, ps, s);
- }
-
- @Override
- public List<Injectable> getInjectable(AccessibleObject ao, List<Parameter> ps, ComponentScope s) {
- List<Injectable> is = new ArrayList<Injectable>();
- for (Parameter p : ps)
- is.add(getInjectable(ao, p, s));
- return is;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.java
deleted file mode 100644
index ad8a5efbd37..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.managedbeans;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ioc.IoCDestroyable;
-import com.sun.jersey.core.spi.component.ioc.IoCInstantiatedComponentProvider;
-import java.lang.reflect.Method;
-import java.util.logging.Logger;
-import javax.annotation.ManagedBean;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-final class ManagedBeanComponentProviderFactory implements
- IoCComponentProviderFactory {
-
- private static final Logger LOGGER = Logger.getLogger(
- ManagedBeanComponentProviderFactory.class.getName());
-
- private final Object injectionMgr;
-
- private final Method createManagedObjectMethod;
-
- private final Method destroyManagedObjectMethod;
-
- public ManagedBeanComponentProviderFactory(Object injectionMgr,
- Method createManagedObjectMethod, Method destroyManagedObjectMethod) {
- this.injectionMgr = injectionMgr;
- this.createManagedObjectMethod = createManagedObjectMethod;
- this.destroyManagedObjectMethod = destroyManagedObjectMethod;
- }
-
- // IoCComponentProviderFactory
-
- public IoCComponentProvider getComponentProvider(Class<?> c) {
- return getComponentProvider(null, c);
- }
-
- public IoCComponentProvider getComponentProvider(ComponentContext cc, Class<?> c) {
- if (!isManagedBean(c))
- return null;
-
- LOGGER.info("Binding the Managed bean class " + c.getName() +
- " to ManagedBeanComponentProvider");
-
- return new ManagedBeanComponentProvider(c);
- }
-
- private boolean isManagedBean(Class<?> c) {
- return c.isAnnotationPresent(ManagedBean.class);
- }
-
- private class ManagedBeanComponentProvider implements
- IoCInstantiatedComponentProvider, IoCDestroyable {
- private final Class<?> c;
-
- ManagedBeanComponentProvider(Class<?> c) {
- this.c = c;
- }
-
- // IoCInstantiatedComponentProvider
-
- public Object getInstance() {
- try {
- return createManagedObjectMethod.invoke(injectionMgr, c);
- } catch (Exception ex) {
- throw new ContainerException(ex);
- }
- }
-
- public Object getInjectableInstance(Object o) {
- return o;
- }
-
- // IoCDestroyable
-
- public void destroy(Object o) {
- try {
- destroyManagedObjectMethod.invoke(injectionMgr, o);
- } catch (Exception ex) {
- throw new ContainerException(ex);
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.java
deleted file mode 100644
index 13d903d09ae..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.managedbeans;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.server.impl.InitialContextHelper;
-import java.lang.reflect.Method;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ManagedBeanComponentProviderFactoryInitilizer {
-
- private static final Logger LOGGER = Logger.getLogger(
- ManagedBeanComponentProviderFactoryInitilizer.class.getName());
-
- public static void initialize(ResourceConfig rc) {
- try {
- InitialContext ic = InitialContextHelper.getInitialContext();
- if (ic == null) {
- return;
- }
- Object injectionMgr = ic.
- lookup("com.sun.enterprise.container.common.spi.util.InjectionManager");
- // Some implementations of InitialContext return null instead of
- // throwing NamingException if there is no Object associated with
- // the name
- if (injectionMgr == null) {
- LOGGER.config("The managed beans injection manager API is not available. JAX-RS managed beans support is disabled.");
- return;
- }
-
- Method createManagedObjectMethod = injectionMgr.getClass().
- getMethod("createManagedObject", java.lang.Class.class);
-
- Method destroyManagedObjectMethod = injectionMgr.getClass().
- getMethod("destroyManagedObject", java.lang.Object.class);
-
- rc.getSingletons().add(new ManagedBeanComponentProviderFactory(
- injectionMgr, createManagedObjectMethod, destroyManagedObjectMethod));
- } catch (NamingException ex) {
- LOGGER.log(Level.CONFIG, "The managed beans injection manager API is not available. JAX-RS managed beans support is disabled.", ex);
- } catch (NoSuchMethodException ex) {
- LOGGER.log(Level.SEVERE, "The managed beans injection manager API does not conform to what is expected. JAX-RS managed beans support is disabled.", ex);
- } catch (SecurityException ex) {
- LOGGER.log(Level.SEVERE, "Security issue when configuring to use the managed beans injection manager API. JAX-RS managed beans support is disabled.", ex);
- } catch (LinkageError ex) {
- LOGGER.log(Level.SEVERE, "Linkage error when configuring to use the managed beans injection manager API. JAX-RS managed beans support is disabled.", ex);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ErrorHelper.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ErrorHelper.java
deleted file mode 100644
index 12d4e60d410..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ErrorHelper.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model;
-
-import com.sun.jersey.impl.ImplMessages;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.Produces;
-import javax.ws.rs.HttpMethod;
-import com.sun.jersey.api.container.ContainerException;
-import java.lang.reflect.Method;
-
-/**
- * Error helper class for reporting errors related to processing a Web resource.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ErrorHelper {
-
- public static ContainerException objectNotAWebResource(Class resourceClass) {
- return new ContainerException(ImplMessages.OBJECT_NOT_A_WEB_RESOURCE(resourceClass.getName()));
- }
-
- public static ContainerException badClassConsumes(Exception e, Class resourceClass, Consumes c) {
- return new ContainerException(ImplMessages.BAD_CLASS_CONSUMEMIME(resourceClass,
- c.value()), e);
- }
-
- public static ContainerException badClassProduces(Exception e, Class resourceClass, Produces p) {
- return new ContainerException(ImplMessages.BAD_CLASS_PRODUCEMIME(resourceClass,
- p.value()), e);
- }
-
- public static ContainerException badMethodHttpMethod(Class resourceClass, Method m, HttpMethod hm) {
- return new ContainerException(ImplMessages.BAD_METHOD_HTTPMETHOD(resourceClass,
- hm.value(),
- m.toString()));
- }
-
- public static ContainerException badMethodConsumes(Exception e, Class resourceClass, Method m, Consumes c) {
- return new ContainerException(ImplMessages.BAD_METHOD_CONSUMEMIME(resourceClass,
- c.value(),
- m.toString()), e);
- }
-
- public static ContainerException badMethodProduces(Exception e, Class resourceClass, Method m, Produces p) {
- return new ContainerException(ImplMessages.BAD_METHOD_PRODUCEMIME(resourceClass,
- p.value(),
- m.toString()), e);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/HttpHelper.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/HttpHelper.java
deleted file mode 100644
index 6642d22d4ae..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/HttpHelper.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.core.header.AcceptableLanguageTag;
-import com.sun.jersey.core.header.AcceptableMediaType;
-import com.sun.jersey.core.header.AcceptableToken;
-import com.sun.jersey.core.header.LanguageTag;
-import com.sun.jersey.core.header.MatchingEntityTag;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-
-/**
- * Helper classes for HTTP.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class HttpHelper {
-
- /**
- * Get the content type from the "Content-Type" of an HTTP request.
- * <p>
- * @param request The HTTP request.
- * @return The content type. If no "Content-Type is present then null is
- * returned.
- */
- public static MediaType getContentType(HttpRequestContext request) {
- return getContentType(request.getRequestHeaders().getFirst(HttpHeaders.CONTENT_TYPE));
- }
-
- /**
- * Get the content type from a String.
- * <p>
- * @param contentTypeString the content type as a String.
- * @return The content type. If no "Content-Type is present then null is
- * returned.
- */
- public static MediaType getContentType(String contentTypeString) {
- try {
- return (contentTypeString != null) ? MediaType.valueOf(contentTypeString) : null;
- } catch(IllegalArgumentException e) {
- throw clientError("Bad Content-Type header value: '" + contentTypeString + "'", e);
- }
- }
-
- /**
- * Get the content type from an Object.
- * <p>
- * @param contentType the content type as an Object.
- * @return The content type. If no "Content-Type is present then null is
- * returned.
- */
- public static MediaType getContentType(Object contentType) {
- if (contentType == null)
- return null;
-
- if (contentType instanceof MediaType)
- return (MediaType)contentType;
- else
- return MediaType.valueOf(contentType.toString());
- }
-
- /**
- * Get the content language as a Locale instance.
- *
- * @param request The HTTP request.
- * @return the content language as a locale instance.
- */
- public static Locale getContentLanguageAsLocale(HttpRequestContext request) {
- return HttpHelper.getLanguageTagAsLocale(request.getRequestHeaders().
- getFirst(HttpHeaders.CONTENT_LANGUAGE));
- }
-
-
- public static Locale getLanguageTagAsLocale(String language) {
- if (language == null)
- return null;
-
- try {
- return new LanguageTag(language).getAsLocale();
- } catch (java.text.ParseException e) {
- throw clientError("Bad Content-Language header value: '" + language + "'", e);
- }
- }
-
- public static Set<MatchingEntityTag> getIfMatch(HttpRequestContext request) {
- final String ifMatch = request.getHeaderValue(HttpHeaders.IF_MATCH);
- if (ifMatch == null || ifMatch.length() == 0) {
- return null;
- }
- try {
- return HttpHeaderReader.readMatchingEntityTag(ifMatch);
- } catch (java.text.ParseException e) {
- throw clientError("Bad If-Match header value: '" + ifMatch + "'", e);
- }
- }
-
- public static Set<MatchingEntityTag> getIfNoneMatch(HttpRequestContext request) {
- final String ifNoneMatch = request.getHeaderValue(HttpHeaders.IF_NONE_MATCH);
- if (ifNoneMatch == null || ifNoneMatch.length() == 0) {
- return null;
- }
- try {
- return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch);
- } catch (java.text.ParseException e) {
- throw clientError("Bad If-None-Match header value: '" + ifNoneMatch + "'", e);
- }
- }
-
- /**
- * Get the list of Media type from the "Accept" of an HTTP request.
- * <p>
- * @param request The HTTP request.
- * @return The list of MediaType. This list
- * is ordered with the highest quality acceptable Media type occurring first
- * (see {@link MediaTypes#MEDIA_TYPE_COMPARATOR}).
- * If no "Accept" is present then a list with a single item of the Media
- * type "*\\/*" is returned.
- */
- public static List<AcceptableMediaType> getAccept(HttpRequestContext request) {
- final String accept = request.getHeaderValue(HttpHeaders.ACCEPT);
- if (accept == null || accept.length() == 0) {
- return MediaTypes.GENERAL_ACCEPT_MEDIA_TYPE_LIST;
- }
- try {
- return HttpHeaderReader.readAcceptMediaType(accept);
- } catch (java.text.ParseException e) {
- throw clientError(ImplMessages.BAD_ACCEPT_FIELD(accept), e);
- }
- }
-
- public static List<AcceptableMediaType> getAccept(HttpRequestContext request,
- List<QualitySourceMediaType> priorityMediaTypes) {
- final String accept = request.getHeaderValue(HttpHeaders.ACCEPT);
- if (accept == null || accept.length() == 0) {
- return MediaTypes.GENERAL_ACCEPT_MEDIA_TYPE_LIST;
- }
- try {
- return HttpHeaderReader.readAcceptMediaType(accept, priorityMediaTypes);
- } catch (java.text.ParseException e) {
- throw clientError(ImplMessages.BAD_ACCEPT_FIELD(accept), e);
- }
- }
-
- /**
- * Get the list of language tag from the "Accept-Language" of an HTTP request.
- * <p>
- * @deprecated see {@link #getAcceptLanguage(com.sun.jersey.api.core.HttpRequestContext) }.
- * @param request The HTTP request.
- * @return The list of LanguageTag. This list
- * is ordered with the highest quality acceptable language tag occurring first.
- */
- @Deprecated
- public static List<AcceptableLanguageTag> getAcceptLangauge(HttpRequestContext request) {
- return getAcceptLanguage(request);
- }
-
- /**
- * Get the list of language tag from the "Accept-Language" of an HTTP request.
- * <p>
- * @param request The HTTP request.
- * @return The list of LanguageTag. This list
- * is ordered with the highest quality acceptable language tag occurring first.
- */
- public static List<AcceptableLanguageTag> getAcceptLanguage(HttpRequestContext request) {
- final String acceptLanguage = request.getHeaderValue(HttpHeaders.ACCEPT_LANGUAGE);
- if (acceptLanguage == null || acceptLanguage.length() == 0) {
- return Collections.singletonList(new AcceptableLanguageTag("*", null));
- }
- try {
- return HttpHeaderReader.readAcceptLanguage(acceptLanguage);
- } catch (java.text.ParseException e) {
- throw clientError("Bad Accept-Language header value: '" + acceptLanguage + "'", e);
- }
- }
-
- /**
- * Get the list of language tag from the "Accept-Charset" of an HTTP request.
- * <p>
- * @param request The HTTP request.
- * @return The list of AcceptableToken. This list
- * is ordered with the highest quality acceptable charset occurring first.
- */
- public static List<AcceptableToken> getAcceptCharset(HttpRequestContext request) {
- final String acceptCharset = request.getHeaderValue(HttpHeaders.ACCEPT_CHARSET);
- try {
- if (acceptCharset == null || acceptCharset.length() == 0) {
- return Collections.singletonList(new AcceptableToken("*"));
- }
- return HttpHeaderReader.readAcceptToken(acceptCharset);
- } catch (java.text.ParseException e) {
- throw clientError("Bad Accept-Charset header value: '" + acceptCharset + "'", e);
- }
- }
-
- /**
- * Get the list of language tag from the "Accept-Charset" of an HTTP request.
- * <p>
- * @param request The HTTP request.
- * @return The list of AcceptableToken. This list
- * is ordered with the highest quality acceptable charset occurring first.
- */
- public static List<AcceptableToken> getAcceptEncoding(HttpRequestContext request) {
- final String acceptEncoding = request.getHeaderValue(HttpHeaders.ACCEPT_ENCODING);
- try {
- if (acceptEncoding == null || acceptEncoding.length() == 0) {
- return Collections.singletonList(new AcceptableToken("*"));
- }
- return HttpHeaderReader.readAcceptToken(acceptEncoding);
- } catch (java.text.ParseException e) {
- throw clientError("Bad Accept-Encoding header value: '" + acceptEncoding + "'", e);
- }
- }
-
- private static WebApplicationException clientError(String message, Exception e) {
- return new WebApplicationException(e, Response.status(Response.Status.BAD_REQUEST).
- entity(message).type("text/plain").build());
- }
-
- /**
- * Ascertain if an entity of a specific Media type is capable of being
- * produced from a list of Media type.
- *
- * @param contentType The Media type.
- * @param accept The list of Media types of entities that may be produced. This list
- * MUST be ordered with the highest quality acceptable Media type occurring first
- * (see {@link MediaTypes#MEDIA_TYPE_COMPARATOR}).
- * @return true if the Media type can be produced, otherwise false.
- */
- public static boolean produces(MediaType contentType, List<MediaType> accept) {
- for (MediaType a : accept) {
- if (a.getType().equals("*")) return true;
-
- if (contentType.isCompatible(a)) return true;
- }
-
- return false;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceMethodMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceMethodMap.java
deleted file mode 100644
index 622c590ea1b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceMethodMap.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model;
-
-import com.sun.jersey.server.impl.model.method.ResourceMethod;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A {@link HashMap} with HTTP methods as keys and {@link ResourceMethodList}
- * as values.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-/* package */ final class ResourceMethodMap extends HashMap<String, List<ResourceMethod>> {
- /**
- * Merge a HTTP method and associated resource method.
- *
- * @param method the resource method.
- */
- public void put(ResourceMethod method) {
- List<ResourceMethod> l = get(method.getHttpMethod());
- if (l == null) {
- l = new ArrayList<ResourceMethod>();
- put(method.getHttpMethod(), l);
- }
- l.add(method);
- }
-
- /**
- * Sort the list methods for each value in the method map.
- */
- public void sort() {
- for (Map.Entry<String, List<ResourceMethod>> e : entrySet()) {
- Collections.sort(e.getValue(), ResourceMethod.COMPARATOR);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceUriRules.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceUriRules.java
deleted file mode 100644
index 708367d2aac..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/ResourceUriRules.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.model.AbstractImplicitViewMethod;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.model.AbstractSubResourceMethod;
-import com.sun.jersey.api.uri.UriPattern;
-import com.sun.jersey.api.view.ImplicitProduces;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.core.spi.component.ComponentInjector;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.server.impl.container.filter.FilterFactory;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.server.impl.model.method.ResourceHeadWrapperMethod;
-import com.sun.jersey.server.impl.model.method.ResourceHttpMethod;
-import com.sun.jersey.server.impl.model.method.ResourceHttpOptionsMethod;
-import com.sun.jersey.server.impl.model.method.ResourceMethod;
-import com.sun.jersey.server.impl.template.ViewResourceMethod;
-import com.sun.jersey.server.impl.template.ViewableRule;
-import com.sun.jersey.server.impl.uri.PathPattern;
-import com.sun.jersey.server.impl.uri.PathTemplate;
-import com.sun.jersey.server.impl.uri.rules.CombiningMatchingPatterns;
-import com.sun.jersey.server.impl.uri.rules.HttpMethodRule;
-import com.sun.jersey.server.impl.uri.rules.PatternRulePair;
-import com.sun.jersey.server.impl.uri.rules.RightHandPathRule;
-import com.sun.jersey.server.impl.uri.rules.SequentialMatchingPatterns;
-import com.sun.jersey.server.impl.uri.rules.SubLocatorRule;
-import com.sun.jersey.server.impl.uri.rules.TerminatingRule;
-import com.sun.jersey.server.impl.uri.rules.UriRulesFactory;
-import com.sun.jersey.server.impl.wadl.WadlFactory;
-import com.sun.jersey.spi.container.ResourceFilter;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.spi.inject.Errors;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.monitoring.DispatchingListener;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRules;
-
-import javax.ws.rs.HttpMethod;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResourceUriRules {
- private final UriRules<UriRule> rules;
-
- private final ResourceConfig resourceConfig;
-
- private final ResourceMethodDispatchProvider dp;
-
- private final ServerInjectableProviderContext injectableContext;
-
- private final FilterFactory ff;
-
- private final WadlFactory wadlFactory;
-
- private final DispatchingListener dispatchingListener;
-
- public ResourceUriRules(
- final ResourceConfig resourceConfig,
- final ResourceMethodDispatchProvider dp,
- final ServerInjectableProviderContext injectableContext,
- final FilterFactory ff,
- final WadlFactory wadlFactory,
- final DispatchingListener dispatchingListener,
- final AbstractResource resource
- ) {
- this.resourceConfig = resourceConfig;
- this.dp = dp;
- this.injectableContext = injectableContext;
- this.ff = ff;
- this.wadlFactory = wadlFactory;
-
- this.dispatchingListener = dispatchingListener;
-
- final boolean implicitViewables = resourceConfig.getFeature(
- ResourceConfig.FEATURE_IMPLICIT_VIEWABLES);
- List<QualitySourceMediaType> implictProduces = null;
- if (implicitViewables) {
- ImplicitProduces ip = resource.getAnnotation(ImplicitProduces.class);
- if (ip != null && ip.value() != null && ip.value().length > 0) {
- implictProduces = MediaTypes.createQualitySourceMediaTypes(ip.value());
- }
- }
-
- RulesMap<UriRule> rulesMap = new RulesMap<UriRule>();
-
- processSubResourceLocators(resource, rulesMap);
-
- processSubResourceMethods(resource, implictProduces, rulesMap);
-
- processMethods(resource, implictProduces, rulesMap);
-
- // Check for matching conflicts with path patterns
- rulesMap.processConflicts(new RulesMap.ConflictClosure() {
- public void onConflict(PathPattern p1, PathPattern p2) {
- Errors.error(String.format("Conflicting URI templates. "
- + "The URI templates %s and %s for sub-resource methods "
- + "and/or sub-resource locators of resource class %s "
- + "transform to the same regular expression %s",
- p1.getTemplate().getTemplate(),
- p2.getTemplate().getTemplate(),
- resource.getResourceClass().getName(),
- p1));
- }
- });
-
- // Create the atomic rules, at most only one will be matched
- final UriRules<UriRule> atomicRules = UriRulesFactory.create(rulesMap);
-
- // Create the end sequential rules, zero or more may be matched
- List<PatternRulePair<UriRule>> patterns = new ArrayList<PatternRulePair<UriRule>>();
- if (resourceConfig.getFeature(ResourceConfig.FEATURE_IMPLICIT_VIEWABLES)) {
- AbstractImplicitViewMethod method = new AbstractImplicitViewMethod(resource);
- List<ResourceFilter> resourceFilters = ff.getResourceFilters(method);
- ViewableRule r = new ViewableRule(
- implictProduces,
- FilterFactory.getRequestFilters(resourceFilters),
- FilterFactory.getResponseFilters(resourceFilters));
- ComponentInjector<ViewableRule> ci = new ComponentInjector(injectableContext,
- ViewableRule.class);
- ci.inject(r);
-
- // The matching rule for a sub-resource template
- patterns.add(new PatternRulePair<UriRule>(
- new UriPattern("/([^/]+)"), r));
- // The matching rule for an index template
- patterns.add(new PatternRulePair<UriRule>(
- UriPattern.EMPTY, r));
- }
- // The terminating rule when the path is not fully consumed and accepted
- patterns.add(new PatternRulePair<UriRule>(
- new UriPattern(".*"), new TerminatingRule()));
- // The terminating rule when the path is fully consumed and accepted
- patterns.add(new PatternRulePair<UriRule>(
- UriPattern.EMPTY, new TerminatingRule()));
- // Create the sequential rules
- final UriRules<UriRule> sequentialRules =
- new SequentialMatchingPatterns<UriRule>(patterns);
-
- // Combined the atomic and sequential rules, the former will be matched
- // first
- final UriRules<UriRule> combiningRules =
- new CombiningMatchingPatterns<UriRule>(
- Arrays.asList(atomicRules, sequentialRules));
-
- this.rules = combiningRules;
- }
-
- public UriRules<UriRule> getRules() {
- return rules;
- }
-
- private void processSubResourceLocators(
- final AbstractResource resource,
- final RulesMap<UriRule> rulesMap) {
- for (final AbstractSubResourceLocator locator : resource.getSubResourceLocators()) {
- PathPattern p = null;
- try {
- p = new PathPattern(new PathTemplate(locator.getPath().getValue()));
- } catch (IllegalArgumentException ex) {
- Errors.error(String.format("Illegal URI template for sub-resource locator %s: %s",
- locator.getMethod(), ex.getMessage()));
- continue;
- }
-
- final PathPattern conflict = rulesMap.hasConflict(p);
- if (conflict != null) {
- Errors.error(String.format("Conflicting URI templates. "
- + "The URI template %s for sub-resource locator %s "
- + "and the URI template %s transform to the same regular expression %s",
- p.getTemplate().getTemplate(),
- locator.getMethod(),
- conflict.getTemplate().getTemplate(),
- p));
- continue;
- }
-
- final List<Injectable> is = injectableContext.getInjectable(
- locator.getMethod(), locator.getParameters(), ComponentScope.PerRequest);
- if (is.contains(null)) {
- // Missing dependency
- for (int i = 0; i < is.size(); i++) {
- if (is.get(i) == null) {
- Errors.missingDependency(locator.getMethod(), i);
- }
- }
- }
-
- final List<ResourceFilter> resourceFilters = ff.getResourceFilters(locator);
- final UriRule r = new SubLocatorRule(
- p.getTemplate(),
- is,
- FilterFactory.getRequestFilters(resourceFilters),
- FilterFactory.getResponseFilters(resourceFilters),
- dispatchingListener,
- locator);
-
- rulesMap.put(p,
- new RightHandPathRule(
- resourceConfig.getFeature(ResourceConfig.FEATURE_REDIRECT),
- p.getTemplate().endsWithSlash(),
- r));
- }
- }
-
- private void processSubResourceMethods(
- final AbstractResource resource,
- final List<QualitySourceMediaType> implictProduces,
- final RulesMap<UriRule> rulesMap) {
- final Map<PathPattern, ResourceMethodMap> patternMethodMap =
- new HashMap<PathPattern, ResourceMethodMap>();
-
- for (final AbstractSubResourceMethod method : resource.getSubResourceMethods()) {
-
- PathPattern p;
- try {
- p = new PathPattern(new PathTemplate(method.getPath().getValue()), "(/)?");
- } catch (IllegalArgumentException ex) {
- Errors.error(String.format("Illegal URI template for sub-resource method %s: %s",
- method.getMethod(), ex.getMessage()));
- continue;
- }
-
- final ResourceMethod rm = new ResourceHttpMethod(dp, ff, p.getTemplate(), method);
- ResourceMethodMap rmm = patternMethodMap.get(p);
- if (rmm == null) {
- rmm = new ResourceMethodMap();
- patternMethodMap.put(p, rmm);
- }
-
- if (isValidResourceMethod(rm, rmm)) {
- rmm.put(rm);
- }
-
- rmm.put(rm);
- }
-
- // Create the rules for the sub-resource HTTP methods
- for (final Map.Entry<PathPattern, ResourceMethodMap> e : patternMethodMap.entrySet()) {
- addImplicitMethod(implictProduces, e.getValue());
-
- final PathPattern p = e.getKey();
- final ResourceMethodMap rmm = e.getValue();
-
- processHead(rmm);
- processOptions(rmm, resource, p);
-
- rmm.sort();
-
- rulesMap.put(p,
- new RightHandPathRule(
- resourceConfig.getFeature(ResourceConfig.FEATURE_REDIRECT),
- p.getTemplate().endsWithSlash(),
- new HttpMethodRule(rmm, true, dispatchingListener)));
- }
- }
-
- private void processMethods(
- final AbstractResource resource,
- final List<QualitySourceMediaType> implictProduces,
- final RulesMap<UriRule> rulesMap) {
- final ResourceMethodMap rmm = new ResourceMethodMap();
- for (final AbstractResourceMethod resourceMethod : resource.getResourceMethods()) {
- ResourceMethod rm = new ResourceHttpMethod(dp, ff, resourceMethod);
-
- if (isValidResourceMethod(rm, rmm)) {
- rmm.put(rm);
- }
- }
-
- addImplicitMethod(implictProduces, rmm);
-
- processHead(rmm);
- processOptions(rmm, resource, null);
-
- // Create the rules for the HTTP methods
- rmm.sort();
- if (!rmm.isEmpty()) {
- // No need to adapt with the RightHandPathRule as the URI path
- // will be consumed when such a rule is accepted
- rulesMap.put(PathPattern.EMPTY_PATH, new HttpMethodRule(rmm, dispatchingListener));
- }
- }
-
- private void addImplicitMethod(
- final List<QualitySourceMediaType> implictProduces,
- final ResourceMethodMap rmm) {
- if (implictProduces != null) {
- final List<ResourceMethod> getList = rmm.get(HttpMethod.GET);
- if (getList != null && !getList.isEmpty()) {
- rmm.put(new ViewResourceMethod(implictProduces));
- }
- }
- }
-
- private boolean isValidResourceMethod(
- final ResourceMethod rm,
- final ResourceMethodMap rmm) {
- final List<ResourceMethod> rml = rmm.get(rm.getHttpMethod());
- if (rml != null) {
- boolean conflict = false;
- ResourceMethod erm = null;
- for (int i = 0; i < rml.size() && !conflict; i++) {
- erm = rml.get(i);
-
- conflict = MediaTypes.intersects(rm.getConsumes(), erm.getConsumes())
- && MediaTypes.intersects(rm.getProduces(), erm.getProduces());
- }
-
- if (conflict) {
- if (rm.getAbstractResourceMethod().hasEntity()) {
- Errors.error(String.format("Consuming media type conflict. " +
- "The resource methods %s and %s can consume the same media type",
- rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod()));
- } else {
- Errors.error(String.format("Producing media type conflict. " +
- "The resource methods %s and %s can produce the same media type",
- rm.getAbstractResourceMethod().getMethod(), erm.getAbstractResourceMethod().getMethod()));
- }
- }
-
- if (conflict)
- return false;
- }
-
- return true;
- }
-
- private void processHead(final ResourceMethodMap methodMap) {
- final List<ResourceMethod> getList = methodMap.get(HttpMethod.GET);
- if (getList == null || getList.isEmpty()) {
- return;
- }
-
- List<ResourceMethod> headList = methodMap.get(HttpMethod.HEAD);
- if (headList == null) {
- headList = new ArrayList<ResourceMethod>();
- }
-
- for (final ResourceMethod getMethod : getList) {
- if (!containsMediaOfMethod(headList, getMethod)) {
- final ResourceMethod headMethod = new ResourceHeadWrapperMethod(getMethod);
- methodMap.put(headMethod);
- headList = methodMap.get(HttpMethod.HEAD);
- }
- }
- }
-
- /**
- * Determine if a the resource method list contains a method that
- * has the same consume/produce media as another resource method.
- *
- * @param methods the resource methods
- * @param method the resource method to check
- * @return true if the list contains a method with the same media as method.
- */
- private boolean containsMediaOfMethod(
- final List<ResourceMethod> methods,
- final ResourceMethod method) {
- for (final ResourceMethod m : methods) {
- if (method.mediaEquals(m)) {
- return true;
- }
- }
-
- return false;
- }
-
- private void processOptions(
- final ResourceMethodMap methodMap,
- final AbstractResource resource,
- final PathPattern p) {
- final List<ResourceMethod> l = methodMap.get("OPTIONS");
- if (l != null) {
- return;
- }
-
- ResourceMethod optionsMethod = wadlFactory.createWadlOptionsMethod(methodMap, resource, p);
- if (optionsMethod == null) {
- optionsMethod = new ResourceHttpOptionsMethod(methodMap);
- }
- methodMap.put(optionsMethod);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/RulesMap.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/RulesMap.java
deleted file mode 100644
index 54e83c8e2a1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/RulesMap.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model;
-
-import com.sun.jersey.server.impl.uri.PathPattern;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.TreeMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class RulesMap<R> extends TreeMap<PathPattern, R>{
- public RulesMap() {
- super(PathPattern.COMPARATOR);
- }
-
- public PathPattern hasConflict(PathPattern p) {
- for (PathPattern cp : keySet()) {
- if (cp.equals(p)) {
- return cp;
- }
- }
- return null;
- }
-
- public interface ConflictClosure {
- void onConflict(PathPattern p1, PathPattern p2);
- }
-
- public void processConflicts(ConflictClosure cc) {
- final List<PathPattern> ks = new ArrayList<PathPattern>(keySet());
- for (int i = 0; i < ks.size(); i++) {
- final PathPattern p1 = ks.get(i);
- for (int j = i + 1; j < ks.size(); j++) {
- final PathPattern p2 = ks.get(j);
- if (p1.equals(p2)) {
- cc.onConflict(p1, p2);
- }
- }
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.java
deleted file mode 100644
index 285aa9bb1ce..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method;
-
-import com.sun.jersey.api.container.ContainerException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResourceHeadWrapperMethod extends ResourceMethod {
- private final ResourceMethod m;
-
- public ResourceHeadWrapperMethod(ResourceMethod m) {
- super("HEAD",
- m.getTemplate(),
- m.getConsumes(),
- m.getProduces(),
- m.isProducesDeclared(),
- m.getDispatcher(),
- m.getRequestFilters(),
- m.getResponseFilters());
-
- if (!m.getHttpMethod().equals("GET")) {
- throw new ContainerException("");
- }
-
- this.m = m;
- }
-
- @Override
- public String toString() {
- return m.toString();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.java
deleted file mode 100644
index 7704629c188..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.server.impl.container.filter.FilterFactory;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.spi.container.ResourceFilter;
-import com.sun.jersey.spi.inject.Errors;
-import java.lang.reflect.Method;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResourceHttpMethod extends ResourceMethod {
- private final AbstractResourceMethod arm;
-
- public ResourceHttpMethod(
- ResourceMethodDispatchProvider dp,
- FilterFactory ff,
- AbstractResourceMethod arm) {
- this(dp, ff, UriTemplate.EMPTY, arm);
- }
-
- public ResourceHttpMethod(
- ResourceMethodDispatchProvider dp,
- FilterFactory ff,
- UriTemplate template,
- AbstractResourceMethod arm) {
- this(dp, ff, ff.getResourceFilters(arm), template, arm);
- }
-
- public ResourceHttpMethod(
- ResourceMethodDispatchProvider dp,
- FilterFactory ff,
- List<ResourceFilter> resourceFilters,
- UriTemplate template,
- AbstractResourceMethod arm) {
- super(arm.getHttpMethod(),
- template,
- arm.getSupportedInputTypes(),
- arm.getSupportedOutputTypes(),
- arm.areOutputTypesDeclared(),
- dp.create(arm),
- FilterFactory.getRequestFilters(resourceFilters),
- FilterFactory.getResponseFilters(resourceFilters));
-
- this.arm = arm;
-
- if (getDispatcher() == null) {
- Method m = arm.getMethod();
-
- String msg = ImplMessages.NOT_VALID_HTTPMETHOD(m,
- arm.getHttpMethod(), m.getDeclaringClass());
- Errors.error(msg);
- }
- }
-
- @Override
- public AbstractResourceMethod getAbstractResourceMethod() {
- return arm;
- }
-
- @Override
- public String toString() {
- Method m = arm.getMethod();
- return ImplMessages.RESOURCE_METHOD(m.getDeclaringClass(), m.getName());
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.java
deleted file mode 100644
index e67c78e00c4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method;
-
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.Response;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResourceHttpOptionsMethod extends ResourceMethod {
-
- public static class OptionsRequestDispatcher implements RequestDispatcher {
- protected final String allow;
-
- public OptionsRequestDispatcher(Map<String, List<ResourceMethod>> methods) {
- this.allow = getAllow(methods);
- }
-
- private String getAllow(Map<String, List<ResourceMethod>> methods) {
- StringBuilder s = new StringBuilder("OPTIONS");
- for (String method : methods.keySet()) {
- s.append(',').append(method);
- }
-
- return s.toString();
- }
-
- public void dispatch(Object resource, HttpContext context) {
- Response r = Response.noContent().header("Allow", allow).build();
- context.getResponse().setResponse(r);
- }
- }
-
- public ResourceHttpOptionsMethod(Map<String, List<ResourceMethod>> methods) {
- super("OPTIONS",
- UriTemplate.EMPTY,
- MediaTypes.GENERAL_MEDIA_TYPE_LIST,
- MediaTypes.GENERAL_MEDIA_TYPE_LIST,
- false,
- new OptionsRequestDispatcher(methods));
- }
-
- @Override
- public String toString() {
- return "OPTIONS";
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceMethod.java
deleted file mode 100644
index 52fe3d08a59..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/ResourceMethod.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class ResourceMethod {
-
- /**
- * Comparator for resource methods, comparing the consumed and produced
- * media types.
- * <p>
- * Defer to {@link MediaTypes#MEDIA_TYPE_LIST_COMPARATOR} for comparing
- * the list of media type that are comsumed and produced. The comparison of
- * consumed media take precedence over the comparison of produced
- * media.
- */
- static public final Comparator<ResourceMethod> COMPARATOR = new Comparator<ResourceMethod>() {
- @Override
- public int compare(ResourceMethod o1, ResourceMethod o2) {
- int i = MediaTypes.MEDIA_TYPE_LIST_COMPARATOR.
- compare(o1.consumeMime, o2.consumeMime);
- if (i == 0)
- i = MediaTypes.MEDIA_TYPE_LIST_COMPARATOR.
- compare(o1.produceMime, o2.produceMime);
-
- return i;
- }
- };
-
- private final String httpMethod;
-
- private final UriTemplate template;
-
- private final List<? extends MediaType> consumeMime;
-
- private final List<? extends MediaType> produceMime;
-
- private final boolean isProducesDeclared;
-
- private final RequestDispatcher dispatcher;
-
- private final List<ContainerRequestFilter> requestFilters;
-
- private final List<ContainerResponseFilter> responseFilters;
-
- public ResourceMethod(String httpMethod,
- UriTemplate template,
- List<? extends MediaType> consumeMime,
- List<? extends MediaType> produceMime,
- boolean isProducesDeclared,
- RequestDispatcher dispatcher) {
- this(httpMethod, template, consumeMime, produceMime, isProducesDeclared,
- dispatcher, Collections.EMPTY_LIST, Collections.EMPTY_LIST);
- }
-
- public ResourceMethod(String httpMethod,
- UriTemplate template,
- List<? extends MediaType> consumeMime,
- List<? extends MediaType> produceMime,
- boolean isProducesDeclared,
- RequestDispatcher dispatcher,
- List<ContainerRequestFilter> requestFilters,
- List<ContainerResponseFilter> responseFilters) {
- this.httpMethod = httpMethod;
- this.template = template;
- this.consumeMime = consumeMime;
- this.produceMime = produceMime;
- this.isProducesDeclared = isProducesDeclared;
- this.dispatcher = dispatcher;
- this.requestFilters = requestFilters;
- this.responseFilters = responseFilters;
- }
-
- public final String getHttpMethod() {
- return httpMethod;
- }
-
- public final UriTemplate getTemplate() {
- return template;
- }
-
- public final List<? extends MediaType> getConsumes() {
- return consumeMime;
- }
-
- public final List<? extends MediaType> getProduces() {
- return produceMime;
- }
-
- public final boolean isProducesDeclared() {
- return isProducesDeclared;
- }
-
- public final RequestDispatcher getDispatcher() {
- return dispatcher;
- }
-
- public final List<ContainerRequestFilter> getRequestFilters() {
- return requestFilters;
- }
-
- public final List<ContainerResponseFilter> getResponseFilters() {
- return responseFilters;
- }
-
- /**
- * Ascertain if the method is capable of consuming an entity of a certain
- * media type.
- *
- * @param contentType the media type of the entity that is to be consumed.
- * @return true if the method is capable of consuming the entity,
- * otherwise false.
- */
- public final boolean consumes(MediaType contentType) {
- for (MediaType c : consumeMime) {
- if (c.getType().equals("*")) return true;
-
- if (contentType.isCompatible(c)) return true;
- }
-
- return false;
- }
-
- public final boolean consumesWild() {
- for (MediaType c : consumeMime) {
- if (c.getType().equals("*")) return true;
- }
-
- return false;
- }
-
- public final boolean mediaEquals(ResourceMethod that) {
- boolean v = consumeMime.equals(that.consumeMime);
- if (v == false)
- return false;
-
- return produceMime.equals(that.produceMime);
- }
-
- /**
- * Get the abstract resource method.
- * <p>
- * Extending classes may override this method to return an associated
- * abstract resource method.
- *
- * @return the abstract resource method, otherwise null if there is no
- * abstract resource method assocaiated with the resource method.
- */
- public AbstractResourceMethod getAbstractResourceMethod() {
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.java
deleted file mode 100644
index 64b9cecd93d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method.dispatch;
-
-import com.sun.jersey.spi.container.JavaMethodInvokerFactory;
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.api.JResponse;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.core.spi.factory.ResponseBuilderImpl;
-import com.sun.jersey.server.impl.inject.InjectableValuesProvider;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import com.sun.jersey.spi.inject.Errors;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.GenericEntity;
-import javax.ws.rs.core.Response;
-
-
-/**
- * A partial implementation of {@link ResourceMethodDispatchProvider} that
- * creates instances of {@link RequestDispatcher}.
- * <p>
- * Implementing classes are required to override the
- * {@link #getInjectableValuesProvider(com.sun.jersey.api.model.AbstractResourceMethod) }
- * method to return a {@link InjectableValuesProvider} associated with the parameters
- * of the abstract resource method.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class AbstractResourceMethodDispatchProvider implements ResourceMethodDispatchProvider, ResourceMethodCustomInvokerDispatchProvider {
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
- return this.create(abstractResourceMethod, JavaMethodInvokerFactory.getDefault());
- }
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
-
- final InjectableValuesProvider pp = getInjectableValuesProvider(abstractResourceMethod);
- if (pp == null) {
- return null;
- }
-
- if (pp.getInjectables().contains(null)) {
- // Missing dependency
- for (int i = 0; i < pp.getInjectables().size(); i++) {
- if (pp.getInjectables().get(i) == null) {
- Errors.missingDependency(abstractResourceMethod.getMethod(), i);
- }
- }
- return null;
- }
-
- final Class<?> returnType = abstractResourceMethod.getReturnType();
- if (Response.class.isAssignableFrom(returnType)) {
- return new ResponseOutInvoker(abstractResourceMethod, pp, invoker);
- } else if (JResponse.class.isAssignableFrom(returnType)) {
- return new JResponseOutInvoker(abstractResourceMethod, pp, invoker);
- } else if (returnType != void.class) {
- if (returnType == Object.class || GenericEntity.class.isAssignableFrom(returnType)) {
- return new ObjectOutInvoker(abstractResourceMethod, pp, invoker);
- } else {
- return new TypeOutInvoker(abstractResourceMethod, pp, invoker);
- }
- } else {
- return new VoidOutInvoker(abstractResourceMethod, pp, invoker);
- }
- }
-
- private @Context ServerInjectableProviderContext sipc;
-
- /**
- * Get the server-specific injectable provider context.
- *
- * @return the server-specific injectable provider context
- */
- protected ServerInjectableProviderContext getInjectableProviderContext() {
- return sipc;
- }
-
- /**
- * Get the injectable values provider for an abstract resource method.
- *
- * @param abstractResourceMethod the abstract resource method.
- * @return the injectable values provider, or null if no injectable values
- * can be created for the parameters of the abstract
- * resource method.
- */
- protected abstract InjectableValuesProvider getInjectableValuesProvider(
- AbstractResourceMethod abstractResourceMethod);
-
-
- private static abstract class EntityParamInInvoker extends ResourceJavaMethodDispatcher {
- private final InjectableValuesProvider pp;
-
- EntityParamInInvoker(AbstractResourceMethod abstractResourceMethod,
- InjectableValuesProvider pp) {
- this(abstractResourceMethod, pp, JavaMethodInvokerFactory.getDefault());
- }
-
- EntityParamInInvoker(AbstractResourceMethod abstractResourceMethod,
- InjectableValuesProvider pp, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, invoker);
- this.pp = pp;
- }
-
- final Object[] getParams(HttpContext context) {
- return pp.getInjectableValues(context);
- }
- }
-
- private static final class VoidOutInvoker extends EntityParamInInvoker {
- VoidOutInvoker(AbstractResourceMethod abstractResourceMethod,
- InjectableValuesProvider pp, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, pp, invoker);
- }
-
- @Override
- public void _dispatch(Object resource, HttpContext context)
- throws IllegalAccessException, InvocationTargetException {
- final Object[] params = getParams(context);
- invoker.invoke(method, resource, params);
- }
- }
-
- private static final class TypeOutInvoker extends EntityParamInInvoker {
- private final Type t;
-
- TypeOutInvoker(AbstractResourceMethod abstractResourceMethod,
- InjectableValuesProvider pp, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, pp, invoker);
- this.t = abstractResourceMethod.getGenericReturnType();
- }
-
- @Override
- public void _dispatch(Object resource, HttpContext context)
- throws IllegalAccessException, InvocationTargetException {
- final Object[] params = getParams(context);
-
- final Object o = invoker.invoke(method, resource, params);
- if (o != null) {
- Response r = new ResponseBuilderImpl().
- entityWithType(o, t).status(200).build();
- context.getResponse().setResponse(r);
- }
- }
- }
-
- private static final class ResponseOutInvoker extends EntityParamInInvoker {
- ResponseOutInvoker(AbstractResourceMethod abstractResourceMethod,
- InjectableValuesProvider pp, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, pp, invoker);
- }
-
- @Override
- public void _dispatch(Object resource, HttpContext context)
- throws IllegalAccessException, InvocationTargetException {
- final Object[] params = getParams(context);
-
- final Response r = (Response)invoker.invoke(method, resource, params);
- if (r != null) {
- context.getResponse().setResponse(r);
- }
- }
- }
-
- private static final class JResponseOutInvoker extends EntityParamInInvoker {
- private final Type t;
-
- JResponseOutInvoker(AbstractResourceMethod abstractResourceMethod,
- InjectableValuesProvider pp, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, pp);
- final Type jResponseType = abstractResourceMethod.getGenericReturnType();
- if (jResponseType instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)jResponseType;
- if (pt.getRawType().equals(JResponse.class)) {
- t = ((ParameterizedType)jResponseType).getActualTypeArguments()[0];
- } else {
- t = null;
- }
- } else {
- t = null;
- }
- }
-
- @Override
- public void _dispatch(Object resource, HttpContext context)
- throws IllegalAccessException, InvocationTargetException {
- final Object[] params = getParams(context);
-
- final JResponse<?> r = (JResponse<?>)invoker.invoke(method, resource, params);
- if (r != null) {
- if (t == null) {
- context.getResponse().setResponse(r.toResponse());
- } else {
- context.getResponse().setResponse(r.toResponse(t));
- }
- }
- }
- }
-
- private static final class ObjectOutInvoker extends EntityParamInInvoker {
- ObjectOutInvoker(AbstractResourceMethod abstractResourceMethod,
- InjectableValuesProvider pp, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, pp, invoker);
- }
-
- @Override
- public void _dispatch(Object resource, HttpContext context)
- throws IllegalAccessException, InvocationTargetException {
- final Object[] params = getParams(context);
-
- final Object o = invoker.invoke(method, resource, params);
-
- if (o instanceof Response) {
- context.getResponse().setResponse((Response)o);
- } else if (o instanceof JResponse) {
- context.getResponse().setResponse(((JResponse)o).toResponse());
- } else if (o != null) {
- final Response r = new ResponseBuilderImpl().status(200).entity(o).build();
- context.getResponse().setResponse(r);
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.java
deleted file mode 100644
index 8b1e3299d09..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method.dispatch;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.server.impl.inject.InjectableValuesProvider;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class EntityParamDispatchProvider extends AbstractResourceMethodDispatchProvider {
-
- @Override
- protected InjectableValuesProvider getInjectableValuesProvider(AbstractResourceMethod abstractResourceMethod) {
- return new InjectableValuesProvider(processParameters(abstractResourceMethod));
- }
-
- private List<Injectable> processParameters(AbstractResourceMethod method) {
-
- if ((null == method.getParameters()) || (0 == method.getParameters().size())) {
- return Collections.emptyList();
- }
-
- boolean hasEntity = false;
- final List<Injectable> is = new ArrayList<Injectable>(method.getParameters().size());
- for (int i = 0; i < method.getParameters().size(); i++) {
- final Parameter parameter = method.getParameters().get(i);
-
- if (Parameter.Source.ENTITY == parameter.getSource()) {
- hasEntity = true;
- is.add(processEntityParameter(
- parameter,
- method.getMethod().getParameterAnnotations()[i]));
- } else {
- is.add(getInjectableProviderContext().
- getInjectable(method.getMethod(), parameter, ComponentScope.PerRequest));
- }
- }
-
- if (hasEntity)
- return is;
-
- // Try to find entity if there is one unresolved parameter and
- // the annotations are unknown
- if (Collections.frequency(is, null) == 1) {
- final int i = is.lastIndexOf(null);
- final Parameter parameter = method.getParameters().get(i);
- if (Parameter.Source.UNKNOWN == parameter.getSource()) {
- if (!parameter.isQualified()) {
- final Injectable ij = processEntityParameter(
- parameter,
- method.getMethod().getParameterAnnotations()[i]);
- is.set(i, ij);
- }
- }
- }
-
- return is;
- }
-
- static final class EntityInjectable extends AbstractHttpContextInjectable<Object> {
- final Class<?> c;
- final Type t;
- final Annotation[] as;
-
- EntityInjectable(Class c, Type t, Annotation[] as) {
- this.c = c;
- this.t = t;
- this.as = as;
- }
-
- @Override
- public Object getValue(HttpContext context) {
- return context.getRequest().getEntity(c, t, as);
- }
- }
-
- private Injectable processEntityParameter(
- Parameter parameter,
- Annotation[] annotations) {
- return new EntityInjectable(parameter.getParameterClass(),
- parameter.getParameterType(), annotations);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.java
deleted file mode 100644
index 0acfebca343..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method.dispatch;
-
-import com.sun.jersey.spi.container.JavaMethodInvokerFactory;
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.inject.InjectableValuesProvider;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import com.sun.jersey.spi.inject.Injectable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MultivaluedMap;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class FormDispatchProvider extends AbstractResourceMethodDispatchProvider {
- public static final String FORM_PROPERTY = "com.sun.jersey.api.representation.form";
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
- return this.create(abstractResourceMethod, JavaMethodInvokerFactory.getDefault());
- }
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
- if ("GET".equals(abstractResourceMethod.getHttpMethod())) {
- return null;
- }
-
- return super.create(abstractResourceMethod, invoker);
- }
-
- @Override
- protected InjectableValuesProvider getInjectableValuesProvider(AbstractResourceMethod abstractResourceMethod) {
- List<Injectable> is = processParameters(abstractResourceMethod);
- if (is == null)
- return null;
-
- return new FormParameterProvider(is);
- }
-
- @Context private MultivaluedParameterExtractorProvider mpep;
-
- protected MultivaluedParameterExtractorProvider getMultivaluedParameterExtractorProvider() {
- return mpep;
- }
-
- private void processForm(HttpContext context) {
- Form form = (Form)context.getProperties().get(FORM_PROPERTY);
- if (form == null) {
- form = context.getRequest().getEntity(Form.class);
- context.getProperties().put(FORM_PROPERTY, form);
- }
- }
-
- private final class FormParameterProvider extends InjectableValuesProvider {
- public FormParameterProvider(List<Injectable> is) {
- super(is);
- }
-
- @Override
- public Object[] getInjectableValues(HttpContext context) {
- processForm(context);
-
- return super.getInjectableValues(context);
- }
- }
-
- private List<Injectable> processParameters(AbstractResourceMethod method) {
- if (method.getParameters().isEmpty()) {
- return null;
- }
-
- boolean hasFormParam = false;
- for (int i = 0; i < method.getParameters().size(); i++) {
- Parameter parameter = method.getParameters().get(i);
- if (parameter.getAnnotation() != null)
- hasFormParam |= parameter.getAnnotation().annotationType() == FormParam.class;
- }
- if (!hasFormParam)
- return null;
-
- return getInjectables(method);
- }
-
- private static final class FormEntityInjectable extends AbstractHttpContextInjectable<Object> {
- final Class<?> c;
- final Type t;
- final Annotation[] as;
-
- FormEntityInjectable(Class c, Type t, Annotation[] as) {
- this.c = c;
- this.t = t;
- this.as = as;
- }
-
- @Override
- public Object getValue(HttpContext context) {
- return context.getProperties().get(FORM_PROPERTY);
- }
- }
-
- protected List<Injectable> getInjectables(AbstractResourceMethod method) {
- List<Injectable> is = new ArrayList<Injectable>(method.getParameters().size());
- for (int i = 0; i < method.getParameters().size(); i++) {
- Parameter p = method.getParameters().get(i);
-
- if (Parameter.Source.ENTITY == p.getSource()) {
- if (MultivaluedMap.class.isAssignableFrom(p.getParameterClass())) {
- is.add(new FormEntityInjectable(p.getParameterClass(),
- p.getParameterType(), p.getAnnotations()));
- } else
- is.add(null);
- } else {
- Injectable injectable = getInjectableProviderContext().
- getInjectable(method.getMethod(), p, ComponentScope.PerRequest);
- is.add(injectable);
- }
- }
- return is;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.java
deleted file mode 100644
index 7cfd046bcc6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method.dispatch;
-
-import com.sun.jersey.spi.container.JavaMethodInvokerFactory;
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-
-/**
- * A dispatch provider implementation that answers to methods with a return
- * definition of void, receiving only HttpRequestContext and HttpResponseContext
- * (a service alike method).
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class HttpReqResDispatchProvider implements ResourceMethodDispatchProvider, ResourceMethodCustomInvokerDispatchProvider {
-
- @SuppressWarnings("unchecked")
- private static final Class[] EXPECTED_METHOD_PARAMS = new Class[]{HttpRequestContext.class, HttpResponseContext.class};
-
- static final class HttpReqResDispatcher extends ResourceJavaMethodDispatcher {
- HttpReqResDispatcher(AbstractResourceMethod abstractResourceMethod) {
- this(abstractResourceMethod, JavaMethodInvokerFactory.getDefault());
- }
-
- HttpReqResDispatcher(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, invoker);
- }
-
- @Override
- public void _dispatch(Object resource, HttpContext context) throws InvocationTargetException, IllegalAccessException {
- invoker.invoke(method, resource, context.getRequest(), context.getResponse());
- }
- }
-
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
- return this.create(abstractResourceMethod, JavaMethodInvokerFactory.getDefault());
- }
-
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
- // TODO: add return type to ARM
- if (abstractResourceMethod.getMethod().getReturnType() != void.class) return null;
-
- // TODO: use ARM getParams instead
- Class<?>[] parameters = abstractResourceMethod.getMethod().getParameterTypes();
- if (!Arrays.deepEquals(parameters, EXPECTED_METHOD_PARAMS)) return null;
-
- return new HttpReqResDispatcher(abstractResourceMethod, invoker);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.java
deleted file mode 100644
index 9bf5262cebe..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method.dispatch;
-
-import com.sun.jersey.spi.container.JavaMethodInvokerFactory;
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import com.sun.jersey.spi.inject.Injectable;
-import java.util.List;
-import java.util.logging.Logger;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.core.MediaType;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class MultipartFormDispatchProvider extends FormDispatchProvider {
- private static final Logger LOGGER = Logger.getLogger(MultipartFormDispatchProvider.class.getName());
-
- private static MediaType MULTIPART_FORM_DATA = new MediaType("multipart", "form-data");
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod method) {
- return this.create(method, JavaMethodInvokerFactory.getDefault());
- }
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod method, JavaMethodInvoker invoker) {
- boolean found = false;
- for (MediaType m : method.getSupportedInputTypes()) {
- found = (!m.isWildcardSubtype() && m.isCompatible(MULTIPART_FORM_DATA));
- if (found) break;
- }
- if (!found)
- return null;
-
- return super.create(method, invoker);
- }
-
- @Override
- protected List<Injectable> getInjectables(AbstractResourceMethod method) {
- for (int i = 0; i < method.getParameters().size(); i++) {
- Parameter p = method.getParameters().get(i);
-
- if (p.getAnnotation().annotationType() == FormParam.class) {
- LOGGER.severe("Resource methods utilizing @FormParam "
- + "and consuming \"multipart/form-data\" are no longer supported. See @FormDataParam.");
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.java
deleted file mode 100644
index cb4a2df5ada..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method.dispatch;
-
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class ResourceJavaMethodDispatcher implements RequestDispatcher {
-
- protected final JavaMethodInvoker invoker;
-
- protected final Method method;
-
- private final Annotation[] annotations;
-
- public ResourceJavaMethodDispatcher(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
- this.method = abstractResourceMethod.getMethod();
- this.annotations = abstractResourceMethod.getAnnotations();
- this.invoker = invoker;
- }
-
- @Override
- public final void dispatch(Object resource, HttpContext context) {
- // Invoke the method on the resource
- try {
- _dispatch(resource, context);
- // Set the annotations if no exception is thrown and
- // there exists an entity
- if (context.getResponse().getEntity() != null)
- context.getResponse().setAnnotations(annotations);
- } catch (InvocationTargetException e) {
- // Propagate the target exception so it may be mapped to a response
- throw new MappableContainerException(e.getTargetException());
- } catch (IllegalAccessException e) {
- throw new ContainerException(e);
- }
- }
-
- protected abstract void _dispatch(Object resource, HttpContext context) throws InvocationTargetException, IllegalAccessException;
-
- @Override
- public String toString() {
- return method.toString();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.java
deleted file mode 100644
index c1740a22ea1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.method.dispatch;
-
-import com.sun.jersey.spi.container.JavaMethodInvokerFactory;
-import com.sun.jersey.spi.container.JavaMethodInvoker;
-import com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider;
-import com.sun.jersey.spi.container.ResourceMethodDispatchProvider;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * A provider for methods that are marked as void and receiving no args.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class VoidVoidDispatchProvider implements ResourceMethodDispatchProvider, ResourceMethodCustomInvokerDispatchProvider {
-
- public static final class VoidVoidMethodInvoker extends ResourceJavaMethodDispatcher {
- public VoidVoidMethodInvoker(AbstractResourceMethod abstractResourceMethod) {
- this(abstractResourceMethod, JavaMethodInvokerFactory.getDefault());
- }
-
- public VoidVoidMethodInvoker(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
- super(abstractResourceMethod, invoker);
- }
-
- @Override
- public void _dispatch(Object resource, HttpContext context)
- throws IllegalAccessException, InvocationTargetException {
- invoker.invoke(method, resource);
- }
- }
-
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
- return this.create(abstractResourceMethod, JavaMethodInvokerFactory.getDefault());
- }
-
- @Override
- public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
- if (!abstractResourceMethod.getParameters().isEmpty()) return null;
- if (abstractResourceMethod.getReturnType() != void.class) return null;
-
- return new VoidVoidMethodInvoker(abstractResourceMethod, invoker);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.java
deleted file mode 100644
index ee657d9a302..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import java.lang.annotation.Annotation;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class BaseParamInjectableProvider<A extends Annotation> implements
- InjectableProvider<A, Parameter> {
- private final MultivaluedParameterExtractorProvider mpep;
-
- BaseParamInjectableProvider(MultivaluedParameterExtractorProvider mpep) {
- this.mpep = mpep;
- }
-
- public ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- protected MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p) {
- return mpep.getWithoutDefaultValue(p);
- }
-
- protected MultivaluedParameterExtractor get(Parameter p) {
- return mpep.get(p);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.java
deleted file mode 100644
index e20a9e66f33..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.ParamException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.model.parameter.multivalued.ExtractorContainerException;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.core.Cookie;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class CookieParamInjectableProvider extends BaseParamInjectableProvider<CookieParam> {
-
- private static final class CookieParamInjectable extends AbstractHttpContextInjectable<Object> {
- private final MultivaluedParameterExtractor extractor;
-
- CookieParamInjectable(MultivaluedParameterExtractor extractor) {
- this.extractor = extractor;
- }
-
- public Object getValue(HttpContext context) {
- try {
- return extractor.extract(context.getRequest().getCookieNameValueMap());
- } catch (ExtractorContainerException e) {
- throw new ParamException.CookieParamException(e.getCause(),
- extractor.getName(), extractor.getDefaultStringValue());
- }
- }
- }
-
- private static final class CookieTypeParamInjectable extends AbstractHttpContextInjectable<Cookie> {
- private final String name;
-
- CookieTypeParamInjectable(String name) {
- this.name = name;
- }
-
- public Cookie getValue(HttpContext context) {
- return context.getRequest().getCookies().get(name);
- }
- }
-
- public CookieParamInjectableProvider(MultivaluedParameterExtractorProvider w) {
- super(w);
- }
-
- public Injectable getInjectable(ComponentContext ic, CookieParam a, Parameter c) {
- String parameterName = c.getSourceName();
- if (parameterName == null || parameterName.length() == 0) {
- // Invalid cookie parameter name
- return null;
- }
-
- if (c.getParameterClass() == Cookie.class) {
- return new CookieTypeParamInjectable(parameterName);
- } else {
- MultivaluedParameterExtractor e = get(c);
-
- if (e == null)
- return null;
- return new CookieParamInjectable(e);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.java
deleted file mode 100644
index 78e4fe230b3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.ParamException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider;
-import com.sun.jersey.server.impl.model.parameter.multivalued.ExtractorContainerException;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.core.MediaType;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class FormParamInjectableProvider extends BaseParamInjectableProvider<FormParam> {
-
- private static final class FormParamInjectable extends AbstractHttpContextInjectable<Object> {
- private final MultivaluedParameterExtractor extractor;
- private final boolean decode;
-
- FormParamInjectable(MultivaluedParameterExtractor extractor, boolean decode) {
- this.extractor = extractor;
- this.decode = decode;
- }
-
- public Object getValue(HttpContext context) {
- Form form = (Form)
- context.getProperties().get(FormDispatchProvider.FORM_PROPERTY);
- if (form == null) {
- form = getForm(context);
- if (form == null)
- throw new IllegalStateException(
- "The @FormParam is utilized when the content type of the request entity " +
- "is not application/x-www-form-urlencoded");
- }
-
- try {
- return extractor.extract(form);
- } catch (ExtractorContainerException e) {
- throw new ParamException.FormParamException(e.getCause(),
- extractor.getName(), extractor.getDefaultStringValue());
- }
- }
-
- private Form getForm(HttpContext context) {
- final HttpRequestContext r = context.getRequest();
- if (r.getMethod().equals("GET"))
- return null;
-
- if (!MediaTypes.typeEquals(MediaType.APPLICATION_FORM_URLENCODED_TYPE, r.getMediaType()))
- return null;
-
- final Form form = r.getFormParameters();
- context.getProperties().put(FormDispatchProvider.FORM_PROPERTY, form);
- return form;
- }
- }
-
- public FormParamInjectableProvider(MultivaluedParameterExtractorProvider w) {
- super(w);
- }
-
- public Injectable getInjectable(ComponentContext ic, FormParam a, Parameter c) {
- String parameterName = c.getSourceName();
- if (parameterName == null || parameterName.length() == 0) {
- // Invalid query parameter name
- return null;
- }
-
- MultivaluedParameterExtractor e = get(c);
- if (e == null)
- return null;
-
- return new FormParamInjectable(e, !c.isEncoded());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.java
deleted file mode 100644
index 1077cb85707..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.ParamException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.model.parameter.multivalued.ExtractorContainerException;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import javax.ws.rs.HeaderParam;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class HeaderParamInjectableProvider extends BaseParamInjectableProvider<HeaderParam> {
-
- private static final class HeaderParamInjectable extends AbstractHttpContextInjectable<Object> {
- private MultivaluedParameterExtractor extractor;
-
- HeaderParamInjectable(MultivaluedParameterExtractor extractor) {
- this.extractor = extractor;
- }
-
- public Object getValue(HttpContext context) {
- try {
- return extractor.extract(context.getRequest().getRequestHeaders());
- } catch (ExtractorContainerException e) {
- throw new ParamException.HeaderParamException(e.getCause(),
- extractor.getName(), extractor.getDefaultStringValue());
- }
- }
- }
-
- public HeaderParamInjectableProvider(MultivaluedParameterExtractorProvider w) {
- super(w);
- }
-
- public Injectable getInjectable(ComponentContext ic, HeaderParam a, Parameter c) {
- String parameterName = c.getSourceName();
- if (parameterName == null || parameterName.length() == 0) {
- // Invalid header parameter name
- return null;
- }
-
- MultivaluedParameterExtractor e = get(c);
- if (e == null)
- return null;
-
- return new HeaderParamInjectable(e);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.java
deleted file mode 100644
index f3e84cd95f3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.ExtendedUriInfo;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.InjectableProvider;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.reflect.Type;
-import java.util.HashMap;
-import java.util.Map;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Request;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriInfo;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class HttpContextInjectableProvider implements
- InjectableProvider<Context, Type> {
-
- private static final class HttpContextInjectable extends AbstractHttpContextInjectable<Object> {
- public Object getValue(HttpContext context) {
- return context;
- }
- }
-
- private static final class HttpContextRequestInjectable extends AbstractHttpContextInjectable<Object> {
- public Object getValue(HttpContext context) {
- return context.getRequest();
- }
- }
-
- private static final class UriInfoInjectable extends AbstractHttpContextInjectable<UriInfo> {
- public UriInfo getValue(HttpContext context) {
- return context.getUriInfo();
- }
- }
-
- private final Map<Type, Injectable> injectables;
-
- public HttpContextInjectableProvider() {
- injectables = new HashMap<Type, Injectable>();
-
- HttpContextRequestInjectable re = new HttpContextRequestInjectable();
- injectables.put(HttpHeaders.class, re);
- injectables.put(Request.class, re);
- injectables.put(SecurityContext.class, re);
-
- injectables.put(HttpContext.class, new HttpContextInjectable());
-
- injectables.put(UriInfo.class, new UriInfoInjectable());
- injectables.put(ExtendedUriInfo.class, new UriInfoInjectable());
- }
-
- public ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- public Injectable getInjectable(ComponentContext ic, Context a, Type c) {
- return injectables.get(c);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.java
deleted file mode 100644
index 7e743e27e08..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.ParamException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.model.parameter.multivalued.ExtractorContainerException;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import java.util.List;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.core.PathSegment;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class MatrixParamInjectableProvider extends BaseParamInjectableProvider<MatrixParam> {
-
- private static final class MatrixParamInjectable extends AbstractHttpContextInjectable<Object> {
- private final MultivaluedParameterExtractor extractor;
- private final boolean decode;
-
- MatrixParamInjectable(MultivaluedParameterExtractor extractor, boolean decode) {
- this.extractor = extractor;
- this.decode = decode;
- }
-
- @Override
- public Object getValue(HttpContext context) {
- List<PathSegment> l = context.getUriInfo().getPathSegments(decode);
- PathSegment p = l.get(l.size() - 1);
- try {
- return extractor.extract(p.getMatrixParameters());
- } catch (ExtractorContainerException e) {
- throw new ParamException.MatrixParamException(e.getCause(),
- extractor.getName(), extractor.getDefaultStringValue());
- }
- }
- }
-
- public MatrixParamInjectableProvider(MultivaluedParameterExtractorProvider w) {
- super(w);
- }
-
- @Override
- public Injectable getInjectable(ComponentContext ic, MatrixParam a, Parameter c) {
- String parameterName = c.getSourceName();
- if (parameterName == null || parameterName.length() == 0) {
- // Invalid header parameter name
- return null;
- }
-
- MultivaluedParameterExtractor e = get(c);
- if (e == null)
- return null;
-
- return new MatrixParamInjectable(e, !c.isEncoded());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.java
deleted file mode 100644
index 0aabf1b9079..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.ParamException.PathParamException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.model.parameter.multivalued.ExtractorContainerException;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.List;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.PathSegment;
-
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class PathParamInjectableProvider extends BaseParamInjectableProvider<PathParam> {
-
- private static final class PathParamInjectable extends AbstractHttpContextInjectable<Object> {
- private final MultivaluedParameterExtractor extractor;
- private final boolean decode;
-
- PathParamInjectable(MultivaluedParameterExtractor extractor, boolean decode) {
- this.extractor = extractor;
- this.decode = decode;
- }
-
- public Object getValue(HttpContext context) {
- try {
- return extractor.extract(context.getUriInfo().getPathParameters(decode));
- } catch (ExtractorContainerException e) {
- throw new PathParamException.PathParamException(e.getCause(),
- extractor.getName(), extractor.getDefaultStringValue());
- }
- }
- }
-
- private static final class PathParamPathSegmentInjectable extends AbstractHttpContextInjectable<PathSegment> {
- private final String name;
- private final boolean decode;
-
- PathParamPathSegmentInjectable(String name, boolean decode) {
- this.name = name;
- this.decode = decode;
- }
-
- public PathSegment getValue(HttpContext context) {
- List<PathSegment> ps = context.getUriInfo().getPathSegments(name, decode);
- if (ps.isEmpty())
- return null;
- return ps.get(ps.size() - 1);
- }
- }
-
- private static final class PathParamListPathSegmentInjectable extends AbstractHttpContextInjectable<List<PathSegment>> {
- private final String name;
- private final boolean decode;
-
- PathParamListPathSegmentInjectable(String name, boolean decode) {
- this.name = name;
- this.decode = decode;
- }
-
- public List<PathSegment> getValue(HttpContext context) {
- return context.getUriInfo().getPathSegments(name, decode);
- }
- }
-
- public PathParamInjectableProvider(MultivaluedParameterExtractorProvider w) {
- super(w);
- }
-
- public Injectable<?> getInjectable(ComponentContext ic, PathParam a, Parameter c) {
- String parameterName = c.getSourceName();
- if (parameterName == null || parameterName.length() == 0) {
- // Invalid URI parameter name
- return null;
- }
-
- if (c.getParameterClass() == PathSegment.class) {
- return new PathParamPathSegmentInjectable(parameterName,
- !c.isEncoded());
- } else if (c.getParameterClass() == List.class &&
- c.getParameterType() instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)c.getParameterType();
- Type[] targs = pt.getActualTypeArguments();
- if (targs.length == 1 && targs[0] == PathSegment.class) {
- return new PathParamListPathSegmentInjectable(
- parameterName, !c.isEncoded());
- }
- }
-
- MultivaluedParameterExtractor e = getWithoutDefaultValue(c);
- if (e == null)
- return null;
-
- return new PathParamInjectable(e, !c.isEncoded());
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.java
deleted file mode 100644
index d9ef1a462ac..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter;
-
-import com.sun.jersey.api.ParamException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.model.parameter.multivalued.ExtractorContainerException;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractor;
-import com.sun.jersey.server.impl.model.parameter.multivalued.MultivaluedParameterExtractorProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import javax.ws.rs.QueryParam;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class QueryParamInjectableProvider extends BaseParamInjectableProvider<QueryParam> {
-
- private static final class QueryParamInjectable extends AbstractHttpContextInjectable<Object> {
- private final MultivaluedParameterExtractor extractor;
- private final boolean decode;
-
- QueryParamInjectable(MultivaluedParameterExtractor extractor, boolean decode) {
- this.extractor = extractor;
- this.decode = decode;
- }
-
- public Object getValue(HttpContext context) {
- try {
- return extractor.extract(context.getUriInfo().getQueryParameters(decode));
- } catch (ExtractorContainerException e) {
- throw new ParamException.QueryParamException(e.getCause(),
- extractor.getName(), extractor.getDefaultStringValue());
- }
- }
- }
-
- public QueryParamInjectableProvider(MultivaluedParameterExtractorProvider w) {
- super(w);
- }
-
- public Injectable getInjectable(ComponentContext ic, QueryParam a, Parameter c) {
- String parameterName = c.getSourceName();
- if (parameterName == null || parameterName.length() == 0) {
- // Invalid query parameter name
- return null;
- }
-
- MultivaluedParameterExtractor e = get(c);
- if (e == null)
- return null;
-
- return new QueryParamInjectable(e, !c.isEncoded());
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.java
deleted file mode 100644
index 0ef6fd40e97..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.spi.StringReader;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-abstract class AbstractStringReaderExtractor
- implements MultivaluedParameterExtractor {
- protected final StringReader sr;
- protected final String parameter;
- protected final String defaultStringValue;
-
- public AbstractStringReaderExtractor(StringReader sr, String parameter, String defaultStringValue) {
- this.sr = sr;
- this.parameter = parameter;
- this.defaultStringValue = defaultStringValue;
- if (defaultStringValue != null) {
- StringReader.ValidateDefaultValue validate = sr.getClass().
- getAnnotation(StringReader.ValidateDefaultValue.class);
- if (validate == null || validate.value()) {
- sr.fromString(defaultStringValue);
- }
- }
- }
-
- public String getName() {
- return parameter;
- }
-
- public String getDefaultStringValue() {
- return defaultStringValue;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.java
deleted file mode 100644
index 4ac4645578f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-abstract class CollectionStringExtractor<V extends Collection<String>>
- implements MultivaluedParameterExtractor {
- final String parameter;
- final String defaultValue;
-
- protected CollectionStringExtractor(String parameter, String defaultValue) {
- this.parameter = parameter;
- this.defaultValue = defaultValue;
- }
-
- public String getName() {
- return parameter;
- }
-
- public String getDefaultStringValue() {
- return defaultValue;
- }
-
- public Object extract(MultivaluedMap<String, String> parameters) {
- List<String> stringList = parameters.get(parameter);
- if (stringList != null) {
- V copy = getInstance();
- copy.addAll(stringList);
- return copy;
- } else if (defaultValue != null) {
- V l = getInstance();
- l.add(defaultValue);
- return l;
- }
-
- return getInstance();
- }
-
- protected abstract V getInstance();
-
- private static final class ListString extends CollectionStringExtractor<List<String>> {
- public ListString(String parameter, String defaultValue) {
- super(parameter, defaultValue);
- }
-
- @Override
- protected List<String> getInstance() {
- return new ArrayList<String>();
- }
- }
-
- private static final class SetString extends CollectionStringExtractor<Set<String>> {
- public SetString(String parameter, String defaultValue) {
- super(parameter, defaultValue);
- }
-
- @Override
- protected Set<String> getInstance() {
- return new HashSet<String>();
- }
- }
-
- private static final class SortedSetString extends CollectionStringExtractor<SortedSet<String>> {
- public SortedSetString(String parameter, String defaultValue) {
- super(parameter, defaultValue);
- }
-
- @Override
- protected SortedSet<String> getInstance() {
- return new TreeSet<String>();
- }
- }
-
- static MultivaluedParameterExtractor getInstance(Class c,
- String parameter, String defaultValue) {
- if (List.class == c)
- return new ListString(parameter, defaultValue);
- else if (Set.class == c)
- return new SetString(parameter, defaultValue);
- else if (SortedSet.class == c)
- return new SortedSetString(parameter, defaultValue);
- else
- throw new RuntimeException();
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.java
deleted file mode 100644
index 9b3b9c23062..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.spi.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-abstract class CollectionStringReaderExtractor<V extends Collection>
- extends AbstractStringReaderExtractor {
-
- protected CollectionStringReaderExtractor(StringReader sr, String parameter, String defaultStringValue) {
- super(sr, parameter, defaultStringValue);
- }
-
- public Object extract(MultivaluedMap<String, String> parameters) {
- final List<String> stringList = parameters.get(parameter);
- if (stringList != null) {
- final V valueList = getInstance();
- for (String v : stringList) {
- valueList.add((v.length() == 0) ? null : sr.fromString(v));
- }
-
- return valueList;
- } else if (defaultStringValue != null) {
- final V valueList = getInstance();
- valueList.add(sr.fromString(defaultStringValue));
- return valueList;
- } else {
- return getInstance();
- }
- }
-
- protected abstract V getInstance();
-
- private static final class ListValueOf extends CollectionStringReaderExtractor<List> {
-
- ListValueOf(StringReader sr, String parameter, String defaultValueString) {
- super(sr, parameter, defaultValueString);
- }
-
- protected List getInstance() {
- return new ArrayList();
- }
- }
-
- private static final class SetValueOf extends CollectionStringReaderExtractor<Set> {
-
- SetValueOf(StringReader sr, String parameter, String defaultValueString) {
- super(sr, parameter, defaultValueString);
- }
-
- protected Set getInstance() {
- return new HashSet();
- }
- }
-
- private static final class SortedSetValueOf extends CollectionStringReaderExtractor<SortedSet> {
-
- SortedSetValueOf(StringReader sr, String parameter, String defaultValueString) {
- super(sr, parameter, defaultValueString);
- }
-
- protected SortedSet getInstance() {
- return new TreeSet();
- }
- }
-
- static MultivaluedParameterExtractor getInstance(Class c,
- StringReader sr, String parameter, String defaultValueString) {
- if (List.class == c) {
- return new ListValueOf(sr, parameter, defaultValueString);
- } else if (Set.class == c) {
- return new SetValueOf(sr, parameter, defaultValueString);
- } else if (SortedSet.class == c) {
- return new SortedSetValueOf(sr, parameter, defaultValueString);
- } else {
- throw new RuntimeException();
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.java
deleted file mode 100644
index 2c2e1832d85..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.container.ContainerException;
-import javax.ws.rs.WebApplicationException;
-
-/**
- * A runtime exception that contains a cause, a checked or runtime exception,
- * that may be passed to the cause of a {@link WebApplicationException}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ExtractorContainerException extends ContainerException {
-
- public ExtractorContainerException() {
- super();
- }
-
- public ExtractorContainerException(String message) {
- super(message);
- }
-
- public ExtractorContainerException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ExtractorContainerException(Throwable cause) {
- super(cause);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.java
deleted file mode 100644
index 73211fdec4a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.spi.StringReader;
-import com.sun.jersey.spi.StringReaderProvider;
-import com.sun.jersey.spi.inject.Injectable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Map;
-import java.util.WeakHashMap;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.Providers;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.UnmarshalException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-import org.xml.sax.InputSource;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class JAXBStringReaderProviders {
-
- private static final Map<Class, JAXBContext> jaxbContexts =
- new WeakHashMap<Class, JAXBContext>();
-
- private final Providers ps;
-
- private final ContextResolver<JAXBContext> context;
-
- private final ContextResolver<Unmarshaller> unmarshaller;
-
- public JAXBStringReaderProviders(Providers ps) {
- this.ps = ps;
-
- this.context = ps.getContextResolver(JAXBContext.class, null);
- this.unmarshaller = ps.getContextResolver(Unmarshaller.class, null);
- }
-
- protected final Unmarshaller getUnmarshaller(Class type) throws JAXBException {
- if (unmarshaller != null) {
- Unmarshaller u = unmarshaller.getContext(type);
- if (u != null) {
- return u;
- }
- }
-
- return getJAXBContext(type).createUnmarshaller();
- }
-
- private final JAXBContext getJAXBContext(Class type) throws JAXBException {
- if (context != null) {
- JAXBContext c = context.getContext(type);
- if (c != null) {
- return c;
- }
- }
-
- return getStoredJAXBContext(type);
- }
-
- protected JAXBContext getStoredJAXBContext(Class type) throws JAXBException {
- synchronized (jaxbContexts) {
- JAXBContext c = jaxbContexts.get(type);
- if (c == null) {
- c = JAXBContext.newInstance(type);
- jaxbContexts.put(type, c);
- }
- return c;
- }
- }
-
- public static class RootElementProvider extends JAXBStringReaderProviders implements StringReaderProvider {
-
- // Delay construction of factory
- private final Injectable<SAXParserFactory> spf;
-
- public RootElementProvider(@Context Injectable<SAXParserFactory> spf, @Context Providers ps) {
- super(ps);
- this.spf = spf;
- }
-
- public StringReader getStringReader(final Class type, Type genericType, Annotation[] annotations) {
- final boolean supported = (type.getAnnotation(XmlRootElement.class) != null ||
- type.getAnnotation(XmlType.class) != null);
- if (!supported) {
- return null;
- }
-
- return new StringReader() {
- public Object fromString(String value) {
- try {
- final SAXSource source = new SAXSource(
- spf.getValue().newSAXParser().getXMLReader(),
- new InputSource(new java.io.StringReader(value)));
-
- final Unmarshaller u = getUnmarshaller(type);
- if (type.isAnnotationPresent(XmlRootElement.class)) {
- return u.unmarshal(source);
- } else {
- return u.unmarshal(source, type).getValue();
- }
- } catch (UnmarshalException ex) {
- throw new ExtractorContainerException(ImplMessages.ERROR_UNMARSHALLING_JAXB(type), ex);
- } catch (JAXBException ex) {
- throw new ContainerException(ImplMessages.ERROR_UNMARSHALLING_JAXB(type), ex);
- } catch (Exception ex) {
- throw new ContainerException(ImplMessages.ERROR_UNMARSHALLING_JAXB(type), ex);
- }
- }
- };
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.java
deleted file mode 100644
index 051bef6cb1f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface MultivaluedParameterExtractor {
-
- String getName();
-
- String getDefaultStringValue();
-
- Object extract(MultivaluedMap<String, String> parameters);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.java
deleted file mode 100644
index 498de1c8f66..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.reflection.ReflectionHelper.TypeClassPair;
-import com.sun.jersey.spi.StringReader;
-import com.sun.jersey.spi.StringReaderWorkers;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Set;
-import java.util.SortedSet;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class MultivaluedParameterExtractorFactory implements MultivaluedParameterExtractorProvider {
-
- private final StringReaderWorkers w;
-
- public MultivaluedParameterExtractorFactory(StringReaderWorkers w) {
- this.w = w;
- }
-
- @Override
- public MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p) {
- return process(
- w,
- null,
- p.getParameterClass(),
- p.getParameterType(),
- p.getAnnotations(),
- p.getSourceName());
- }
-
- @Override
- public MultivaluedParameterExtractor get(Parameter p) {
- return process(
- w,
- p.getDefaultValue(),
- p.getParameterClass(),
- p.getParameterType(),
- p.getAnnotations(),
- p.getSourceName());
- }
-
- private MultivaluedParameterExtractor process(
- StringReaderWorkers w,
- String defaultValue,
- Class<?> parameter,
- Type parameterType,
- Annotation[] annotations,
- String parameterName) {
-
- if (parameter == List.class ||
- parameter == Set.class ||
- parameter == SortedSet.class) {
- // Get the generic type of the list
- // If none default to String
- final TypeClassPair tcp = ReflectionHelper.getTypeArgumentAndClass(parameterType);
- if (tcp == null || tcp.c == String.class) {
- return CollectionStringExtractor.getInstance(
- parameter, parameterName, defaultValue);
- } else {
- final StringReader sr = w.getStringReader(tcp.c, tcp.t, annotations);
- if (sr == null)
- return null;
-
- try {
- return CollectionStringReaderExtractor.getInstance(
- parameter, sr, parameterName, defaultValue);
- } catch (Exception e) {
- throw new ContainerException("Could not process parameter type " + parameter, e);
- }
- }
- } else if (parameter == String.class) {
- return new StringExtractor(parameterName, defaultValue);
- } else if (parameter.isPrimitive()) {
- // Convert primitive to wrapper class
- parameter = PrimitiveMapper.primitiveToClassMap.get(parameter);
- if (parameter == null) {
- // Primitive type not supported
- return null;
- }
-
- // Check for static valueOf(String )
- Method valueOf = ReflectionHelper.getValueOfStringMethod(parameter);
- if (valueOf != null) {
- try {
- Object defaultDefaultValue = PrimitiveMapper.primitiveToDefaultValueMap.get(parameter);
- return new PrimitiveValueOfExtractor(valueOf, parameterName,
- defaultValue, defaultDefaultValue);
- } catch (Exception e) {
- throw new ContainerException(ImplMessages.DEFAULT_COULD_NOT_PROCESS_METHOD(defaultValue, valueOf));
- }
- }
-
- } else {
- final StringReader sr = w.getStringReader(parameter, parameterType, annotations);
- if (sr == null)
- return null;
-
- try {
- return new StringReaderExtractor(sr, parameterName, defaultValue);
- } catch (Exception e) {
- throw new ContainerException("Could not process parameter type " + parameter, e);
- }
- }
-
- return null;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.java
deleted file mode 100644
index 9df94db2b23..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.model.Parameter;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface MultivaluedParameterExtractorProvider {
-
- /**
- *
- * @param p
- * @return
- */
- MultivaluedParameterExtractor get(Parameter p);
-
- /**
- *
- * @param p
- * @return
- */
- MultivaluedParameterExtractor getWithoutDefaultValue(Parameter p);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.java
deleted file mode 100644
index ddb97d22c60..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-final class PrimitiveMapper {
-
- static final Map<Class, Class> primitiveToClassMap =
- getPrimitiveToClassMap();
-
- static final Map<Class, Object> primitiveToDefaultValueMap =
- getPrimitiveToDefaultValueMap();
-
- private static Map<Class, Class> getPrimitiveToClassMap() {
- Map<Class, Class> m = new WeakHashMap<Class, Class>();
- // Put all primitive to wrapper class mappings except
- // that for Character
- m.put(Boolean.TYPE, Boolean.class);
- m.put(Byte.TYPE, Byte.class);
- m.put(Short.TYPE, Short.class);
- m.put(Integer.TYPE, Integer.class);
- m.put(Long.TYPE, Long.class);
- m.put(Float.TYPE, Float.class);
- m.put(Double.TYPE, Double.class);
-
- return Collections.unmodifiableMap(m);
- }
-
- private static Map<Class, Object> getPrimitiveToDefaultValueMap() {
- Map<Class, Object> m = new WeakHashMap<Class, Object>();
- m.put(Boolean.class, Boolean.valueOf(false));
- m.put(Byte.class, Byte.valueOf((byte)0));
- m.put(Short.class, Short.valueOf((short)0));
- m.put(Integer.class, Integer.valueOf(0));
- m.put(Long.class, Long.valueOf(0l));
- m.put(Float.class, Float.valueOf(0.0f));
- m.put(Double.class, Double.valueOf(0.0d));
-
- return Collections.unmodifiableMap(m);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.java
deleted file mode 100644
index ae213f1afc2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.container.ContainerException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-final class PrimitiveValueOfExtractor
- implements MultivaluedParameterExtractor {
- final Method valueOf;
- final String parameter;
- final String defaultStringValue;
- final Object defaultValue;
- final Object defaultDefaultValue;
-
- public PrimitiveValueOfExtractor(Method valueOf, String parameter,
- String defaultStringValue, Object defaultDefaultValue)
- throws IllegalAccessException, InvocationTargetException {
- this.valueOf = valueOf;
- this.parameter = parameter;
- this.defaultStringValue = defaultStringValue;
- this.defaultValue = (defaultStringValue != null) ?
- getValue(defaultStringValue) : null;
- this.defaultDefaultValue = defaultDefaultValue;
- }
-
- @Override
- public String getName() {
- return parameter;
- }
-
- @Override
- public String getDefaultStringValue() {
- return defaultStringValue;
- }
-
- private Object getValue(String v) {
- try {
- return valueOf.invoke(null, v);
- } catch (InvocationTargetException ex) {
- Throwable target = ex.getTargetException();
- if (target instanceof WebApplicationException) {
- throw (WebApplicationException)target;
- } else {
- throw new ExtractorContainerException(target);
- }
- } catch (RuntimeException ex) {
- throw new ContainerException(ex);
- } catch (Exception ex) {
- throw new ContainerException(ex);
- }
- }
-
- @Override
- public Object extract(MultivaluedMap<String, String> parameters) {
- String v = parameters.getFirst(parameter);
- if (v != null && !v.trim().isEmpty()) {
- return getValue(v);
- } else if (defaultValue != null) {
- // TODO do we need to clone the default value
- return defaultValue;
- }
-
- return defaultDefaultValue;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.java
deleted file mode 100644
index 15bce23fda6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import javax.ws.rs.core.MultivaluedMap;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-final class StringExtractor implements MultivaluedParameterExtractor {
- final String parameter;
- final String defaultValue;
-
- public StringExtractor(String parameter) {
- this(parameter, null);
- }
-
- public StringExtractor(String parameter, String defaultValue) {
- this.parameter = parameter;
- this.defaultValue = defaultValue;
- }
-
- public String getName() {
- return parameter;
- }
-
- public String getDefaultStringValue() {
- return defaultValue;
- }
-
- public Object extract(MultivaluedMap<String, String> parameters) {
- String value = parameters.getFirst(parameter);
- return (value != null) ? value : defaultValue;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.java
deleted file mode 100644
index 6b21d5e2354..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.spi.StringReader;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-final class StringReaderExtractor extends AbstractStringReaderExtractor {
-
- public StringReaderExtractor(StringReader sr, String parameter, String defaultStringValue) {
- super(sr, parameter, defaultStringValue);
- }
-
- public Object extract(MultivaluedMap<String, String> parameters) {
- String v = parameters.getFirst(parameter);
- if (v != null) {
- try {
- return sr.fromString(v);
- } catch (WebApplicationException ex) {
- throw ex;
- } catch (ContainerException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new ExtractorContainerException(ex);
- }
- } else if (defaultStringValue != null) {
- return sr.fromString(defaultStringValue);
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.java
deleted file mode 100644
index 5e7cc06c1f7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.spi.StringReader;
-import com.sun.jersey.spi.StringReaderProvider;
-import com.sun.jersey.spi.StringReaderWorkers;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class StringReaderFactory implements StringReaderWorkers {
-
- private Set<StringReaderProvider> readers;
-
- public void init(ProviderServices providerServices) {
- this.readers = providerServices.getProvidersAndServices(StringReaderProvider.class);
- }
-
- public <T> StringReader<T> getStringReader(Class<T> type, Type genericType, Annotation[] annotations) {
- for (StringReaderProvider<T> srp : readers) {
- StringReader<T> sr = srp.getStringReader(type, genericType, annotations);
- if (sr != null)
- return sr;
- }
- return null;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.java
deleted file mode 100644
index 958a0e1272e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.model.parameter.multivalued;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.core.header.HttpDateFormat;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.spi.StringReader;
-import com.sun.jersey.spi.StringReaderProvider;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.text.ParseException;
-import java.util.Date;
-import javax.ws.rs.WebApplicationException;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class StringReaderProviders {
-
- private static abstract class AbstractStringReader implements StringReader {
-
- public Object fromString(String value) {
- try {
- return _fromString(value);
- } catch (InvocationTargetException ex) {
- Throwable target = ex.getTargetException();
- if (target instanceof WebApplicationException) {
- throw (WebApplicationException)target;
- } else {
- throw new ExtractorContainerException(target);
- }
- } catch (Exception ex) {
- throw new ContainerException(ex);
- }
- }
-
- protected abstract Object _fromString(String value) throws Exception;
- }
-
- public static class StringConstructor implements StringReaderProvider {
-
- public StringReader getStringReader(Class type, Type genericType, Annotation[] annotations) {
- final Constructor constructor = ReflectionHelper.getStringConstructor(type);
- if (constructor == null)
- return null;
-
- return new AbstractStringReader() {
- protected Object _fromString(String value) throws Exception {
- return constructor.newInstance(value);
- }
- };
- }
- }
-
- public static class TypeValueOf implements StringReaderProvider {
-
- public StringReader getStringReader(Class type, Type genericType, Annotation[] annotations) {
- final Method valueOf = ReflectionHelper.getValueOfStringMethod(type);
- if (valueOf == null)
- return null;
-
- return new AbstractStringReader() {
- public Object _fromString(String value) throws Exception {
- return valueOf.invoke(null, value);
- }
- };
- }
- }
-
- public static class TypeFromString implements StringReaderProvider {
-
- public StringReader getStringReader(Class type, Type genericType, Annotation[] annotations) {
- final Method fromString = ReflectionHelper.getFromStringStringMethod(type);
- if (fromString == null)
- return null;
-
- return new AbstractStringReader() {
- public Object _fromString(String value) throws Exception {
- return fromString.invoke(null, value);
- }
- };
- }
- }
-
- public static class TypeFromStringEnum extends TypeFromString {
-
- @Override
- public StringReader getStringReader(Class type, Type genericType, Annotation[] annotations) {
- if (!Enum.class.isAssignableFrom(type))
- return null;
-
- return super.getStringReader(type, genericType, annotations);
- }
- }
-
- public static class DateProvider implements StringReaderProvider {
-
- public StringReader getStringReader(Class type, Type genericType, Annotation[] annotations) {
- if (type != Date.class)
- return null;
-
- return new StringReader() {
- public Object fromString(String value) {
- try {
- return HttpDateFormat.readDate(value);
- } catch (ParseException ex) {
- throw new ExtractorContainerException(ex);
- }
- }
- };
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.java
deleted file mode 100644
index 11f4b9fea46..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.java
+++ /dev/null
@@ -1,686 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.modelapi.annotation;
-
-import com.sun.jersey.core.reflection.AnnotatedMethod;
-import com.sun.jersey.core.reflection.MethodList;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.api.model.AbstractField;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceConstructor;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSetterMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.model.AbstractSubResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.model.Parameter.Source;
-import com.sun.jersey.api.model.Parameterized;
-import com.sun.jersey.api.model.PathValue;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.impl.ImplMessages;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.WeakHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.Encoded;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-
-/**
- *
- * @author japod
- */
-public class IntrospectionModeller {
-
- private static final Logger LOGGER = Logger.getLogger(IntrospectionModeller.class.getName());
-
- public static AbstractResource createResource(Class<?> resourceClass) {
- final Class<?> annotatedResourceClass = getAnnotatedResourceClass(resourceClass);
- final Path rPathAnnotation = annotatedResourceClass.getAnnotation(Path.class);
- final boolean isRootResourceClass = (null != rPathAnnotation);
-
- final boolean isEncodedAnotOnClass =
- (null != annotatedResourceClass.getAnnotation(Encoded.class));
-
- AbstractResource resource;
-
- if (isRootResourceClass) {
- resource = new AbstractResource(resourceClass,
- new PathValue(rPathAnnotation.value()));
- } else { // just a subresource class
- resource = new AbstractResource(resourceClass);
- }
-
- workOutConstructorsList(resource, resourceClass.getConstructors(),
- isEncodedAnotOnClass);
-
- workOutFieldsList(resource, isEncodedAnotOnClass);
-
- final MethodList methodList = new MethodList(resourceClass);
-
- workOutSetterMethodsList(resource, methodList, isEncodedAnotOnClass);
-
- final Consumes classScopeConsumesAnnotation =
- annotatedResourceClass.getAnnotation(Consumes.class);
- final Produces classScopeProducesAnnotation =
- annotatedResourceClass.getAnnotation(Produces.class);
- workOutResourceMethodsList(resource, methodList, isEncodedAnotOnClass,
- classScopeConsumesAnnotation, classScopeProducesAnnotation);
- workOutSubResourceMethodsList(resource, methodList, isEncodedAnotOnClass,
- classScopeConsumesAnnotation, classScopeProducesAnnotation);
- workOutSubResourceLocatorsList(resource, methodList, isEncodedAnotOnClass);
-
- workOutPostConstructPreDestroy(resource);
-
- if (LOGGER.isLoggable(Level.FINEST)) {
- LOGGER.finest(ImplMessages.NEW_AR_CREATED_BY_INTROSPECTION_MODELER(
- resource.toString()));
- }
-
- return resource;
- }
-
- private static Class getAnnotatedResourceClass(Class rc) {
- if (rc.isAnnotationPresent(Path.class)) return rc;
-
- for (Class i : rc.getInterfaces())
- if (i.isAnnotationPresent(Path.class)) return i;
-
- return rc;
- }
-
- private static void addConsumes(
- AnnotatedMethod am,
- AbstractResourceMethod resourceMethod,
- Consumes consumeMimeAnnotation) {
- // Override annotation is present in method
- if (am.isAnnotationPresent(Consumes.class))
- consumeMimeAnnotation = am.getAnnotation(Consumes.class);
-
- resourceMethod.setAreInputTypesDeclared(consumeMimeAnnotation != null);
- resourceMethod.getSupportedInputTypes().addAll(
- MediaTypes.createMediaTypes(consumeMimeAnnotation));
- }
-
- private static void addProduces(
- AnnotatedMethod am,
- AbstractResourceMethod resourceMethod,
- Produces produceMimeAnnotation) {
- // Override annotation is present in method
- if (am.isAnnotationPresent(Produces.class))
- produceMimeAnnotation = am.getAnnotation(Produces.class);
-
- resourceMethod.setAreOutputTypesDeclared(produceMimeAnnotation != null);
- resourceMethod.getSupportedOutputTypes().addAll(
- MediaTypes.createQualitySourceMediaTypes(produceMimeAnnotation));
- }
-
- private static void workOutConstructorsList(
- AbstractResource resource,
- Constructor[] ctorArray,
- boolean isEncoded) {
- if (null != ctorArray) {
- for (Constructor ctor : ctorArray) {
- final AbstractResourceConstructor aCtor =
- new AbstractResourceConstructor(ctor);
- processParameters(
- resource.getResourceClass(),
- ctor.getDeclaringClass(),
- aCtor,
- ctor,
- isEncoded);
- resource.getConstructors().add(aCtor);
- }
- }
- }
-
- private static void workOutFieldsList(
- AbstractResource resource,
- boolean isEncoded) {
- Class c = resource.getResourceClass();
- if (c.isInterface())
- return;
-
- while (c != Object.class) {
- for (final Field f : c.getDeclaredFields()) {
- if (f.getDeclaredAnnotations().length > 0) {
- final AbstractField af = new AbstractField(f);
- Parameter p = createParameter(
- resource.getResourceClass(),
- f.getDeclaringClass(),
- isEncoded,
- f.getType(),
- f.getGenericType(),
- f.getAnnotations());
- if (null != p) {
- af.getParameters().add(p);
- resource.getFields().add(af);
- }
- }
- }
- c = c.getSuperclass();
- }
- }
-
- private static void workOutPostConstructPreDestroy(AbstractResource resource) {
- Class postConstruct = ReflectionHelper.classForName("javax.annotation.PostConstruct");
- if (postConstruct == null)
- return;
-
- Class preDestroy = ReflectionHelper.classForName("javax.annotation.PreDestroy");
-
- final MethodList methodList = new MethodList(resource.getResourceClass(), true);
- HashSet<String> names = new HashSet<String>();
- for (AnnotatedMethod m : methodList.
- hasAnnotation(postConstruct).
- hasNumParams(0).
- hasReturnType(void.class)) {
- Method method = m.getMethod();
- // only add method if not hidden/overridden
- if (names.add(method.getName())) {
- ReflectionHelper.setAccessibleMethod(method);
- resource.getPostConstructMethods().add(0, method);
- }
- }
-
- names = new HashSet<String>();
- for (AnnotatedMethod m : methodList.
- hasAnnotation(preDestroy).
- hasNumParams(0).
- hasReturnType(void.class)) {
- Method method = m.getMethod();
- // only add method if not hidden/overridden
- if (names.add(method.getName())) {
- ReflectionHelper.setAccessibleMethod(method);
- resource.getPreDestroyMethods().add(method);
- }
- }
- }
-
- private static void workOutSetterMethodsList(
- AbstractResource resource,
- MethodList methodList,
- boolean isEncoded) {
- for (AnnotatedMethod m : methodList.
- hasNotMetaAnnotation(HttpMethod.class).
- hasNotAnnotation(Path.class).
- hasNumParams(1).
- hasReturnType(void.class).
- nameStartsWith("set")) {
-
- final AbstractSetterMethod asm = new AbstractSetterMethod(resource, m.getMethod(), m.getAnnotations());
- Parameter p = createParameter(
- resource.getResourceClass(),
- m.getMethod().getDeclaringClass(),
- isEncoded,
- m.getParameterTypes()[0],
- m.getGenericParameterTypes()[0],
- m.getAnnotations());
- if (null != p) {
- asm.getParameters().add(p);
- resource.getSetterMethods().add(asm);
- }
- }
- }
-
- private static void workOutResourceMethodsList(
- AbstractResource resource,
- MethodList methodList,
- boolean isEncoded,
- Consumes classScopeConsumesAnnotation,
- Produces classScopeProducesAnnotation) {
- for (AnnotatedMethod m : methodList.hasMetaAnnotation(HttpMethod.class).
- hasNotAnnotation(Path.class)) {
-
- final ReflectionHelper.ClassTypePair ct = getGenericReturnType(resource.getResourceClass(), m.getMethod());
- final AbstractResourceMethod resourceMethod = new AbstractResourceMethod(
- resource,
- m.getMethod(),
- ct.c, ct.t,
- m.getMetaMethodAnnotations(HttpMethod.class).get(0).value(),
- m.getAnnotations());
-
- addConsumes(m, resourceMethod, classScopeConsumesAnnotation);
- addProduces(m, resourceMethod, classScopeProducesAnnotation);
- processParameters(
- resourceMethod.getResource().getResourceClass(),
- resourceMethod.getMethod().getDeclaringClass(),
- resourceMethod, m, isEncoded);
-
- resource.getResourceMethods().add(resourceMethod);
- }
- }
-
- private static ReflectionHelper.ClassTypePair getGenericReturnType(
- Class concreteClass,
- Method m) {
- return getGenericType(concreteClass, m.getDeclaringClass(), m.getReturnType(), m.getGenericReturnType());
- }
-
- private static void workOutSubResourceMethodsList(
- AbstractResource resource,
- MethodList methodList,
- boolean isEncoded,
- Consumes classScopeConsumesAnnotation,
- Produces classScopeProducesAnnotation) {
-
- for (AnnotatedMethod m : methodList.hasMetaAnnotation(HttpMethod.class).hasAnnotation(Path.class)) {
-
- final Path mPathAnnotation = m.getAnnotation(Path.class);
- final PathValue pv = new PathValue(mPathAnnotation.value());
-
- final boolean emptySegmentCase = "/".equals(pv.getValue()) || "".equals(pv.getValue());
-
- if (!emptySegmentCase) {
- final ReflectionHelper.ClassTypePair ct = getGenericReturnType(resource.getResourceClass(), m.getMethod());
- final AbstractSubResourceMethod abstractSubResourceMethod = new AbstractSubResourceMethod(
- resource,
- m.getMethod(),
- ct.c, ct.t,
- pv,
- m.getMetaMethodAnnotations(HttpMethod.class).get(0).value(),
- m.getAnnotations());
-
- addConsumes(m, abstractSubResourceMethod, classScopeConsumesAnnotation);
- addProduces(m, abstractSubResourceMethod, classScopeProducesAnnotation);
- processParameters(
- abstractSubResourceMethod.getResource().getResourceClass(),
- abstractSubResourceMethod.getMethod().getDeclaringClass(),
- abstractSubResourceMethod, m, isEncoded);
-
- resource.getSubResourceMethods().add(abstractSubResourceMethod);
-
- } else { // treat the sub-resource method as a resource method
- final ReflectionHelper.ClassTypePair ct = getGenericReturnType(resource.getResourceClass(), m.getMethod());
- final AbstractResourceMethod abstractResourceMethod = new AbstractResourceMethod(
- resource,
- m.getMethod(),
- ct.c, ct.t,
- m.getMetaMethodAnnotations(HttpMethod.class).get(0).value(),
- m.getAnnotations());
-
- addConsumes(m, abstractResourceMethod, classScopeConsumesAnnotation);
- addProduces(m, abstractResourceMethod, classScopeProducesAnnotation);
- processParameters(
- abstractResourceMethod.getResource().getResourceClass(),
- abstractResourceMethod.getMethod().getDeclaringClass(),
- abstractResourceMethod, m, isEncoded);
-
- resource.getResourceMethods().add(abstractResourceMethod);
- }
- }
- }
-
- private static void workOutSubResourceLocatorsList(
- AbstractResource resource,
- MethodList methodList,
- boolean isEncoded) {
-
- for (AnnotatedMethod m : methodList.hasNotMetaAnnotation(HttpMethod.class).
- hasAnnotation(Path.class)) {
- final Path mPathAnnotation = m.getAnnotation(Path.class);
- final AbstractSubResourceLocator subResourceLocator = new AbstractSubResourceLocator(
- resource,
- m.getMethod(),
- new PathValue(
- mPathAnnotation.value()),
- m.getAnnotations());
-
- processParameters(
- subResourceLocator.getResource().getResourceClass(),
- subResourceLocator.getMethod().getDeclaringClass(),
- subResourceLocator, m, isEncoded);
-
- resource.getSubResourceLocators().add(subResourceLocator);
- }
- }
-
- private static void processParameters(
- Class concreteClass,
- Class declaringClass,
- Parameterized parametrized,
- Constructor ctor,
- boolean isEncoded) {
- Class[] parameterTypes = ctor.getParameterTypes();
- Type[] genericParameterTypes = ctor.getGenericParameterTypes();
- // Workaround bug http://bugs.sun.com/view_bug.do?bug_id=5087240
- if (parameterTypes.length != genericParameterTypes.length) {
- Type[] _genericParameterTypes = new Type[parameterTypes.length];
- _genericParameterTypes[0] = parameterTypes[0];
- System.arraycopy(genericParameterTypes, 0, _genericParameterTypes, 1, genericParameterTypes.length);
- genericParameterTypes = _genericParameterTypes;
- }
-
- processParameters(
- concreteClass, declaringClass,
- parametrized,
- ((null != ctor.getAnnotation(Encoded.class)) || isEncoded),
- parameterTypes,
- genericParameterTypes,
- ctor.getParameterAnnotations());
- }
-
- private static void processParameters(
- Class concreteClass,
- Class declaringClass,
- Parameterized parametrized,
- AnnotatedMethod method,
- boolean isEncoded) {
- processParameters(
- concreteClass, declaringClass,
- parametrized,
- ((null != method.getAnnotation(Encoded.class)) || isEncoded),
- method.getParameterTypes(),
- method.getGenericParameterTypes(),
- method.getParameterAnnotations());
- }
-
- private static void processParameters(
- Class concreteClass,
- Class declaringClass,
- Parameterized parametrized,
- boolean isEncoded,
- Class[] parameterTypes,
- Type[] genericParameterTypes,
- Annotation[][] parameterAnnotations) {
-
- for (int i = 0; i < parameterTypes.length; i++) {
- Parameter parameter = createParameter(
- concreteClass, declaringClass,
- isEncoded, parameterTypes[i],
- genericParameterTypes[i],
- parameterAnnotations[i]);
- if (null != parameter) {
- parametrized.getParameters().add(parameter);
- } else {
- // clean up the parameters
- parametrized.getParameters().removeAll(parametrized.getParameters());
- break;
- }
- }
- }
-
- private static interface ParamAnnotationHelper<T extends Annotation> {
-
- public String getValueOf(T a);
-
- public Parameter.Source getSource();
- }
-
- private static Map<Class, ParamAnnotationHelper> createParamAnotHelperMap() {
- Map<Class, ParamAnnotationHelper> m = new WeakHashMap<Class, ParamAnnotationHelper>();
- m.put(Context.class, new ParamAnnotationHelper<Context>() {
-
- @Override
- public String getValueOf(Context a) {
- return null;
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.CONTEXT;
- }
- });
- m.put(HeaderParam.class, new ParamAnnotationHelper<HeaderParam>() {
-
- @Override
- public String getValueOf(HeaderParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.HEADER;
- }
- });
- m.put(CookieParam.class, new ParamAnnotationHelper<CookieParam>() {
-
- @Override
- public String getValueOf(CookieParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.COOKIE;
- }
- });
- m.put(MatrixParam.class, new ParamAnnotationHelper<MatrixParam>() {
-
- @Override
- public String getValueOf(MatrixParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.MATRIX;
- }
- });
- m.put(QueryParam.class, new ParamAnnotationHelper<QueryParam>() {
-
- @Override
- public String getValueOf(QueryParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.QUERY;
- }
- });
- m.put(PathParam.class, new ParamAnnotationHelper<PathParam>() {
-
- @Override
- public String getValueOf(PathParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.PATH;
- }
- });
- m.put(FormParam.class, new ParamAnnotationHelper<FormParam>() {
-
- @Override
- public String getValueOf(FormParam a) {
- return a.value();
- }
-
- @Override
- public Parameter.Source getSource() {
- return Parameter.Source.FORM;
- }
- });
- return Collections.unmodifiableMap(m);
- }
- private final static Map<Class, ParamAnnotationHelper> ANOT_HELPER_MAP =
- createParamAnotHelperMap();
-
- @SuppressWarnings("unchecked")
- private static Parameter createParameter(
- Class concreteClass,
- Class declaringClass,
- boolean isEncoded,
- Class<?> paramClass,
- Type paramType,
- Annotation[] annotations) {
-
- if (null == annotations) {
- return null;
- }
-
- Annotation paramAnnotation = null;
- Parameter.Source paramSource = null;
- String paramName = null;
- boolean paramEncoded = isEncoded;
- String paramDefault = null;
-
- /**
- * Create a parameter from the list of annotations.
- * Unknown annotated parameters are also supported, and in such a
- * cases the last unrecognized annotation is taken to be that
- * associated with the parameter.
- */
- for (Annotation annotation : annotations) {
- if (ANOT_HELPER_MAP.containsKey(annotation.annotationType())) {
- ParamAnnotationHelper helper = ANOT_HELPER_MAP.get(annotation.annotationType());
- paramAnnotation = annotation;
- paramSource = helper.getSource();
- paramName = helper.getValueOf(annotation);
- } else if (Encoded.class == annotation.annotationType()) {
- paramEncoded = true;
- } else if (DefaultValue.class == annotation.annotationType()) {
- paramDefault = ((DefaultValue) annotation).value();
- } else {
- paramAnnotation = annotation;
- paramSource = Source.UNKNOWN;
- paramName = getValue(annotation);
- }
- }
-
- if (paramAnnotation == null) {
- paramSource = Parameter.Source.ENTITY;
- }
-
- ReflectionHelper.ClassTypePair ct = getGenericType(concreteClass, declaringClass, paramClass, paramType);
- paramType = ct.t;
- paramClass = ct.c;
-
- return new Parameter(
- annotations, paramAnnotation,
- paramSource,
- paramName, paramType, paramClass,
- paramEncoded, paramDefault);
- }
-
- private static String getValue(Annotation a) {
- try {
- Method m = a.annotationType().getMethod("value");
- if (m.getReturnType() != String.class)
- return null;
- return (String)m.invoke(a);
- } catch (Exception ex) {
- }
- return null;
- }
-
- private static ReflectionHelper.ClassTypePair getGenericType(
- final Class concreteClass,
- final Class declaringClass,
- final Class c,
- final Type t) {
- if (t instanceof TypeVariable) {
- ReflectionHelper.ClassTypePair ct = ReflectionHelper.resolveTypeVariable(
- concreteClass,
- declaringClass,
- (TypeVariable)t);
-
- if (ct != null) {
- return ct;
- }
- } else if (t instanceof ParameterizedType) {
- final ParameterizedType pt = (ParameterizedType)t;
- final Type[] ptts = pt.getActualTypeArguments();
- boolean modified = false;
- for (int i = 0; i < ptts.length; i++) {
- ReflectionHelper.ClassTypePair ct =
- getGenericType(concreteClass, declaringClass, (Class)pt.getRawType(), ptts[i]);
- if (ct.t != ptts[i]) {
- ptts[i] = ct.t;
- modified = true;
- }
- }
- if (modified) {
- ParameterizedType rpt = new ParameterizedType() {
- @Override
- public Type[] getActualTypeArguments() {
- return ptts.clone();
- }
-
- @Override
- public Type getRawType() {
- return pt.getRawType();
- }
-
- @Override
- public Type getOwnerType() {
- return pt.getOwnerType();
- }
- };
- return new ReflectionHelper.ClassTypePair((Class)pt.getRawType(), rpt);
- }
- } else if (t instanceof GenericArrayType) {
- GenericArrayType gat = (GenericArrayType)t;
- final ReflectionHelper.ClassTypePair ct =
- getGenericType(concreteClass, declaringClass, null, gat.getGenericComponentType());
- if (gat.getGenericComponentType() != ct.t) {
- try {
- Class ac = ReflectionHelper.getArrayClass(ct.c);
- return new ReflectionHelper.ClassTypePair(ac, ac);
- } catch (Exception e) {
- }
- }
- }
-
- return new ReflectionHelper.ClassTypePair(c, t);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.java
deleted file mode 100644
index 5a7f1fe8bad..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-package com.sun.jersey.server.impl.modelapi.validation;
-
-import com.sun.jersey.api.model.AbstractModelComponent;
-import com.sun.jersey.api.model.AbstractModelVisitor;
-import com.sun.jersey.api.model.ResourceModelIssue;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Abstract resource model validator allows to simply implement
- * validators of resource model. A validator maintains a list
- * of model issues found. User can call validate method to validate
- * several resources by a single validator and collect issues.
- *
- * @author Jakub.Podlesak@Sun.COM
- */
-public abstract class AbstractModelValidator implements AbstractModelVisitor {
-
- final List<ResourceModelIssue> issueList = new LinkedList<ResourceModelIssue>();
-
- /**
- * Returns a list of issues found after {@link #validate(com.sun.jersey.api.model.AbstractModelComponent) }
- * method has been invoked
- * @return a non-null list of issues
- */
- public List<ResourceModelIssue> getIssueList() {
- return issueList;
- }
-
- /**
- * Convenience method to see if there were fatal issues found
- * @return true if there are any fatal issues present in the current issue list
- */
- public boolean fatalIssuesFound() {
- for (ResourceModelIssue issue : getIssueList()) {
- if (issue.isFatal()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Removes all issues from the current issue list. The method could be used
- * to re-use the same validator for another resource model
- */
- public void cleanIssueList() {
- issueList.clear();
- }
-
- /**
- * The validate method validates a component and adds possible
- * issues found to it's list. The list of issues could be then retreived
- * via getIssueList method
- *
- * @param component
- */
- public void validate(final AbstractModelComponent component) {
- component.accept(this);
- List<AbstractModelComponent> componentList = component.getComponents();
- if (null != componentList) {
- for (AbstractModelComponent subcomponent : componentList) {
- validate(subcomponent);
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.java
deleted file mode 100644
index 692ec445e9b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.modelapi.validation;
-
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.api.model.AbstractField;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceConstructor;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSetterMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.model.AbstractSubResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.model.Parameterized;
-import com.sun.jersey.api.model.ResourceModelIssue;
-import com.sun.jersey.core.reflection.AnnotatedMethod;
-import com.sun.jersey.core.reflection.MethodList;
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.CookieParam;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.MatrixParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-
-/**
- * <p>Performs a basic check on abstract resources. Validity check populates a list of potential issues
- * with the given resource. The issues are divided into two categories: fatal and non-fatal issues.
- * The former type prevents the resource to be deployed and makes the whole web application
- * deployment fail.
- *
- * <p>To check a single resource class, one could
- * use the {@link IntrospectionModeller#createResource(java.lang.Class)} method
- * to get an abstract resource model. {@link AbstractModelValidator#validate(com.sun.jersey.api.model.AbstractModelComponent)}
- * method then populates the issue list, which could be then obtained by the {@link AbstractModelValidator#getIssueList()}.
- * Unless you explicitly clear the list, subsequent calls to the validate method will add new items to the list,
- * so that you can build the issue list for more than one resource. To clear the list, you may want to call
- * {@link AbstractModelValidator#cleanIssueList()} method.
- *
- * @author jakub.podlesak@oracle.com
- */
-public class BasicValidator extends AbstractModelValidator {
-
- @Override
- public void visitAbstractResource(AbstractResource resource) {
- // uri template of the resource, if present should not contain null value
- if (resource.isRootResource() && ((null == resource.getPath()) || (null == resource.getPath().getValue()))) {
- issueList.add(new ResourceModelIssue(
- resource,
- ImplMessages.ERROR_RES_URI_PATH_INVALID(resource.getResourceClass(), resource.getPath()),
- true)); // TODO: is it really a fatal issue?
- }
-
- checkNonPublicMethods(resource);
- }
-
- @Override
- public void visitAbstractResourceConstructor(AbstractResourceConstructor constructor) {
- // TODO check parameters
- }
-
- @Override
- public void visitAbstractField(AbstractField field) {
- final Field f = field.getField();
- checkParameter(field.getParameters().get(0), f, f.toGenericString(), f.getName());
- }
-
- @Override
- public void visitAbstractSetterMethod(AbstractSetterMethod setterMethod) {
- final Method m = setterMethod.getMethod();
- checkParameter(setterMethod.getParameters().get(0), m, m.toGenericString(), "1");
- }
-
- @Override
- public void visitAbstractResourceMethod(AbstractResourceMethod method) {
- checkParameters(method, method.getMethod());
-
- if ("GET".equals(method.getHttpMethod())) {
- if (!isRequestResponseMethod(method)) {
- // ensure GET returns non-void value
- if (void.class == method.getMethod().getReturnType()) {
- issueList.add(new ResourceModelIssue(
- method,
- ImplMessages.ERROR_GET_RETURNS_VOID(method.getMethod()),
- false));
- }
-
- // ensure GET does not consume an entity parameter
- if (method.hasEntity()) {
- issueList.add(new ResourceModelIssue(
- method,
- ImplMessages.ERROR_GET_CONSUMES_ENTITY(method.getMethod()),
- false));
- }
- }
- }
-
- // ensure there is not multiple HTTP method designators specified on the method
- List<String> httpAnnotList = new LinkedList<String>();
- for (Annotation a : method.getMethod().getDeclaredAnnotations()) {
- if (null != a.annotationType().getAnnotation(HttpMethod.class)) {
- httpAnnotList.add(a.toString());
- } else if ((a.annotationType() == Path.class) && !(method instanceof AbstractSubResourceMethod)) {
- issueList.add(new ResourceModelIssue(
- method, ImplMessages.SUB_RES_METHOD_TREATED_AS_RES_METHOD(method.getMethod(), ((Path)a).value()), false));
- }
- }
- if (httpAnnotList.size() > 1) {
- issueList.add(new ResourceModelIssue(
- method,
- ImplMessages.MULTIPLE_HTTP_METHOD_DESIGNATORS(method.getMethod(), httpAnnotList.toString()),
- true));
- }
-
- final Type t = method.getGenericReturnType();
- if (!isConcreteType(t)) {
- issueList.add(new ResourceModelIssue(
- method.getMethod(),
- "Return type " + t + " of method " + method.getMethod().toGenericString() + " is not resolvable to a concrete type",
- false));
- }
- }
-
- @Override
- public void visitAbstractSubResourceMethod(AbstractSubResourceMethod method) {
- // check the same things that are being checked for resource methods
- visitAbstractResourceMethod(method);
- // and make sure the Path is not null
- if ((null == method.getPath()) || (null == method.getPath().getValue()) || (method.getPath().getValue().length() == 0)) {
- issueList.add(new ResourceModelIssue(
- method,
- ImplMessages.ERROR_SUBRES_METHOD_URI_PATH_INVALID(method.getMethod(), method.getPath()),
- true));
- }
- }
-
- @Override
- public void visitAbstractSubResourceLocator(AbstractSubResourceLocator locator) {
- checkParameters(locator, locator.getMethod());
- if (void.class == locator.getMethod().getReturnType()) {
- issueList.add(new ResourceModelIssue(
- locator,
- ImplMessages.ERROR_SUBRES_LOC_RETURNS_VOID(locator.getMethod()),
- true));
- }
- if ((null == locator.getPath()) || (null == locator.getPath().getValue()) || (locator.getPath().getValue().length() == 0)) {
- issueList.add(new ResourceModelIssue(
- locator,
- ImplMessages.ERROR_SUBRES_LOC_URI_PATH_INVALID(locator.getMethod(), locator.getPath()),
- true));
- }
- // Sub-resource locator can not have an entity parameter
- for (Parameter parameter : locator.getParameters()) {
- if (Parameter.Source.ENTITY == parameter.getSource()) {
- issueList.add(new ResourceModelIssue(
- locator,
- ImplMessages.ERROR_SUBRES_LOC_HAS_ENTITY_PARAM(locator.getMethod()),
- true));
- }
- }
- }
- private static final Set<Class> ParamAnnotationSET = createParamAnnotationSet();
-
- private static Set<Class> createParamAnnotationSet() {
- Set<Class> set = new HashSet<Class>(6);
- set.add(Context.class);
- set.add(HeaderParam.class);
- set.add(CookieParam.class);
- set.add(MatrixParam.class);
- set.add(QueryParam.class);
- set.add(PathParam.class);
- return Collections.unmodifiableSet(set);
- }
-
- private void checkParameter(Parameter p, Object source, String nameForLogging, String paramNameForLogging) {
- int annotCount = 0;
- for (Annotation a : p.getAnnotations()) {
- if (ParamAnnotationSET.contains(a.annotationType())) {
- annotCount++;
- if (annotCount > 1) {
- issueList.add(new ResourceModelIssue(
- source,
- ImplMessages.AMBIGUOUS_PARAMETER(nameForLogging, paramNameForLogging),
- false));
- break;
- }
- }
- }
-
- final Type t = p.getParameterType();
- if (!isConcreteType(t)) {
- issueList.add(new ResourceModelIssue(
- source,
- "Parameter " + paramNameForLogging + " of type " + t + " from " + nameForLogging + " is not resolvable to a concrete type",
- false));
- }
- }
-
- private boolean isConcreteType(Type t) {
- if (t instanceof ParameterizedType) {
- return isConcreteParameterizedType((ParameterizedType)t);
- } else if (!(t instanceof Class)) {
- // GenericArrayType, WildcardType, TypeVariable
- return false;
- }
-
- return true;
- }
-
- private boolean isConcreteParameterizedType(ParameterizedType pt) {
- boolean isConcrete = true;
- for (Type t : pt.getActualTypeArguments()) {
- isConcrete &= isConcreteType(t);
- }
-
- return isConcrete;
- }
-
- private void checkParameters(Parameterized pl, Method m) {
- int paramCount = 0;
- for (Parameter p : pl.getParameters()) {
- checkParameter(p, m, m.toGenericString(), Integer.toString(++paramCount));
- }
- }
-
-
- private List<Method> getDeclaredMethods(final Class _c) {
- final List<Method> ml = new ArrayList<Method>();
-
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- Class c = _c;
- @Override
- public Object run() {
- while (c != Object.class && c != null) {
- ml.addAll(Arrays.asList(c.getDeclaredMethods()));
- c = c.getSuperclass();
- }
- return null;
- }
- });
-
- return ml;
- }
-
- private void checkNonPublicMethods(final AbstractResource ar) {
-
- final MethodList declaredMethods = new MethodList(
- getDeclaredMethods(ar.getResourceClass()));
-
- // non-public resource methods
- for (AnnotatedMethod m : declaredMethods.hasMetaAnnotation(HttpMethod.class).
- hasNotAnnotation(Path.class).isNotPublic()) {
- issueList.add(new ResourceModelIssue(ar, ImplMessages.NON_PUB_RES_METHOD(m.getMethod().toGenericString()), false));
- }
- // non-public subres methods
- for (AnnotatedMethod m : declaredMethods.hasMetaAnnotation(HttpMethod.class).
- hasAnnotation(Path.class).isNotPublic()) {
- issueList.add(new ResourceModelIssue(ar, ImplMessages.NON_PUB_SUB_RES_METHOD(m.getMethod().toGenericString()), false));
- }
- // non-public subres locators
- for (AnnotatedMethod m : declaredMethods.hasNotMetaAnnotation(HttpMethod.class).
- hasAnnotation(Path.class).isNotPublic()) {
- issueList.add(new ResourceModelIssue(ar, ImplMessages.NON_PUB_SUB_RES_LOC(m.getMethod().toGenericString()), false));
- }
- }
-
-
- // TODO: the method could probably have more then 2 params...
- private boolean isRequestResponseMethod(AbstractResourceMethod method) {
- return (method.getMethod().getParameterTypes().length == 2) &&
- (HttpRequestContext.class == method.getMethod().getParameterTypes()[0]) &&
- (HttpResponseContext.class == method.getMethod().getParameterTypes()[1]);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.java
deleted file mode 100644
index bb568aa19e8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.monitoring;
-
-import com.sun.jersey.spi.monitoring.GlassfishMonitoringProvider;
-import com.sun.jersey.spi.service.ServiceConfigurationError;
-import com.sun.jersey.spi.service.ServiceFinder;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class GlassFishMonitoringInitializer {
- private static final Logger LOGGER =
- Logger.getLogger(GlassFishMonitoringInitializer.class.getName());
-
- public static void initialize() {
- try {
- for(GlassfishMonitoringProvider monitoring : ServiceFinder.find(GlassfishMonitoringProvider.class)) {
- monitoring.register();
- }
- } catch (ServiceConfigurationError ex) {
- LOGGER.log(Level.CONFIG, "GlassFish Jersey monitoring could not be enabled. " +
- "Processing will continue but montoring is disabled.", ex);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.java
deleted file mode 100644
index 03b3e304930..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.monitoring;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.monitoring.DispatchingListener;
-import com.sun.jersey.spi.monitoring.DispatchingListenerAdapter;
-import com.sun.jersey.spi.monitoring.RequestListener;
-import com.sun.jersey.spi.monitoring.RequestListenerAdapter;
-import com.sun.jersey.spi.monitoring.ResponseListener;
-import com.sun.jersey.spi.monitoring.ResponseListenerAdapter;
-import java.util.Collections;
-import java.util.Set;
-
-import javax.ws.rs.ext.ExceptionMapper;
-
-/**
- * @author Jakub.Podlesak@Oracle.Com
- */
-public final class MonitoringProviderFactory {
-
- private MonitoringProviderFactory() {}
-
- private static class EmptyListener implements RequestListener, ResponseListener, DispatchingListener {
- @Override
- public void onSubResource(long id, Class subResource) {
- }
-
- @Override
- public void onSubResourceLocator(long id, AbstractSubResourceLocator locator) {
- }
-
- @Override
- public void onResourceMethod(long id, AbstractResourceMethod method) {
- }
-
- @Override
- public void onRequest(long id, ContainerRequest request) {
- }
-
- @Override
- public void onError(long id, Throwable ex) {
- }
-
- @Override
- public void onResponse(long id, ContainerResponse response) {
- }
-
- @Override
- public void onMappedException(long id, Throwable exception, ExceptionMapper mapper) {
- }
- }
-
- private static class AggregatedRequestListener implements RequestListener {
-
- private final Set<RequestListener> listeners;
-
- private AggregatedRequestListener(Set<RequestListener> listeners) {
- this.listeners = Collections.unmodifiableSet(listeners);
- }
-
- @Override
- public void onRequest(long id, ContainerRequest request) {
- for (RequestListener requestListener : listeners) {
- requestListener.onRequest(id, request);
- }
- }
- }
-
- private static class AggregatedResponseListener implements ResponseListener {
-
- private final Set<ResponseListener> listeners;
-
- private AggregatedResponseListener(Set<ResponseListener> listeners) {
- this.listeners = Collections.unmodifiableSet(listeners);
- }
-
- @Override
- public void onError(long id, Throwable ex) {
- for (ResponseListener responseListener : listeners) {
- responseListener.onError(id, ex);
- }
- }
-
- @Override
- public void onResponse(long id, ContainerResponse response) {
- for (ResponseListener responseListener : listeners) {
- responseListener.onResponse(id, response);
- }
- }
-
- @Override
- public void onMappedException(long id, Throwable exception, ExceptionMapper mapper) {
- for (ResponseListener responseListener : listeners) {
- responseListener.onMappedException(id, exception, mapper);
- }
- }
- }
-
-
- private static class AggregatedDispatchingListener implements DispatchingListener {
-
- private final Set<DispatchingListener> listeners;
-
- private AggregatedDispatchingListener(Set<DispatchingListener> listeners) {
- this.listeners = Collections.unmodifiableSet(listeners);
- }
-
- @Override
- public void onSubResource(long id, Class subResource) {
- for (DispatchingListener dispatchingListener : listeners) {
- dispatchingListener.onSubResource(id, subResource);
- }
- }
-
- @Override
- public void onSubResourceLocator(long id, AbstractSubResourceLocator locator) {
- for (DispatchingListener dispatchingListener : listeners) {
- dispatchingListener.onSubResourceLocator(id, locator);
- }
- }
-
- @Override
- public void onResourceMethod(long id, AbstractResourceMethod method) {
- for (DispatchingListener dispatchingListener : listeners) {
- dispatchingListener.onResourceMethod(id, method);
- }
- }
- }
-
-
- private final static EmptyListener EMPTY_LISTENER = new EmptyListener();
-
- public static RequestListener createRequestListener(ProviderServices providerServices) {
-
- final Set<RequestListener> listeners = providerServices.getProvidersAndServices(RequestListener.class);
- RequestListener requestListener = listeners.isEmpty() ? EMPTY_LISTENER : new AggregatedRequestListener(listeners);
-
- for(RequestListenerAdapter a : providerServices.getProvidersAndServices(RequestListenerAdapter.class)) {
- requestListener = a.adapt(requestListener);
- }
-
- return requestListener;
- }
-
- public static DispatchingListener createDispatchingListener(ProviderServices providerServices) {
-
- final Set<DispatchingListener> listeners = providerServices.getProvidersAndServices(DispatchingListener.class);
- DispatchingListener dispatchingListener = listeners.isEmpty() ? EMPTY_LISTENER : new AggregatedDispatchingListener(listeners);
-
- for(DispatchingListenerAdapter a : providerServices.getProvidersAndServices(DispatchingListenerAdapter.class)) {
- dispatchingListener = a.adapt(dispatchingListener);
- }
-
- return dispatchingListener;
- }
-
- public static ResponseListener createResponseListener(ProviderServices providerServices) {
-
- final Set<ResponseListener> listeners = providerServices.getProvidersAndServices(ResponseListener.class);
- ResponseListener responseListener = listeners.isEmpty() ? EMPTY_LISTENER : new AggregatedResponseListener(listeners);
-
- for(ResponseListenerAdapter a : providerServices.getProvidersAndServices(ResponseListenerAdapter.class)) {
- responseListener = a.adapt(responseListener);
- }
-
- return responseListener;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/package-info.java
deleted file mode 100644
index 97b9814a0ee..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/monitoring/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support GlassFish monitoring.
- */
-package com.sun.jersey.server.impl.monitoring; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.java
deleted file mode 100644
index 66505a1d50a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.provider;
-
-import com.sun.jersey.api.container.ContainerFactory;
-import com.sun.jersey.api.core.ApplicationAdapter;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.core.spi.factory.AbstractRuntimeDelegate;
-import javax.ws.rs.core.Application;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class RuntimeDelegateImpl extends AbstractRuntimeDelegate {
-
- @Override
- public <T> T createEndpoint(Application application,
- Class<T> endpointType)
- throws IllegalArgumentException, UnsupportedOperationException {
- if (application instanceof ResourceConfig) {
- return ContainerFactory.createContainer(endpointType,
- (ResourceConfig)application);
- } else {
- return ContainerFactory.createContainer(endpointType,
- new ApplicationAdapter(application));
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/PerRequestFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/PerRequestFactory.java
deleted file mode 100644
index 1c15bf551b1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/PerRequestFactory.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.resource;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCInstantiatedComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCProxiedComponentProvider;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.server.spi.component.ResourceComponentConstructor;
-import com.sun.jersey.server.spi.component.ResourceComponentInjector;
-import com.sun.jersey.server.spi.component.ResourceComponentProvider;
-import com.sun.jersey.server.spi.component.ResourceComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCDestroyable;
-import com.sun.jersey.server.spi.component.ResourceComponentDestructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Context;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class PerRequestFactory implements ResourceComponentProviderFactory {
- private static final Logger LOGGER = Logger.getLogger(PerRequestFactory.class.getName());
-
- private final ServerInjectableProviderContext sipc;
-
- private final HttpContext threadLocalHc;
-
- public static void destroy(HttpContext hc) {
- Map<AbstractPerRequest, Object> m = (Map<AbstractPerRequest, Object>)hc.getProperties().
- get(SCOPE_PER_REQUEST);
- if (m != null) {
- for (Map.Entry<AbstractPerRequest, Object> e : m.entrySet()) {
- try {
- e.getKey().destroy(e.getValue());
- } catch (ContainerException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- }
- }
- }
- }
-
- public PerRequestFactory(
- @Context ServerInjectableProviderContext sipc,
- @Context HttpContext threadLocalHc) {
- this.sipc = sipc;
- this.threadLocalHc = threadLocalHc;
- }
-
- public ComponentScope getScope(Class c) {
- return ComponentScope.PerRequest;
- }
-
- public ResourceComponentProvider getComponentProvider(Class c) {
- return new PerRequest();
- }
-
- public ResourceComponentProvider getComponentProvider(IoCComponentProvider icp, Class c) {
- if (icp instanceof IoCInstantiatedComponentProvider) {
- return new PerRequestInstantiated((IoCInstantiatedComponentProvider)icp);
- } else if (icp instanceof IoCProxiedComponentProvider) {
- return new PerRequestProxied((IoCProxiedComponentProvider)icp);
- }
- throw new IllegalStateException();
- }
-
- private static final String SCOPE_PER_REQUEST = "com.sun.jersey.scope.PerRequest";
-
- private abstract class AbstractPerRequest implements ResourceComponentProvider {
-
- private ResourceComponentDestructor rcd;
-
- public final Object getInstance() {
- return getInstance(threadLocalHc);
- }
-
- public final ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- public void init(AbstractResource abstractResource) {
- rcd = new ResourceComponentDestructor(abstractResource);
- }
-
- public final Object getInstance(HttpContext hc) {
- Map<AbstractPerRequest, Object> m = (Map<AbstractPerRequest, Object>)hc.getProperties().
- get(SCOPE_PER_REQUEST);
- if (m == null) {
- m = new HashMap<AbstractPerRequest, Object>();
- hc.getProperties().put(SCOPE_PER_REQUEST, m);
- } else {
- Object o = m.get(this);
- if (o != null) return o;
- }
-
- Object o = _getInstance(hc);
- m.put(this, o);
- return o;
- }
-
- public final void destroy() {
- }
-
- protected abstract Object _getInstance(HttpContext hc);
-
- public void destroy(Object o) {
- try {
- rcd.destroy(o);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to destroy resource", ex);
- } catch (InvocationTargetException ex) {
- throw new ContainerException("Unable to destroy resource", ex);
- } catch (RuntimeException ex) {
- throw new ContainerException("Unable to destroy resource", ex);
- }
- }
- }
-
- private final class PerRequest extends AbstractPerRequest {
- private ResourceComponentConstructor rcc;
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- this.rcc = new ResourceComponentConstructor(
- sipc,
- ComponentScope.PerRequest,
- abstractResource);
- }
-
- protected Object _getInstance(HttpContext hc) {
- try {
- return rcc.construct(hc);
- } catch (InstantiationException ex) {
- throw new ContainerException("Unable to create resource " + rcc.getResourceClass(), ex);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to create resource " + rcc.getResourceClass(), ex);
- } catch (InvocationTargetException ex) {
- // Propagate the target exception so it may be mapped to a response
- throw new MappableContainerException(ex.getTargetException());
- } catch (WebApplicationException ex) {
- throw ex;
- } catch (RuntimeException ex) {
- throw new ContainerException("Unable to create resource " + rcc.getResourceClass(), ex);
- }
- }
- }
-
- private final class PerRequestInstantiated extends AbstractPerRequest {
- private final IoCInstantiatedComponentProvider iicp;
-
- private final IoCDestroyable destroyable;
-
- private ResourceComponentInjector rci;
-
- PerRequestInstantiated(IoCInstantiatedComponentProvider iicp) {
- this.iicp = iicp;
- this.destroyable = (iicp instanceof IoCDestroyable)
- ? (IoCDestroyable) iicp : null;
- }
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
- if (destroyable == null) {
- this.rci = new ResourceComponentInjector(
- sipc,
- ComponentScope.PerRequest,
- abstractResource);
- }
- }
-
- public Object _getInstance(HttpContext hc) {
- Object o = iicp.getInstance();
- if (destroyable == null) {
- rci.inject(hc, iicp.getInjectableInstance(o));
- }
- return o;
- }
-
- @Override
- public void destroy(Object o) {
- if (destroyable != null) {
- destroyable.destroy(o);
- } else {
- super.destroy(o);
- }
- }
- }
-
- private final class PerRequestProxied extends AbstractPerRequest {
- private final IoCProxiedComponentProvider ipcp;
-
- private ResourceComponentConstructor rcc;
-
- PerRequestProxied(IoCProxiedComponentProvider ipcp) {
- this.ipcp = ipcp;
- }
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- this.rcc = new ResourceComponentConstructor(
- sipc,
- ComponentScope.PerRequest,
- abstractResource);
- }
-
- public Object _getInstance(HttpContext hc) {
- try {
- return ipcp.proxy(rcc.construct(hc));
- } catch (InstantiationException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (InvocationTargetException ex) {
- // Propagate the target exception so it may be mapped to a response
- throw new MappableContainerException(ex.getTargetException());
- } catch (WebApplicationException ex) {
- throw ex;
- } catch (RuntimeException ex) {
- throw new ContainerException("Unable to create resource", ex);
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/SingletonFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/SingletonFactory.java
deleted file mode 100644
index 66f8135b221..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/resource/SingletonFactory.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.resource;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCDestroyable;
-import com.sun.jersey.core.spi.component.ioc.IoCInstantiatedComponentProvider;
-import com.sun.jersey.core.spi.component.ioc.IoCProxiedComponentProvider;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.server.spi.component.ResourceComponentConstructor;
-import com.sun.jersey.server.spi.component.ResourceComponentDestructor;
-import com.sun.jersey.server.spi.component.ResourceComponentInjector;
-import com.sun.jersey.server.spi.component.ResourceComponentProvider;
-import com.sun.jersey.server.spi.component.ResourceComponentProviderFactory;
-import java.lang.reflect.InvocationTargetException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.core.Context;
-
-/**
- * A simple provider that maintains a singleton resource class instance
- */
-public final class SingletonFactory implements ResourceComponentProviderFactory {
- private static final Logger LOGGER = Logger.getLogger(SingletonFactory.class.getName());
-
- private final ServerInjectableProviderContext sipc;
-
- public SingletonFactory(
- @Context ServerInjectableProviderContext sipc) {
- this.sipc = sipc;
- }
-
- public ComponentScope getScope(Class c) {
- return ComponentScope.Singleton;
- }
-
- public ResourceComponentProvider getComponentProvider(Class c) {
- return new Singleton();
- }
-
- public ResourceComponentProvider getComponentProvider(IoCComponentProvider icp, Class c) {
- if (icp instanceof IoCInstantiatedComponentProvider) {
- return new SingletonInstantiated((IoCInstantiatedComponentProvider)icp);
- } else if (icp instanceof IoCProxiedComponentProvider) {
- return new SingletonProxied((IoCProxiedComponentProvider)icp);
- }
- throw new IllegalStateException();
- }
-
- private abstract class AbstractSingleton implements ResourceComponentProvider {
- private ResourceComponentDestructor rcd;
-
- protected Object resource;
-
- public void init(AbstractResource abstractResource) {
- rcd = new ResourceComponentDestructor(abstractResource);
- }
-
- public final Object getInstance(HttpContext hc) {
- return resource;
- }
-
- public final Object getInstance() {
- return resource;
- }
-
- public final ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public void destroy() {
- try {
- rcd.destroy(resource);
- } catch (IllegalAccessException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- } catch (IllegalArgumentException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- } catch (InvocationTargetException ex) {
- LOGGER.log(Level.SEVERE, "Unable to destroy resource", ex);
- }
- }
- }
-
- private class Singleton extends AbstractSingleton {
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- ResourceComponentConstructor rcc = new ResourceComponentConstructor(
- sipc,
- ComponentScope.Singleton,
- abstractResource);
-
- try {
- this.resource = rcc.construct(null);
- } catch (InvocationTargetException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (InstantiationException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to create resource", ex);
- }
- }
- }
-
- private class SingletonInstantiated extends AbstractSingleton {
- private final IoCInstantiatedComponentProvider iicp;
-
- private final IoCDestroyable destroyable;
-
- SingletonInstantiated(IoCInstantiatedComponentProvider iicp) {
- this.iicp = iicp;
- this.destroyable = (iicp instanceof IoCDestroyable)
- ? (IoCDestroyable) iicp : null;
- }
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- resource = iicp.getInstance();
-
- if (destroyable == null) {
- ResourceComponentInjector rci = new ResourceComponentInjector(
- sipc,
- ComponentScope.Singleton,
- abstractResource);
-
- rci.inject(null, iicp.getInjectableInstance(resource));
- }
- }
-
- @Override
- public void destroy() {
- if (destroyable != null) {
- destroyable.destroy(resource);
- } else {
- super.destroy();
- }
- }
- }
-
- private class SingletonProxied extends AbstractSingleton {
- private final IoCProxiedComponentProvider ipcp;
-
- SingletonProxied(IoCProxiedComponentProvider ipcp) {
- this.ipcp = ipcp;
- }
-
- @Override
- public void init(AbstractResource abstractResource) {
- super.init(abstractResource);
-
- ResourceComponentConstructor rcc = new ResourceComponentConstructor(
- sipc,
- ComponentScope.Singleton,
- abstractResource);
-
- try {
- Object o = rcc.construct(null);
- resource = ipcp.proxy(o);
- } catch (InvocationTargetException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (InstantiationException ex) {
- throw new ContainerException("Unable to create resource", ex);
- } catch (IllegalAccessException ex) {
- throw new ContainerException("Unable to create resource", ex);
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateFactory.java
deleted file mode 100644
index 69b6fca8dee..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateFactory.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.template;
-
-import com.sun.jersey.spi.template.ResolvedViewable;
-import com.sun.jersey.api.view.Viewable;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.spi.template.TemplateProcessor;
-import com.sun.jersey.spi.template.TemplateContext;
-import com.sun.jersey.spi.template.TemplateContextException;
-import com.sun.jersey.spi.template.ViewProcessor;
-import java.util.List;
-import java.util.Set;
-import javax.ws.rs.core.UriInfo;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class TemplateFactory implements TemplateContext {
-
- private final Set<ViewProcessor> viewProcessors;
-
- public TemplateFactory(ProviderServices providerServices) {
- viewProcessors = providerServices.getProvidersAndServices(
- ViewProcessor.class);
-
- Set<TemplateProcessor> templateProcessors = providerServices.getProvidersAndServices(
- TemplateProcessor.class);
-
- for (TemplateProcessor tp : templateProcessors) {
- viewProcessors.add(new TemplateViewProcessor(tp));
- }
- }
-
- /**
- * Get the set of template processors.
- *
- * @return the set of template processors.
- */
- private Set<ViewProcessor> getViewProcessors() {
- return viewProcessors;
- }
-
- // TemplateContext
-
- public ResolvedViewable resolveViewable(Viewable v) {
- if (v.isTemplateNameAbsolute()) {
- return resolveAbsoluteViewable(v);
- } else if (v.getResolvingClass() != null) {
- return resolveRelativeViewable(v, v.getResolvingClass());
- } else {
- if (v.getModel() == null)
- throw new TemplateContextException("The model of the view MUST not be null");
-
- return resolveRelativeViewable(v, v.getModel().getClass());
- }
- }
-
- public ResolvedViewable resolveViewable(Viewable v, UriInfo ui) {
- if (v.isTemplateNameAbsolute()) {
- return resolveAbsoluteViewable(v);
- } else if (v.getResolvingClass() != null) {
- return resolveRelativeViewable(v, v.getResolvingClass());
- } else {
- final List<Object> mrs = ui.getMatchedResources();
- if (mrs == null || mrs.size() == 0)
- throw new TemplateContextException("There is no last matching resource available");
-
- return resolveRelativeViewable(v, mrs.get(0).getClass());
- }
- }
-
- public ResolvedViewable resolveViewable(Viewable v, Class<?> resolvingClass) {
- if (v.isTemplateNameAbsolute()) {
- return resolveAbsoluteViewable(v);
- } else if (v.getResolvingClass() != null) {
- return resolveRelativeViewable(v, v.getResolvingClass());
- } else {
- if (resolvingClass == null)
- throw new TemplateContextException("Resolving class MUST not be null");
-
- return resolveRelativeViewable(v, resolvingClass);
- }
- }
-
-
- private ResolvedViewable resolveAbsoluteViewable(Viewable v) {
- for (ViewProcessor vp : getViewProcessors()) {
- Object resolvedTemplateObject = vp.resolve(v.getTemplateName());
- if (resolvedTemplateObject != null) {
- return new ResolvedViewable(vp, resolvedTemplateObject, v);
- }
- }
-
- return null;
- }
-
- private ResolvedViewable resolveRelativeViewable(Viewable v, Class<?> resolvingClass) {
- String path = v.getTemplateName();
- if (path == null || path.length() == 0)
- path = "index";
-
- // Find in directories
- for (Class c = resolvingClass; c != Object.class; c = c.getSuperclass()) {
- String absolutePath = getAbsolutePath(c, path, '/');
-
- for (ViewProcessor vp : getViewProcessors()) {
- Object resolvedTemplateObject = vp.resolve(absolutePath);
- if (resolvedTemplateObject != null) {
- return new ResolvedViewable(vp, resolvedTemplateObject, v, c);
- }
- }
- }
-
- // Find in flat files
- for (Class c = resolvingClass; c != Object.class; c = c.getSuperclass()) {
- String absolutePath = getAbsolutePath(c, path, '.');
-
- for (ViewProcessor vp : getViewProcessors()) {
- Object resolvedTemplateObject = vp.resolve(absolutePath);
- if (resolvedTemplateObject != null) {
- return new ResolvedViewable(vp, resolvedTemplateObject, v, c);
- }
- }
- }
-
- return null;
- }
-
- private String getAbsolutePath(Class<?> resourceClass, String path, char delim) {
- return '/' + resourceClass.getName().replace('.', '/').replace('$', delim) + delim + path;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateViewProcessor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateViewProcessor.java
deleted file mode 100644
index a1a080598bd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/TemplateViewProcessor.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.template;
-
-import com.sun.jersey.api.view.Viewable;
-import com.sun.jersey.spi.template.TemplateProcessor;
-import com.sun.jersey.spi.template.ViewProcessor;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class TemplateViewProcessor implements ViewProcessor<String>{
-
- private final TemplateProcessor tp;
-
- public TemplateViewProcessor(TemplateProcessor tp) {
- this.tp = tp;
- }
-
- public String resolve(String name) {
- return tp.resolve(name);
- }
-
- public void writeTo(String t, Viewable viewable, OutputStream out) throws IOException {
- tp.writeTo(t, viewable.getModel(), out);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewResourceMethod.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewResourceMethod.java
deleted file mode 100644
index 422baf34210..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewResourceMethod.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.template;
-
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.server.impl.model.method.ResourceMethod;
-import java.util.List;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ViewResourceMethod extends ResourceMethod {
-
- public ViewResourceMethod(List<QualitySourceMediaType> produces) {
- super(
- "GET",
- UriTemplate.EMPTY,
- MediaTypes.GENERAL_MEDIA_TYPE_LIST,
- produces,
- false,
- null);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.java
deleted file mode 100644
index d2b21e3c91f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.template;
-
-import com.sun.jersey.spi.template.ResolvedViewable;
-import com.sun.jersey.spi.template.TemplateContext;
-import com.sun.jersey.api.view.Viewable;
-import com.sun.jersey.spi.inject.ServerSide;
-import com.sun.jersey.spi.inject.ConstrainedTo;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.ext.MessageBodyWriter;
-import java.io.IOException;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriInfo;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@ConstrainedTo(ServerSide.class)
-public final class ViewableMessageBodyWriter implements MessageBodyWriter<Viewable> {
-
- @Context UriInfo ui;
-
- @Context TemplateContext tc;
-
- public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return Viewable.class.isAssignableFrom(type);
- }
-
- public void writeTo(Viewable v,
- Class<?> type, Type genericType, Annotation[] annotations,
- MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException {
- final ResolvedViewable rv = resolve(v);
- if (rv == null)
- throw new IOException("The template name, " +
- v.getTemplateName() +
- ", could not be resolved to a fully qualified template name");
-
- rv.writeTo(entityStream);
- }
-
- private ResolvedViewable resolve(Viewable v) {
- if (v instanceof ResolvedViewable) {
- return (ResolvedViewable)v;
- } else {
- return tc.resolveViewable(v, ui);
- }
- }
-
- public long getSize(Viewable t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
- return -1;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableRule.java
deleted file mode 100644
index fc998eae820..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/template/ViewableRule.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.template;
-
-import com.sun.jersey.spi.template.ResolvedViewable;
-import com.sun.jersey.spi.template.TemplateContext;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.api.view.Viewable;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.server.impl.application.WebApplicationContext;
-import com.sun.jersey.server.impl.uri.rules.HttpMethodRule;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-import java.util.List;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-
-/**
- * A viewable rule that defers the request to a template. If a template
- * is not available then the rule is not accepted.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ViewableRule implements UriRule {
- private final List<QualitySourceMediaType> priorityMediaTypes;
-
- private final List<ContainerRequestFilter> requestFilters;
-
- private final List<ContainerResponseFilter> responseFilters;
-
- @Context TemplateContext tc;
-
- public ViewableRule(
- List<QualitySourceMediaType> priorityMediaTypes,
- List<ContainerRequestFilter> requestFilters,
- List<ContainerResponseFilter> responseFilters) {
- this.priorityMediaTypes = priorityMediaTypes;
- this.requestFilters = requestFilters;
- this.responseFilters = responseFilters;
- }
-
- public final boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- UriRuleProbeProvider.ruleAccept(ViewableRule.class.getSimpleName(), path,
- resource);
-
- final HttpRequestContext request = context.getRequest();
- // Only accept GET requests and internal matching requests
- if (request.getMethod().equals("GET") ||
- request.getMethod().equals(WebApplicationContext.HTTP_METHOD_MATCH_RESOURCE)) {
- // Obtain the template path
- final String templatePath = (path.length() > 0) ?
- context.getMatchResult().group(1) :
- "";
-
- // Resolve the viewable
- Viewable v = new Viewable(templatePath, resource);
- ResolvedViewable rv = tc.resolveViewable(v);
- if (rv == null) {
- return false;
- }
-
- // If an internal match resource request then always return true
- if (request.getMethod().equals(WebApplicationContext.HTTP_METHOD_MATCH_RESOURCE)) {
- return true;
- }
-
- if (context.isTracingEnabled()) {
- context.trace(String.format("accept implicit view: \"%s\" -> %s, %s",
- templatePath,
- ReflectionHelper.objectToString(resource),
- rv.getTemplateName()));
- }
-
- // Push the response filters
- context.pushContainerResponseFilters(responseFilters);
-
- // Process the request filter
- if (!requestFilters.isEmpty()) {
- ContainerRequest containerRequest = context.getContainerRequest();
- for (ContainerRequestFilter f : requestFilters) {
- containerRequest = f.filter(containerRequest);
- context.setContainerRequest(containerRequest);
- }
- }
-
- final HttpResponseContext response = context.getResponse();
-
- response.setStatus(200);
-
- response.setEntity(rv);
-
- if (!response.getHttpHeaders().containsKey("Content-Type")) {
- MediaType contentType = getContentType(request, response);
- response.getHttpHeaders().putSingle("Content-Type", contentType);
- }
-
- return true;
- } else {
- return false;
- }
- }
-
- private MediaType getContentType(HttpRequestContext request, HttpResponseContext response) {
- List<MediaType> accept = (priorityMediaTypes == null)
- ? request.getAcceptableMediaTypes()
- : HttpMethodRule.getSpecificAcceptableMediaTypes(request.getAcceptableMediaTypes(),
- priorityMediaTypes);
- if (!accept.isEmpty()) {
- MediaType contentType = accept.get(0);
-
- if (!contentType.isWildcardType() && !contentType.isWildcardSubtype()) {
- return contentType;
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathPattern.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathPattern.java
deleted file mode 100644
index dde9904732b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathPattern.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri;
-
-import com.sun.jersey.api.uri.UriPattern;
-import com.sun.jersey.api.uri.UriTemplate;
-import java.util.Comparator;
-
-/**
- * A URI pattern that is a regular expression generated from a URI path.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class PathPattern extends UriPattern {
-
- /**
- * Empty path.
- * @see #PathPattern()
- */
- public static final PathPattern EMPTY_PATH = new PathPattern();
-
- /**
- * The regular expression that represents the right hand side of
- * a URI path.
- */
- private static final String RIGHT_HAND_SIDE = "(/.*)?";
-
- /**
- * Defer to comparing the templates associated with the patterns.
- */
- static public final Comparator<PathPattern> COMPARATOR = new Comparator<PathPattern>() {
- public int compare(final PathPattern o1, final PathPattern o2) {
- return UriTemplate.COMPARATOR.compare(o1.template, o2.template);
- }
- };
-
- /**
- * Empty UriTemplate, initialized just once in one of
- * constructors.
- * @see #PathPattern()
- * @see #PathPattern(UriTemplate)
- * @see #PathPattern(UriTemplate, String)
- */
- private final UriTemplate template;
-
- /**
- * Private constructor, used only to instantiate EMPTY_PATH.
- */
- private PathPattern() {
- super();
- this.template = UriTemplate.EMPTY;
- }
-
- /**
- * Public constructor.
- * @param template The template
- */
- public PathPattern(final UriTemplate template) {
- super(
- PathPattern.postfixWithCapturingGroup(template.getPattern().getRegex()),
- PathPattern.indexCapturingGroup(template.getPattern().getGroupIndexes())
- );
- this.template = template;
- }
-
- /**
- * Public ctor.
- * @param template The template
- * @param rightHandSide Right hand side of the template
- */
- public PathPattern(final UriTemplate template, final String rightHandSide) {
- super(
- PathPattern.postfixWithCapturingGroup(
- template.getPattern().getRegex(),
- rightHandSide
- ),
- PathPattern.indexCapturingGroup(template.getPattern().getGroupIndexes())
- );
- this.template = template;
- }
-
- /**
- * Get template.
- * @return The template
- */
- public UriTemplate getTemplate() {
- return this.template;
- }
-
- /**
- * Append tail-matching regex suffix to the regex provided.
- * @param regex Regular expression
- * @return The regex with the default suffix
- * @see #PathPattern(UriTemplate)
- */
- private static String postfixWithCapturingGroup(final String regex) {
- return PathPattern.postfixWithCapturingGroup(
- regex,
- PathPattern.RIGHT_HAND_SIDE
- );
- }
-
- /**
- * Append tail-matching regex suffix to the regex provided.
- * @param regex Regular expression
- * @param rightHandSide The suffix to append
- * @return The regex with the provided suffix
- * @see #PathPattern(UriTemplate, String)
- */
- private static String postfixWithCapturingGroup(final String regex, final String rightHandSide) {
- return (regex.endsWith("/") ? regex.substring(0, regex.length() - 1) : regex)
- + rightHandSide;
- }
-
- /**
- * Extend the list of group indexes by adding one more element
- * the end of array, which is equal to last element plus 1.
- * @param indexes Array of indexes
- * @return New array
- * @see #PathPattern(UriTemplate)
- * @see #PathPattern(UriTemplate, String)
- */
- private static int[] indexCapturingGroup(final int[] indexes) {
- if (indexes.length == 0) {
- return indexes;
- }
- final int[] cgIndexes = new int[indexes.length + 1];
- System.arraycopy(indexes, 0, cgIndexes, 0, indexes.length);
- cgIndexes[indexes.length] = cgIndexes[indexes.length - 1] + 1;
- return cgIndexes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathTemplate.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathTemplate.java
deleted file mode 100644
index 12813e4f815..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/PathTemplate.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri;
-
-import com.sun.jersey.api.uri.UriComponent;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.api.uri.UriTemplateParser;
-
-/**
- * A URI template for a URI path.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author Yegor Bugayenko (yegor256@java.net)
- */
-public final class PathTemplate extends UriTemplate {
-
- /**
- * Internal parser of this PathTemplate.
- * @see #PathTemplate(String)
- */
- private static final class PathTemplateParser extends UriTemplateParser {
- /**
- * Public constructor.
- *
- * @param path the URI path template
- */
- public PathTemplateParser(final String path) {
- super(path);
- }
- /**
- * {@inheritDoc}
- */
- @Override
- protected String encodeLiteralCharacters(final String literalCharacters) {
- return UriComponent.contextualEncode(
- literalCharacters,
- UriComponent.Type.PATH
- );
- }
- }
-
- /**
- * Create a URI path template and encode (percent escape)
- * any characters of the template that are not valid
- * URI characters.
- * @param path the URI path template
- */
- public PathTemplate(final String path) {
- super(new PathTemplateParser(PathTemplate.prefixWithSlash(path)));
- }
-
- /**
- * Converts the path provided to a slash-leading
- * form, no matter what is provided.
- * @param path the URI path template
- * @return prefixed path
- * @see #PathTemplate(String)
- */
- private static String prefixWithSlash(final String path) {
- return path.startsWith("/") ? path : "/" + path;
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/UriHelper.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/UriHelper.java
deleted file mode 100644
index 3b23696544a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/UriHelper.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri;
-
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * URI helper.
- *
- * @author Jakub Podlesak (japod at sun dot com)
- * @author Yegor Bugayenko (yegor256@java.net)
- */
-public final class UriHelper {
-
- /**
- * Normalize the URI provided and return the normalized
- * copy.
- * @param uri The URI to normalize
- * @param preserveContdSlashes Shall we preserve "///" slashes
- * @return New normalized URI
- */
- public static URI normalize(URI uri, boolean preserveContdSlashes) {
- if (!uri.getRawPath().contains("//")) {
- return uri.normalize();
- }
- String np = UriHelper.removeDotSegments(
- uri.getRawPath(),
- preserveContdSlashes
- );
- if (np.equals(uri.getRawPath())) {
- return uri;
- }
- return UriBuilder.fromUri(uri).replacePath(np).build();
- }
-
- /**
- * Removal of leading slashes from the path.
- * @param path The path
- * @param preserveSlashes Shall we do anything?
- * @return Path without any leading slashes
- * @todo A better algorithm is required. Maybe we can use Apache StringUtils?
- * @see #normalize(URI, boolean)
- */
- private static String removeLeadingSlashesIfNeeded(
- final String path, final boolean preserveSlashes) {
- if (preserveSlashes) {
- return path;
- }
- String trimmed = path;
- while (trimmed.startsWith("/")) {
- trimmed = trimmed.substring(1);
- }
- return trimmed;
- }
-
- /**
- * Remove dots from path.
- *
- * alg taken from http://gbiv.com/protocols/uri/rfc/rfc3986.html#relative-dot-segments
- * the alg works as follows:
- * 1. The input buffer is initialized with the now-appended path components and the output buffer is initialized to the empty string.
- * 2. While the input buffer is not empty, loop as follows:
- * A. If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise,
- * B. if the input buffer begins with a prefix of "/./"
- * or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise,
- * C. if the input buffer begins with a prefix of "/../"
- * or "/..", where ".." is a complete path segment,
- * then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise,
- * D. if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise,
- * E. move the first path segment in the input buffer to the end of the output buffer,
- * including the initial "/" character (if any) and any subsequent characters up to, but not including,
- * the next "/" character or the end of the input buffer.
- * 3. Finally, the output buffer is returned as the result of remove_dot_segments.
- *
- * @param path Path provided
- * @param preserveContdSlashes Shall we preserve "///" slashes
- * @return New path
- */
- public static String removeDotSegments(String path, boolean preserveContdSlashes) {
- if (null == path) {
- return null;
- }
-
- final List<String> outputSegments = new LinkedList<String>();
- while (path.length() > 0) {
- if (path.startsWith("../")) { // rule 2A
- path = removeLeadingSlashesIfNeeded(path.substring(3), preserveContdSlashes);
- } else if (path.startsWith("./")) { // rule 2A
- path = removeLeadingSlashesIfNeeded(path.substring(2), preserveContdSlashes);
- } else if (path.startsWith("/./")) { // rule 2B
- path = "/" + removeLeadingSlashesIfNeeded(path.substring(3), preserveContdSlashes);
- } else if ("/.".equals(path)) { // rule 2B
- path = "/";
- } else if (path.startsWith("/../")) { // rule 2C
- path = "/" + removeLeadingSlashesIfNeeded(path.substring(4), preserveContdSlashes);
- if(!outputSegments.isEmpty()) { // removing last segment if any
- outputSegments.remove(outputSegments.size() - 1);
- }
- } else if ("/..".equals(path)) { // rule 2C
- path = "/";
- if(!outputSegments.isEmpty()) { // removing last segment if any
- outputSegments.remove(outputSegments.size() - 1);
- }
- } else if ("..".equals(path) || ".".equals(path)) { // rule 2D
- path = "";
- } else { // rule E
- int slashStartSearchIndex;
- if (path.startsWith("/")) {
- path = "/" + removeLeadingSlashesIfNeeded(path.substring(1), preserveContdSlashes);
- slashStartSearchIndex = 1;
- } else {
- slashStartSearchIndex = 0;
- }
- int segLength = path.indexOf('/', slashStartSearchIndex);
- if (-1 == segLength) {
- segLength = path.length();
- }
- outputSegments.add(path.substring(0, segLength));
- path = path.substring(segLength);
- }
- }
-
- final StringBuffer result = new StringBuffer();
- for (String segment : outputSegments) {
- result.append(segment);
- }
- return result.toString();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.java
deleted file mode 100644
index 95629e20eb6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.uri.UriPattern;
-import com.sun.jersey.spi.uri.rules.UriMatchResultContext;
-import com.sun.jersey.spi.uri.rules.UriRules;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.regex.MatchResult;
-
-/**
- * Rules associated with instances of {@link UriPattern) and matched
- * to return at most one match.
- * <p>
- * The class will iterate through the collection of {@link UriPattern) until
- * a match is found. Note that this does not scale.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class AtomicMatchingPatterns<R> implements UriRules<R> {
- private final Collection<PatternRulePair<R>> rules;
-
- public AtomicMatchingPatterns(Collection<PatternRulePair<R>> rules) {
- this.rules = rules;
- }
-
- public Iterator<R> match(CharSequence path, UriMatchResultContext resultContext) {
- if (resultContext.isTracingEnabled()) {
- StringBuilder sb = new StringBuilder();
- sb.append("match path \"").append(path).append("\" -> ");
- boolean first = true;
- for (PatternRulePair<R> prp : rules) {
- if (!first)
- sb.append(", ");
- sb.append("\"").append(prp.p.toString()).append("\"");
- first = false;
- }
- resultContext.trace(sb.toString());
- }
-
- for (PatternRulePair<R> prp : rules) {
- // Match each template
- final MatchResult mr = prp.p.match(path);
- if (mr != null) {
- resultContext.setMatchResult(mr);
- return new SingleEntryIterator<R>(prp.r);
- }
- }
-
- return new EmptyIterator<R>();
- }
-
- private static final class SingleEntryIterator<T> implements Iterator<T> {
- private T t;
-
- SingleEntryIterator(T t) {
- this.t = t;
- }
-
- public boolean hasNext() {
- return t != null;
- }
-
- public T next() {
- if (hasNext()) {
- final T _t = t;
- t = null;
- return _t;
- } else {
- throw new NoSuchElementException();
- }
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-
- private static final class EmptyIterator<T> implements Iterator<T> {
- public boolean hasNext() {
- return false;
- }
-
- public T next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/BaseRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/BaseRule.java
deleted file mode 100644
index baed271cee4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/BaseRule.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-
-/**
- * Abstract class for a rule that manages capturing group names.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class BaseRule implements UriRule {
-
- /**
- * The template to work with.
- */
- private final UriTemplate template;
-
- /**
- * Public constructor.
- * @param template The template of the URI
- */
- public BaseRule(final UriTemplate template) {
- assert template != null;
- this.template = template;
- }
-
- /**
- * Push match to the provided context.
- * @param context The URI rule context
- */
- protected final void pushMatch(final UriRuleContext context) {
- context.pushMatch(
- template,
- template.getTemplateVariables()
- );
- }
-
- /**
- * Get URI template initialized in ctor.
- * @return The template stored in the object
- */
- protected final UriTemplate getTemplate() {
- return template;
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.java
deleted file mode 100644
index 936fbc7f1c1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.spi.uri.rules.UriMatchResultContext;
-import com.sun.jersey.spi.uri.rules.UriRules;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-/**
- * Rules combining one or more other rules and matching in sequence.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class CombiningMatchingPatterns<R> implements UriRules<R> {
-
- private final List<UriRules<R>> rs;
-
- public CombiningMatchingPatterns(List<UriRules<R>> rs) {
- this.rs = rs;
- }
-
- public Iterator<R> match(CharSequence path, UriMatchResultContext resultContext) {
- return new XInterator(path, resultContext);
- }
-
- private final class XInterator implements Iterator<R> {
-
- private final CharSequence path;
- private final UriMatchResultContext resultContext;
- private Iterator<R> ruleIterator;
- private Iterator<UriRules<R>> rulesIterator;
- private R r;
-
- XInterator(CharSequence path, UriMatchResultContext resultContext) {
- this.path = path;
- this.resultContext = resultContext;
- this.rulesIterator = rs.iterator();
- this.ruleIterator = rulesIterator.next().match(path, resultContext);
- }
-
- public boolean hasNext() {
- if (r != null) return true;
-
- if (ruleIterator.hasNext()) {
- r = ruleIterator.next();
- return true;
- }
-
- while (rulesIterator.hasNext()) {
- ruleIterator = rulesIterator.next().match(path, resultContext);
- if (ruleIterator.hasNext()) {
- r = ruleIterator.next();
- return true;
- }
- }
-
- return false;
- }
-
- public R next() {
- if (!hasNext()) throw new NoSuchElementException();
-
- final R _r = r;
- r = null;
- return _r;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.java
deleted file mode 100644
index e5f176e427f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.java
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.Responses;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.server.impl.application.WebApplicationContext;
-import com.sun.jersey.server.impl.model.method.ResourceMethod;
-import com.sun.jersey.server.impl.template.ViewResourceMethod;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.monitoring.DispatchingListener;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The rule for accepting an HTTP method.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class HttpMethodRule implements UriRule {
- public static final String CONTENT_TYPE_PROPERTY =
- "com.sun.jersey.server.impl.uri.rules.HttpMethodRule.Content-Type";
-
- private final Map<String, ResourceMethodListPair> map;
-
- private final String allow;
-
- private final boolean isSubResource;
-
- private final DispatchingListener dispatchingListener;
-
- public HttpMethodRule(
- Map<String, List<ResourceMethod>> methods, DispatchingListener dispatchingListener) {
- this(methods, false, dispatchingListener);
- }
-
- private static final class ResourceMethodListPair {
- final List<ResourceMethod> normal;
-
- final List<ResourceMethod> wildPriority;
-
- final List<QualitySourceMediaType> priorityMediaTypes;
-
- ResourceMethodListPair(List<ResourceMethod> normal) {
- this.normal = normal;
- if (correctOrder(normal)) {
- this.wildPriority = normal;
- } else {
- this.wildPriority = new ArrayList<ResourceMethod>(normal.size());
- int i = 0;
- for (ResourceMethod method : normal) {
- if (method.consumesWild()) {
- wildPriority.add(i++, method);
- } else {
- wildPriority.add(method);
- }
- }
- }
-
- List<QualitySourceMediaType> pmts = new LinkedList<QualitySourceMediaType>();
- for (ResourceMethod m : normal) {
- for (MediaType mt : m.getProduces()) {
- pmts.add(get(mt));
- }
- }
-
- Collections.sort(pmts, MediaTypes.QUALITY_SOURCE_MEDIA_TYPE_COMPARATOR);
- priorityMediaTypes = retain(pmts) ? pmts : null;
- }
-
- QualitySourceMediaType get(MediaType mt) {
- if (mt instanceof QualitySourceMediaType) {
- return (QualitySourceMediaType)mt;
- } else {
- return new QualitySourceMediaType(mt);
- }
- }
-
- boolean retain(List<QualitySourceMediaType> pmts) {
- for (QualitySourceMediaType mt : pmts) {
- if (mt.getQualitySource() != QualitySourceMediaType.DEFAULT_QUALITY_SOURCE_FACTOR) {
- return true;
- }
- }
- return false;
- }
-
- boolean correctOrder(List<ResourceMethod> normal) {
- boolean consumesNonWild = false;
- for (ResourceMethod method : normal) {
- if (method.consumesWild()) {
- if (consumesNonWild) return false;
- } else {
- consumesNonWild = true;
- }
- }
-
- return true;
- }
- }
-
- public HttpMethodRule(
- Map<String, List<ResourceMethod>> methods,
- boolean isSubResource,
- DispatchingListener dispatchingListener) {
- this.map = new HashMap<String, ResourceMethodListPair>();
- for (Map.Entry<String, List<ResourceMethod>> e : methods.entrySet()) {
- this.map.put(e.getKey(), new ResourceMethodListPair(e.getValue()));
- }
-
- this.isSubResource = isSubResource;
- this.allow = getAllow(methods);
- this.dispatchingListener = dispatchingListener;
- }
-
- private String getAllow(Map<String, List<ResourceMethod>> methods) {
- StringBuilder s = new StringBuilder();
- for (String method : methods.keySet()) {
- if (s.length() > 0) s.append(",");
-
- s.append(method);
- }
-
- return s.toString();
- }
-
- @Override
- public boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- UriRuleProbeProvider.ruleAccept(HttpMethodRule.class.getSimpleName(), path,
- resource);
-
- // If the path is not empty then do not accept
- if (path.length() > 0) return false;
-
- final HttpRequestContext request = context.getRequest();
-
- // If an internal match resource request then always return true
- if (request.getMethod().equals(WebApplicationContext.HTTP_METHOD_MATCH_RESOURCE)) {
- return true;
- }
-
- if (context.isTracingEnabled()) {
- final String currentPath = context.getUriInfo().getMatchedURIs().get(0);
- if (isSubResource) {
- final String prevPath = context.getUriInfo().getMatchedURIs().get(1);
- context.trace(String.format("accept sub-resource methods: \"%s\" : \"%s\", %s -> %s",
- prevPath,
- currentPath.substring(prevPath.length()),
- context.getRequest().getMethod(),
- ReflectionHelper.objectToString(resource)));
- } else {
- context.trace(String.format("accept resource methods: \"%s\", %s -> %s",
- currentPath,
- context.getRequest().getMethod(),
- ReflectionHelper.objectToString(resource)));
- }
- }
-
- final HttpResponseContext response = context.getResponse();
-
- // Get the list of resource methods for the HTTP method
- ResourceMethodListPair methods = map.get(request.getMethod());
- if (methods == null) {
- // No resource methods are found
- response.setResponse(Responses.methodNotAllowed().
- header("Allow", allow).build());
- // Allow any further matching rules to be processed
- return false;
- }
-
- // Get the list of matching methods
- List<MediaType> accept = getSpecificAcceptableMediaTypes(
- request.getAcceptableMediaTypes(),
- methods.priorityMediaTypes);
-
- final Matcher m = new Matcher();
- final MatchStatus s = m.match(methods, request.getMediaType(), accept);
-
- if (s == MatchStatus.MATCH) {
- // If there is a match choose the first method
- final ResourceMethod method = m.rmSelected;
-
- if (method instanceof ViewResourceMethod) {
- // Set the content type to the most acceptable
- if (!m.mSelected.isWildcardType() &&
- !m.mSelected.isWildcardSubtype()) {
- response.getHttpHeaders().putSingle(HttpHeaders.CONTENT_TYPE, m.mSelected);
- }
-
- // Allow the view to be processed by the further matching view rule
- return false;
-
- // TODO what about resource specific request and response filters?
- // Should the viewable rule be responsible for those declared on
- // the class
- }
-
- // If a sub-resource method then need to push the resource
- // (again) as as to keep in sync with the ancestor URIs
- if (isSubResource) {
- context.pushResource(resource);
- // Set the template values
- context.pushMatch(method.getTemplate(), method.getTemplate().getTemplateVariables());
- }
-
- if (context.isTracingEnabled()) {
- if (isSubResource) {
- context.trace(String.format("matched sub-resource method: @Path(\"%s\") %s",
- method.getTemplate(),
- method.getDispatcher()));
- } else {
- context.trace(String.format("matched resource method: %s",
- method.getDispatcher()));
- }
- }
-
- // Push the response filters
- context.pushContainerResponseFilters(method.getResponseFilters());
-
- // Process the request filter
- if (!method.getRequestFilters().isEmpty()) {
- ContainerRequest containerRequest = context.getContainerRequest();
- for (ContainerRequestFilter f : method.getRequestFilters()) {
- containerRequest = f.filter(containerRequest);
- context.setContainerRequest(containerRequest);
- }
- }
-
- context.pushMethod(method.getAbstractResourceMethod());
-
- // Dispatch to the resource method
- try {
- dispatchingListener.onResourceMethod(Thread.currentThread().getId(), method.getAbstractResourceMethod());
-
- method.getDispatcher().dispatch(resource, context);
- } catch (RuntimeException e) {
- if (m.rmSelected.isProducesDeclared() &&
- !m.mSelected.isWildcardType() &&
- !m.mSelected.isWildcardSubtype()) {
- context.getProperties().put(CONTENT_TYPE_PROPERTY, m.mSelected);
- }
-
- throw e;
- }
-
- // If the content type is not explicitly set then set it
- // to the selected media type, if a concrete media type
- // and @Produces is declared on the resource method or the resource
- // class
- Object contentType = response.getHttpHeaders().getFirst(HttpHeaders.CONTENT_TYPE);
- if (contentType == null &&
- m.rmSelected.isProducesDeclared() &&
- !m.mSelected.isWildcardType() &&
- !m.mSelected.isWildcardSubtype()) {
- response.getHttpHeaders().putSingle(HttpHeaders.CONTENT_TYPE, m.mSelected);
- }
-
- return true;
- } else if (s == MatchStatus.NO_MATCH_FOR_CONSUME) {
- response.setResponse(Responses.unsupportedMediaType().build());
- // Allow any further matching rules to be processed
- return false;
- } else if (s == MatchStatus.NO_MATCH_FOR_PRODUCE) {
- response.setResponse(Responses.notAcceptable().build());
- // Allow any further matching rules to be processed
- return false;
- }
-
- return true;
- }
-
- private enum MatchStatus {
- MATCH, NO_MATCH_FOR_CONSUME, NO_MATCH_FOR_PRODUCE
- }
-
- private static class Matcher extends LinkedList<ResourceMethod> {
- private MediaType mSelected = null;
-
- private ResourceMethod rmSelected = null;
-
- /**
- * Find the subset of methods that match the 'Content-Type' and 'Accept'.
- *
- * @param methods the list of resource methods
- * @param contentType the 'Content-Type'.
- * @param acceptableMediaTypes the 'Accept' as a list. This list
- * MUST be ordered with the highest quality acceptable Media type
- * occurring first (see {@link MediaTypes#MEDIA_TYPE_COMPARATOR}).
- * @return the match status.
- */
- private MatchStatus match(
- ResourceMethodListPair methods,
- MediaType contentType,
- List<MediaType> acceptableMediaTypes) {
-
- List<ResourceMethod> selected;
- if (contentType != null) {
- // Find all methods that consume the MIME type of 'Content-Type'
- for (ResourceMethod method : methods.normal)
- if (method.consumes(contentType))
- add(method);
-
- if (isEmpty())
- return MatchStatus.NO_MATCH_FOR_CONSUME;
-
- selected = this;
- } else {
- selected = methods.wildPriority;
- }
-
-
- for (MediaType amt : acceptableMediaTypes) {
- for (ResourceMethod rm : selected) {
- for (MediaType p : rm.getProduces()) {
- if (p.isCompatible(amt)) {
- mSelected = MediaTypes.mostSpecific(p, amt);
- rmSelected = rm;
- return MatchStatus.MATCH;
- }
- }
- }
- }
-
- return MatchStatus.NO_MATCH_FOR_PRODUCE;
- }
- }
-
- /**
- * Get a list of media types that are acceptable for the response.
- *
- * @param acceptableMediaType the list of acceptable media types.
- * @param priorityMediaTypes the list of media types that take priority.
- * @return a singleton list containing the most specific media
- * type for first media type in <code>priorityMediaTypes<code> that
- * is compatible with an acceptable media type, otherwise the
- * list of all acceptable media type is returned.
- *
- */
- public static List<MediaType> getSpecificAcceptableMediaTypes(
- final List<MediaType> acceptableMediaType,
- final List<? extends MediaType> priorityMediaTypes) {
- if (priorityMediaTypes != null) {
- for (MediaType pmt : priorityMediaTypes) {
- for (MediaType amt : acceptableMediaType) {
- if (amt.isCompatible(pmt)) {
- return Collections.singletonList(MediaTypes.mostSpecific(amt, pmt));
- }
- }
- }
- }
-
- return acceptableMediaType;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/PatternRulePair.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/PatternRulePair.java
deleted file mode 100644
index 39bbfac0cee..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/PatternRulePair.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.uri.UriPattern;
-
-/**
- * A tuple of a {@link UriPattern} and a generic rule.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class PatternRulePair<R> {
- public final UriPattern p;
-
- public final R r;
-
- public PatternRulePair(UriPattern p, R r) {
- this.p = p;
- this.r = r;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.java
deleted file mode 100644
index 4c93913df5b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import java.util.Iterator;
-
-/**
- * The rule for accepting a resource class.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.server.impl.application.RootResourceUriRules
- */
-public final class ResourceClassRule extends BaseRule {
-
- /**
- * The class to analyze.
- * @see ResourceClassRule(UriTemplate,Class)
- */
- private final Class resourceClass;
-
- /**
- * Public constructor.
- * @param template The URI template
- * @param resourceClass The resource class
- */
- public ResourceClassRule(final UriTemplate template, final Class resourceClass) {
- super(template);
- this.resourceClass = resourceClass;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- // Set the template values
- pushMatch(context);
-
- // Get the resource instance from the resource class
- resource = context.getResource(resourceClass);
- context.pushResource(resource);
-
- if (context.isTracingEnabled()) {
- context.trace(
- String.format(
- "accept resource: \"%s\" -> @Path(\"%s\") %s",
- context.getUriInfo().getMatchedURIs().get(0),
- getTemplate().getTemplate(),
- ReflectionHelper.objectToString(resource)
- )
- );
- }
-
- UriRuleProbeProvider.ruleAccept(
- ResourceClassRule.class.getSimpleName(),
- path,
- resource
- );
-
- // Match sub-rules on the resource class
- final Iterator<UriRule> matches = context
- .getRules(resourceClass)
- .match(path, context);
- while (matches.hasNext()) {
- if (matches.next().accept(path, resource, context)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.java
deleted file mode 100644
index a5382b722dc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import java.util.Iterator;
-
-/**
- * The rule for accepting a resource object.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResourceObjectRule extends BaseRule {
-
- private final Object resourceObject;
-
- /**
- * Public ctor.
- * @param template The URI template
- * @param resourceObject The object
- */
- public ResourceObjectRule(final UriTemplate template, final Object resourceObject) {
- super(template);
- this.resourceObject = resourceObject;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- // Set the template values
- pushMatch(context);
-
- if (context.isTracingEnabled()) {
- context.trace(
- String.format("accept resource: \"%s\" -> @Path(\"%s\") %s",
- context.getUriInfo().getMatchedURIs().get(0),
- getTemplate().getTemplate(),
- ReflectionHelper.objectToString(resourceObject)
- )
- );
- }
-
- context.pushResource(resourceObject);
-
- UriRuleProbeProvider.ruleAccept(
- ResourceObjectRule.class.getSimpleName(),
- path,
- resourceObject
- );
-
- // Match sub-rules on the resource class
- final Iterator<UriRule> matches = context
- .getRules(resourceObject.getClass())
- .match(path, context);
- while (matches.hasNext()) {
- if (matches.next().accept(path, resourceObject, context)) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.java
deleted file mode 100644
index be867886d1a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import java.util.regex.MatchResult;
-import javax.ws.rs.core.Response;
-
-/**
- * Adapter to an existing rule that accepts the rule using the last capturing
- * group value as the URI path.
- * <p>
- * This rule assumes that the pattern used to match this rule has certain
- * contraints. If a pattern contains one or more capturing groups then the
- * last capturing group MUST occur at the end of the pattern and MUST be
- * '(/.*)?' or '(/)?'.
- * <p>
- * If the source from which the pattern was derived ends in a '/'
- * and the matched path does not end in a '/' then a temporary redirect
- * response is returned with a path that is the matched path appened with '/'.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class RightHandPathRule implements UriRule {
- private final boolean redirect;
-
- private final boolean patternEndsInSlash;
-
- private final UriRule rule;
-
- /**
- * Public constructor.
- *
- * @param redirect if true return a temporary redirect response if the
- * path does not end in '/' and the pattern ends in '/'.
- * @param patternEndsInSlash true if the pattern used to match with rule
- * end in a '/', otherwise false.
- * @param rule the URI rule that is adapted.
- */
- public RightHandPathRule(final boolean redirect, final boolean patternEndsInSlash, final UriRule rule) {
- assert rule != null;
- this.redirect = redirect;
- this.patternEndsInSlash = patternEndsInSlash;
- this.rule = rule;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public final boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- UriRuleProbeProvider.ruleAccept(
- RightHandPathRule.class.getSimpleName(),
- path,
- resource
- );
-
- String rhpath = getRightHandPath(context.getMatchResult());
-
- if (rhpath.length() == 0) {
- // Redirect to path ending with a '/' if pattern
- // ends in '/' and redirect is true
- if (patternEndsInSlash && redirect) {
- if (context.isTracingEnabled()) {
- context.trace(
- String.format(
- "accept right hand path redirect: \"%s\" to \"%s/\"",
- path,
- path
- )
- );
- }
- return redirect(context);
- }
- context.pushRightHandPathLength(0);
- } else if (rhpath.length() == 1) {
- // Path is '/', no match if pattern does not end in a '/'
- // and redirect is true
- if (!patternEndsInSlash && redirect)
- return false;
-
- // Consume the '/'
- rhpath = "";
- context.pushRightHandPathLength(0);
- } else {
- if (patternEndsInSlash) {
- context.pushRightHandPathLength(rhpath.length() - 1);
- } else {
- context.pushRightHandPathLength(rhpath.length());
- }
- }
-
- if (context.isTracingEnabled()) {
- CharSequence lhpath = path.subSequence(0, path.length() - rhpath.length());
- context.trace(
- String.format(
- "accept right hand path %s: \"%s\" -> \"%s\" : \"%s\"",
- context.getMatchResult(),
- path,
- lhpath,
- rhpath
- )
- );
- }
- // Accept using the right hand path
- return rule.accept(rhpath, resource, context);
- }
-
- /**
- * Get the right hand path from the match result. The right hand path is
- * the last group (if present).
- *
- * @param mr the match result.
- * @return the right hand path, or the empty string if there is no last
- * group.
- */
- private String getRightHandPath(final MatchResult mr) {
- final String rhp = (mr.groupCount() > 0) ? mr.group(mr.groupCount()) : "";
- return (rhp != null) ? rhp : "";
- }
-
- /**
- * Redirect to a URI that ends in a slash.
- * @param context The URI rule context
- * @return Redirect or not?
- *
- * TODO use the complete URI.
- */
- private boolean redirect(final UriRuleContext context) {
- final HttpResponseContext response = context.getResponse();
- response.setResponse(
- Response.temporaryRedirect(
- context.getUriInfo().getRequestUriBuilder().path("/").build()
- ).build()
- );
- return true;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.java
deleted file mode 100644
index 2fc19e21557..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.server.impl.uri.PathPattern;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-import com.sun.jersey.spi.uri.rules.UriRules;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * The rule for accepting the root resource classes.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class RootResourceClassesRule implements UriRule {
-
- private final UriRules<UriRule> rules;
-
- /**
- * Public constructor
- * @param rulesMap Map of path patterns and URI rules
- */
- public RootResourceClassesRule(final Map<PathPattern, UriRule> rulesMap) {
- this.rules = UriRulesFactory.create(rulesMap);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- UriRuleProbeProvider.ruleAccept(
- RootResourceClassesRule.class.getSimpleName(),
- path,
- resource
- );
-
- if (context.isTracingEnabled()) {
- context.trace("accept root resource classes: \"" + path + "\"");
- }
-
- final Iterator<UriRule> matches = rules.match(path, context);
- while(matches.hasNext())
- if(matches.next().accept(path, resource, context))
- return true;
-
- return false;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.java
deleted file mode 100644
index a692a1b9512..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.uri.UriPattern;
-import com.sun.jersey.spi.uri.rules.UriMatchResultContext;
-import com.sun.jersey.spi.uri.rules.UriRules;
-import java.util.Iterator;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.regex.MatchResult;
-
-/**
- * Rules associated with instances of {@link UriPattern) and matched
- * in order. Zero or more matches may occur.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class SequentialMatchingPatterns<R> implements UriRules<R> {
-
- private final List<PatternRulePair<R>> rules;
-
- public SequentialMatchingPatterns(List<PatternRulePair<R>> rules) {
- this.rules = rules;
- }
-
- public Iterator<R> match(CharSequence path, UriMatchResultContext resultContext) {
- return new XInterator(path, resultContext);
- }
-
- private final class XInterator implements Iterator<R> {
-
- private final CharSequence path;
- private final UriMatchResultContext resultContext;
- private final Iterator<PatternRulePair<R>> i;
- private R r;
-
- XInterator(CharSequence path, UriMatchResultContext resultContext) {
- this.path = path;
- this.resultContext = resultContext;
- this.i = rules.iterator();
- }
-
- public boolean hasNext() {
- if (r != null) return true;
-
- while(i.hasNext()) {
- final PatternRulePair<R> prp = i.next();
- final MatchResult mr = prp.p.match(path);
- if (mr != null) {
- resultContext.setMatchResult(mr);
- r = prp.r;
- return true;
- }
- }
- r = null;
- return false;
- }
-
- public R next() {
- if (!hasNext()) throw new NoSuchElementException();
-
- final R _r = r;
- r = null;
- return _r;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.java
deleted file mode 100644
index f07f8ff5215..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerRequestFilter;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.monitoring.DispatchingListener;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-
-import javax.ws.rs.WebApplicationException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * The rule for accepting a sub-locator method.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class SubLocatorRule extends BaseRule {
-
- private final List<AbstractHttpContextInjectable> is;
-
- private final Method m;
-
- private final List<ContainerRequestFilter> requestFilters;
-
- private final List<ContainerResponseFilter> responseFilters;
-
- private final DispatchingListener dispatchingListener;
-
- private final AbstractSubResourceLocator locator;
-
- public SubLocatorRule(UriTemplate template,
- List<Injectable> is,
- List<ContainerRequestFilter> requestFilters,
- List<ContainerResponseFilter> responseFilters,
- DispatchingListener dispatchingListener,
- AbstractSubResourceLocator locator) {
- super(template);
- this.is = AbstractHttpContextInjectable.transform(is);
- this.requestFilters = requestFilters;
- this.responseFilters = responseFilters;
- this.dispatchingListener = dispatchingListener;
- this.locator = locator;
- this.m = locator.getMethod();
- }
-
- @Override
- public boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- UriRuleProbeProvider.ruleAccept(SubLocatorRule.class.getSimpleName(), path,
- resource);
-
- // Set the template values
- pushMatch(context);
-
- // Invoke the sub-locator to get the sub-resource
- Object subResource = invokeSubLocator(resource, context);
- // If null then no match
- if (subResource == null) {
- if (context.isTracingEnabled()) {
- trace(resource, subResource, context);
- }
- return false;
- }
-
- // Check if instance is a class
- if (subResource instanceof Class) {
- // If so then get the instance of that class
- subResource = context.getResource((Class)subResource);
- }
-
- dispatchingListener.onSubResource(Thread.currentThread().getId(), subResource.getClass());
-
- context.pushResource(subResource);
-
- if (context.isTracingEnabled()) {
- trace(resource, subResource, context);
- }
-
- // Match sub-rules on the returned resource class
- final Iterator<UriRule> matches = context.getRules(subResource.getClass()).
- match(path, context);
- while(matches.hasNext())
- if(matches.next().accept(path, subResource, context))
- return true;
-
- return false;
- }
-
- private void trace(Object resource, Object subResource, UriRuleContext context) {
- final String prevPath = context.getUriInfo().getMatchedURIs().get(1);
- final String currentPath = context.getUriInfo().getMatchedURIs().get(0);
-
- context.trace(
- String.format("accept sub-resource locator: \"%s\" : \"%s\" -> @Path(\"%s\") " +
- "%s = %s",
- prevPath,
- currentPath.substring(prevPath.length()),
- getTemplate().getTemplate(),
- ReflectionHelper.methodInstanceToString(resource, m),
- subResource));
- }
-
- private Object invokeSubLocator(Object resource, UriRuleContext context) {
- // Push the response filters
- context.pushContainerResponseFilters(responseFilters);
-
- // Process the request filter
- if (!requestFilters.isEmpty()) {
- ContainerRequest containerRequest = context.getContainerRequest();
- for (ContainerRequestFilter f : requestFilters) {
- containerRequest = f.filter(containerRequest);
- context.setContainerRequest(containerRequest);
- }
- }
-
- // Invoke the sub-locator method
- try {
- if (is.isEmpty()) {
- dispatchingListener.onSubResourceLocator(Thread.currentThread().getId(), locator);
- return m.invoke(resource);
- } else {
- final Object[] params = new Object[is.size()];
- int index = 0;
- for (AbstractHttpContextInjectable i : is) {
- params[index++] = i.getValue(context);
- }
-
- dispatchingListener.onSubResourceLocator(Thread.currentThread().getId(), locator);
- return m.invoke(resource, params);
- }
- } catch (InvocationTargetException e) {
- // Propagate the target exception so it may be mapped to a response
- throw new MappableContainerException(e.getTargetException());
- } catch (IllegalAccessException e) {
- throw new ContainerException(e);
- } catch (WebApplicationException e) {
- throw e;
- } catch (RuntimeException e) {
- throw new ContainerException("Exception injecting parameters for sub-locator method: " + m, e);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/TerminatingRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/TerminatingRule.java
deleted file mode 100644
index 637052cd4ed..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/TerminatingRule.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRuleContext;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import javax.ws.rs.WebApplicationException;
-
-/**
- * A terminating rule that checks to see if the response has been
- * set by the runtime. If a response has been set then the rule is accepted
- * otherwise it is not.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class TerminatingRule implements UriRule {
-
- public final boolean accept(CharSequence path, Object resource, UriRuleContext context) {
- UriRuleProbeProvider.ruleAccept(TerminatingRule.class.getSimpleName(), path,
- resource);
-
- if (context.isTracingEnabled()) {
- context.trace("accept termination (matching failure): \"" + path + "\"");
- }
-
- if (context.getResponse().isResponseSet())
- throw new WebApplicationException(context.getResponse().getResponse());
- else
- return false;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.java
deleted file mode 100644
index a6284480b45..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-
-package com.sun.jersey.server.impl.uri.rules;
-
-import com.sun.jersey.server.impl.uri.PathPattern;
-import com.sun.jersey.server.impl.uri.rules.automata.AutomataMatchingUriTemplateRules;
-import com.sun.jersey.spi.uri.rules.UriRule;
-import com.sun.jersey.spi.uri.rules.UriRules;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class UriRulesFactory {
- private UriRulesFactory() {}
-
- public static UriRules<UriRule> create(Map<PathPattern, UriRule> rulesMap) {
- return create(rulesMap, null);
- }
-
- public static UriRules<UriRule> create(Map<PathPattern, UriRule> rulesMap,
- List<PatternRulePair<UriRule>> rules) {
- List<PatternRulePair<UriRule>> l = new ArrayList<PatternRulePair<UriRule>>();
- for (Map.Entry<PathPattern, UriRule> e : rulesMap.entrySet())
- l.add(new PatternRulePair<UriRule>(e.getKey(), e.getValue()));
-
- if (rules != null) l.addAll(rules);
-
- return create(l);
- }
-
- public static UriRules<UriRule> create(List<PatternRulePair<UriRule>> rules) {
- if (rules.size() < Integer.MAX_VALUE) {
- return new AtomicMatchingPatterns<UriRule>(rules);
- } else {
- return new AutomataMatchingUriTemplateRules<UriRule>(rules);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.java
deleted file mode 100644
index f1ff689b1b1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules.automata;
-
-import com.sun.jersey.server.impl.uri.PathPattern;
-import com.sun.jersey.server.impl.uri.rules.PatternRulePair;
-import com.sun.jersey.spi.uri.rules.UriMatchResultContext;
-import com.sun.jersey.spi.uri.rules.UriRules;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.Stack;
-
-/**
- * UriRules implementation based on a TRIE/Finite Automata.
- *
- * This class has been made abstract because it needs to fixed in terms
- * of supporting the UriRules interface and matching using more general regular
- * expressions.
- *
- * @author Frank D. Martinez. fmartinez@asimovt.com
- */
-public class AutomataMatchingUriTemplateRules<R> implements UriRules<R> {
- /** Trie/Automata Index */
- private final TrieNode<R> automata;
-
- public AutomataMatchingUriTemplateRules(List<PatternRulePair<R>> rules) {
- this.automata = initTrie(rules);
- }
-
- public Iterator<R> match(CharSequence path, UriMatchResultContext resultContext) {
- List<String> capturingGroupValues = new ArrayList<String>();
- TrieNode<R> node = find(path, capturingGroupValues);
- if (node != null) {
- return node.getValue();
- }
- return new TrieNodeValue.EmptyIterator<R>();
- }
-
- /**
- * Trie initialization
- */
- private TrieNode<R> initTrie(List<PatternRulePair<R>> rules) {
- TrieNode<R> a = new TrieNode<R>();
- for (PatternRulePair<R> prp : rules) {
- if (prp.p instanceof PathPattern) {
- PathPattern p = (PathPattern)prp.p;
- a.add(p.getTemplate().getTemplate(), prp.r, prp.p);
- } else {
- throw new IllegalArgumentException(
- "The automata matching algorithm currently only works" +
- "for UriPattern instance that are instances of " +
- "PathPattern");
- }
- }
- a.pack();
- return a;
- }
-
- /**
- * Backtracking state struct
- */
- private static final class SearchState<E> {
-
- // Saved node
- final TrieNode<E> node;
-
- // Saved arch
- final TrieArc<E> arc;
-
- // Saved input position
- final int i;
-
- /** Constructor */
- public SearchState(TrieNode<E> node, TrieArc<E> arc, int i) {
- this.node = node;
- this.arc = arc;
- this.i = i;
- }
-
- }
-
- /**
- * Trie/Automata search algorithm.
- */
- private TrieNode<R> find(CharSequence uri, List<String> templateValues) {
-
- // URI Length
- final int length = uri.length();
-
- // Backtracking stack
- final Stack<SearchState<R>> stack = new Stack<SearchState<R>>();
-
- // Candidates saved by the way
- final Stack<TrieNode<R>> candidates = new Stack<TrieNode<R>>();
-
- // Arcs marked as visited
- final Set<TrieArc<R>> visitedArcs = new HashSet<TrieArc<R>>();
-
- // Actual node
- TrieNode<R> node = automata;
-
- // Actual matching arc
- TrieArc<R> nextArc = node.getFirstArc();
-
- // URI character pointer
- int i = 0;
-
- // =====================================================================
- // Trie Search with backtracking
- // NFA simulation
- // =====================================================================
-
- while (true) {
-
- // End of input reached
- if (i >= length) {
-
- // Resource matched
- if (node.hasValue()) break; // <<< EXIT POINT <<<<<<<<<<<<<<<<<<
-
- // Restore backtracking state
- nextArc = null;
- while (!stack.isEmpty() && nextArc == null) {
- SearchState<R> state = stack.pop();
- nextArc = state.arc.next;
- node = state.node;
- i = state.i;
- }
-
- // Skip visited arcs if necesary
- if (nextArc != null) {
- while (visitedArcs.contains(nextArc)) {
- nextArc = nextArc.next;
- }
- if (nextArc != null) visitedArcs.add(nextArc);
- }
-
- // No more chance to match
- if (nextArc == null) break; // <<< EXIT POINT <<<<<<<<<<<<<<<<<<
-
- // Go backtrack
- continue;
-
- }
-
- // Accept a wildcard (Parameter)
- if (nextArc == null && node.isWildcard()) {
- int p = 0;
- TrieArc<R> exitArc = null;
- while ((i+p) < length &&
- (exitArc = node.matchExitArc(uri, i+p)) == null) p++;
- if (exitArc != null) {
- nextArc = exitArc;
- }
- i = i+p;
- continue;
- }
-
- // No wildcard and no more paths, end.
- else if (nextArc == null && !node.isWildcard()) {
- break; // <<< EXIT POINT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
- }
-
- // Save backtracking point
- if (nextArc.next != null && node.isWildcard()) {
- stack.push(new SearchState<R>(node, nextArc, i));
- }
-
- // Save candidate
- if (node.hasValue()) {
- candidates.push(node);
- }
-
- // Matching cases ==================================================
-
- // CASE 0 ----------------------------------------------------------
- // If wildcard matches, exit wildcard.
- if (node.isWildcard() && nextArc.match(uri, i) > 0) {
- i += nextArc.length();
- node = nextArc.target;
- nextArc = node.getFirstArc();
- continue;
- }
-
- // CASE 1 ----------------------------------------------------------
- // If wildcard does not match, try another escape sequence.
- // if nothing matches, consume input.
- else if (node.isWildcard() && nextArc.match(uri, i) == 0) {
- nextArc = nextArc.next;
- if (nextArc == null) {
- i++;
- }
- continue;
- }
-
- // CASE 2 ----------------------------------------------------------
- // Fixed sequence matches, consume input and follow the arc.
- else if (!node.isWildcard() && nextArc.match(uri, i) > 0) {
- i += nextArc.length();
- node = nextArc.target;
- nextArc = node.getFirstArc();
- continue;
- }
-
- // CASE 3 ----------------------------------------------------------
- // Fixed sequence does not match, try the next.
- else if (!node.isWildcard() && nextArc.match(uri, i) == 0) {
- nextArc = nextArc.next;
- continue;
- }
-
- }
-
- // =====================================================================
- // Select a matching candidate
- // =====================================================================
-
- // A perfect match
- if (node.hasValue()) {
- if (node.getPattern().match(uri, templateValues)) {
- return node;
- }
- }
-
- // No direct matches, looking for a secondary candidate
- while (!candidates.isEmpty()) {
- TrieNode<R> s = candidates.pop();
- if (s.getPattern().match(uri, templateValues)) {
- return s;
- }
- }
-
- // Definitively it does not match
- templateValues.clear();
- return null;
-
- }
-
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.java
deleted file mode 100644
index 0deab40b1bd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules.automata;
-
-/**
- * Represents an arc (transition) between trie nodes.
- * @author Frank D. Martinez. fmartinez@asimovt.com
- */
-public class TrieArc<T> {
-
- /** Character that match this arc. */
- protected char[] code;
-
- /** Target node at the end of this arc. */
- protected TrieNode<T> target;
-
- /** Next alternative node if this node does not match. */
- protected TrieArc<T> next;
-
- /**
- * Creates a new instance of TrieArc.
- * @param target Target node at the end of this arc.
- * @param code Matching character.
- */
- public TrieArc(TrieNode<T> target, char code) {
- this.target = target;
- this.code = new char[] {code};
- }
-
- /**
- * Merge neighbour nodes if they are degenerated trees.
- */
- private void merge(TrieArc<T> arc) {
- int p = code.length;
- // Cannot depend on SE 6 specific features
- // code = Arrays.copyOf(code, code.length + arc.code.length);
- code = copyOf(code, code.length + arc.code.length);
- System.arraycopy(arc.code, 0, code, p, arc.code.length);
- this.target = arc.target;
- if (target.getArcs() == 1 && !target.hasValue() && !target.isWildcard()) {
- merge(target.getFirstArc());
- }
- }
-
- /**
- * Merge neighbour nodes if they are degenerated trees.
- */
- public void pack() {
- if (target.getArcs() == 1 && !target.hasValue() && !target.isWildcard()) {
- merge(target.getFirstArc());
- }
- target.pack();
- }
-
- /**
- * Number of characters to be consumed if this arc matches the input.
- **/
- public int length() {
- return code.length;
- }
-
- /**
- * Returns length() if this arc matches the input, 0 otherwise.
- */
- public int match(CharSequence seq, int i) {
- if (i+code.length > seq.length()) return 0;
- for (int j=0; j<code.length; j++) {
- if (code[j] != seq.charAt(i++)) return 0;
- }
- return code.length;
- }
-
- @Override public String toString() {
- if (target.hasValue()) {
- return "ARC(" + new String(code) + ") --> " + target.getPattern().getRegex();
- }
- else {
- return "ARC(" + new String(code) + ") --> null";
- }
- }
-
- // Copied from SE 6 source
- /**
- * Copies the specified array, truncating or padding with null characters (if necessary)
- * so the copy has the specified length. For all indices that are valid
- * in both the original array and the copy, the two arrays will contain
- * identical values. For any indices that are valid in the copy but not
- * the original, the copy will contain <tt>'\\u000'</tt>. Such indices
- * will exist if and only if the specified length is greater than that of
- * the original array.
- *
- * @param original the array to be copied
- * @param newLength the length of the copy to be returned
- * @return a copy of the original array, truncated or padded with null characters
- * to obtain the specified length
- * @throws NegativeArraySizeException if <tt>newLength</tt> is negative
- * @throws NullPointerException if <tt>original</tt> is null
- * @since 1.6
- */
- private static char[] copyOf(char[] original, int newLength) {
- char[] copy = new char[newLength];
- System.arraycopy(original, 0, copy, 0,
- Math.min(original.length, newLength));
- return copy;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.java
deleted file mode 100644
index 16d7a2b708c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.uri.rules.automata;
-
-import com.sun.jersey.api.uri.UriPattern;
-import com.sun.jersey.api.uri.UriTemplate;
-import java.util.Iterator;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Represents a trie automata node.
- * @author Frank D. Martinez. fmartinez@asimovt.com
- */
-public final class TrieNode<T> {
-
- /** TemplateParameters pattern regexp. */
- public static final Pattern PARAMETER_PATTERN =
- Pattern.compile("\\{([\\w-\\._~]+?)\\}");
-
- /** Wildcard character */
- private static final char WILDCARD_CHAR = '\0';
-
- /** First child arc (this is a linked tree structure) */
- private TrieArc<T> firstArc;
-
- /** Last child arc (this is a linked tree structure) */
- private TrieArc<T> lastArc;
-
- /** arc counter */
- private int arcs = 0;
-
- /** Node's data */
- private TrieNodeValue<T> value = new TrieNodeValue<T>();
-
- /** Node's UriPattern used to match. */
- private UriPattern pattern;
-
- /** Tells if this node is a wildcard node */
- private boolean wildcard = false;
-
- /** wildcard setter.
- * @param b New wildcard value.
- */
- protected void setWildcard(boolean b) {
- wildcard = b;
- }
-
- /** value setter.
- * @param value New value.
- * @param template Associated template.
- */
- protected void setValue(T value, UriPattern pattern) {
- this.value.set(value);
- this.pattern = pattern;
- }
-
- /** Creates a new instance of TrieNode */
- protected TrieNode() {
- super();
- }
-
- /** Creates a new instance of TrieNode
- * @param value Initial value.
- */
- protected TrieNode(T value) {
- this.value.set(value);
- }
-
- /**
- * Search for a matching escape character in a wildcard sequence.
- * @param c Test char.
- */
- protected TrieArc<T> matchExitArc(CharSequence seq, int i) {
- TrieArc<T> arc = firstArc;
- while (arc != null) {
- if (arc.match(seq, i) > 0) {
- return arc;
- }
- arc = arc.next;
- }
- return null;
- }
-
- /**
- * Tells if there is a value in this node.
- */
- protected boolean hasValue() {
- return !value.isEmpty();
- }
-
- /**
- * Adds an arc at the end.
- * @param arc New arc.
- */
- private void addArc(TrieArc<T> arc) {
- if (firstArc == null) {
- firstArc = arc;
- }
- else {
- lastArc.next = arc;
- }
- lastArc = arc;
- arcs++;
- }
-
- /**
- * Adds a new node in the tree.
- * @param path Tree position (URI)
- * @param i Current position in path.
- * @param value Value to be added at the end of path.
- * @param pattern UriPattern associated with value.
- */
- private boolean add(CharSequence path, int i, T value,
- UriPattern pattern) {
-
- // Case 1: NULL, The Last ----------------------------------------------
- if (i >= path.length()) {
- setValue(value, pattern);
- return true;
- }
-
- // Case 2: Recursive add -----------------------------------------------
- char input = path.charAt(i);
- boolean added = false;
- TrieArc<T> arc = firstArc;
- while (arc != null) {
- if (arc.match(path, i) > 0) {
- added = arc.target.add(path, i+1, value, pattern);
- if (added) {
- return added;
- }
- }
- arc = arc.next;
- }
-
- // Case 3: Set as wildcard ---------------------------------------------
- TrieNode<T> node;
- if (input == WILDCARD_CHAR) {
- setWildcard(true);
- return add(path, i+1, value, pattern);
- }
-
- // Case 4: Just Add ----------------------------------------------------
- else {
- node = new TrieNode<T>();
- addArc(new TrieArc<T>(node, input));
- return node.add(path, i+1, value, pattern);
- }
-
- }
-
- /**
- * Adds a new node to the tree.
- * @param path Matching URI
- * @param value Value to be added.
- * @param template Associated UriPattern.
- */
- protected void add(String path, T value, UriPattern pattern) {
-
- // Replace All parameter macro by a WILDCARD character.
- Matcher matcher = PARAMETER_PATTERN.matcher(path);
- String uri = matcher.replaceAll(String.valueOf(WILDCARD_CHAR));
-
- // If ends with '/', add the parent
- if (uri.endsWith("/") && uri.length() > 1) {
- add(uri.substring(0, uri.length()-1), 0, value, pattern);
- }
-
- // Add to root
- add(uri, 0, value, pattern);
-
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- @Override public String toString() {
- StringBuilder out = new StringBuilder();
- toStringRepresentation(out, 0, new char[] {'\0'});
- return out.toString();
- }
-
- /**
- * Builds a string representation of this subtree.
- * @param out Output string.
- * @param level indentation level.
- * @param c Transition char.
- */
- private void toStringRepresentation(StringBuilder out, int level, char[] c) {
- for (int i=0; i<level; i++) out.append(' ');
- out.append("ARC(" + new String(c) + ") ->");
- out.append(getClass().getSimpleName() + (wildcard?"*":""));
- out.append(" ");
- out.append(value);
- out.append('\n');
- TrieArc<T> arc = firstArc;
- while (arc != null) {
- arc.target.toStringRepresentation(out, level+2, arc.code);
- arc = arc.next;
- }
- }
-
- /** pattern getter. */
- public UriPattern getPattern() {
- return pattern;
- }
-
- /** value getter. */
- public Iterator<T> getValue() {
- return value.getIterator();
- }
-
- /** wildcard getter. */
- protected boolean isWildcard() {
- return wildcard;
- }
-
- /** firstArch getter. */
- protected TrieArc<T> getFirstArc() {
- return firstArc;
- }
-
- /** arcs getter. */
- public int getArcs() {
- return arcs;
- }
-
- /**
- * Pack and optimize the automata.
- */
- public void pack() {
- TrieArc<T> arc = firstArc;
- while (arc != null) {
- arc.pack();
- arc = arc.next;
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.java
deleted file mode 100644
index 192c381b364..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/*
- * TrieNodeValue.java
- *
- * Created on November 18, 2007, 11:57 AM
- *
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
- */
-
-package com.sun.jersey.server.impl.uri.rules.automata;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- *
- * @author mnesarco
- */
-public class TrieNodeValue<T> {
-
- private Object value = null;
-
- /** Creates a new instance of TrieNodeValue */
- public TrieNodeValue() {
- }
-
- public void set(T value) {
- if (this.value == null) {
- this.value = value;
- }
- else if (this.value.getClass().isArray()) {
- Object[] old = (Object[])this.value;
- Object[] copy = new Object[old.length+1];
- System.arraycopy(old, 0, copy, 0, old.length+1);
- copy[copy.length-1] = value;
- this.value = copy;
- }
- else {
- this.value = new Object[] { this.value, value };
- }
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<T> getIterator() {
- if (this.value == null) {
- return new EmptyIterator();
- }
- else if (this.value.getClass().isArray()) {
- return new ArrayIterator<T>((Object[])this.value);
- }
- else {
- return new SingleEntryIterator<T>((T)this.value);
- }
- }
-
- public boolean isEmpty() {
- return value == null;
- }
-
- private static final class ArrayIterator<T> implements Iterator<T> {
-
- private Object[] data;
-
- private int cursor = 0;
-
- public ArrayIterator(Object[] data) {
- this.data = data;
- }
-
- public boolean hasNext() {
- return cursor < data.length;
- }
-
- @SuppressWarnings("unchecked")
- public T next() {
- if (hasNext()) {
- return (T)data[cursor++];
- }
- else {
- throw new NoSuchElementException();
- }
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- }
-
- private static final class SingleEntryIterator<T> implements Iterator<T> {
- private T t;
-
- SingleEntryIterator(T t) {
- this.t = t;
- }
-
- public boolean hasNext() {
- return t != null;
- }
-
- public T next() {
- if (hasNext()) {
- final T _t = t;
- t = null;
- return _t;
- } else {
- throw new NoSuchElementException();
- }
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-
- static final class EmptyIterator<T> implements Iterator<T> {
- public boolean hasNext() {
- return false;
- }
- public T next() {
- throw new NoSuchElementException();
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.java
deleted file mode 100644
index fe19e3a04f4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.wadl;
-
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.server.wadl.WadlApplicationContext;
-import com.sun.jersey.server.wadl.WadlBuilder;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.research.ws.wadl.Application;
-
-import javax.ws.rs.core.UriInfo;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import java.util.Set;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WadlApplicationContextImpl implements WadlApplicationContext {
-
- private boolean wadlGenerationEnabled = true;
-
- private final Set<AbstractResource> rootResources;
- private final WadlGenerator wadlGenerator;
- private JAXBContext jaxbContext;
-
- public WadlApplicationContextImpl(
- Set<AbstractResource> rootResources,
- WadlGenerator wadlGenerator) {
- this.rootResources = rootResources;
- this.wadlGenerator = wadlGenerator;
- try {
- this.jaxbContext = JAXBContext.newInstance(wadlGenerator.getRequiredJaxbContextPath());
- } catch (JAXBException ex) {
- this.jaxbContext = null;
- }
- }
-
- public Application getApplication() {
- return getWadlBuilder().generate(rootResources);
- }
-
- public Application getApplication(UriInfo ui) {
- Application a = getWadlBuilder().generate(rootResources);
- a.getResources().setBase(ui.getBaseUri().toString());
- return a;
- }
-
- public JAXBContext getJAXBContext() {
- return jaxbContext;
- }
-
- public String getJAXBContextPath() {
- return wadlGenerator.getRequiredJaxbContextPath();
- }
-
- public WadlBuilder getWadlBuilder() {
- return (this.wadlGenerationEnabled ? new WadlBuilder(wadlGenerator) : null);
- }
-
- @Override
- public void setWadlGenerationEnabled(boolean wadlGenerationEnabled) {
- this.wadlGenerationEnabled = wadlGenerationEnabled;
- }
-
- public boolean isWadlGenerationEnabled() {
- return wadlGenerationEnabled;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlFactory.java
deleted file mode 100644
index 041711dc892..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlFactory.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.wadl;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.wadl.config.WadlGeneratorConfigLoader;
-import com.sun.jersey.core.spi.factory.InjectableProviderFactory;
-import com.sun.jersey.server.impl.model.method.ResourceMethod;
-import com.sun.jersey.server.impl.uri.PathPattern;
-import com.sun.jersey.server.wadl.WadlApplicationContext;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
-
-import javax.ws.rs.core.Context;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class WadlFactory {
-
- private static final Logger LOGGER = Logger.getLogger(WadlFactory.class.getName());
-
- private final boolean isWadlEnabled;
-
- private final WadlGenerator wadlGenerator;
-
- private WadlApplicationContext wadlApplicationContext;
-
- public WadlFactory(ResourceConfig resourceConfig) {
- isWadlEnabled = isWadlEnabled(resourceConfig);
-
- if (isWadlEnabled) {
- wadlGenerator = WadlGeneratorConfigLoader.loadWadlGeneratorsFromConfig(resourceConfig);
- }
- else {
- wadlGenerator = null;
- }
- }
-
- public boolean isSupported() {
- return isWadlEnabled;
- }
-
- public WadlApplicationContext createWadlApplicationContext(Set<AbstractResource> rootResources) {
- if (!isSupported()) return null;
-
- return new WadlApplicationContextImpl(rootResources, wadlGenerator);
- }
-
- public void init(InjectableProviderFactory ipf, Set<AbstractResource> rootResources) {
- if (!isSupported()) return;
-
- wadlApplicationContext = new WadlApplicationContextImpl(rootResources, wadlGenerator);
-
- ipf.add(new SingletonTypeInjectableProvider<Context, WadlApplicationContext>(
- WadlApplicationContext.class, wadlApplicationContext) {});
- }
-
- /**
- * Create the WADL resource method for OPTIONS.
- * <p>
- * This is created using reflection so that there is no runtime
- * dependency on JAXB. If the JAXB jars are not in the class path
- * then WADL generation will not be supported.
- *
- * @param resource the resource model
- * @return the WADL resource OPTIONS method
- */
- public ResourceMethod createWadlOptionsMethod(
- Map<String, List<ResourceMethod>> methods,
- AbstractResource resource, PathPattern p) {
- if (!isSupported()) return null;
-
- if (p == null) {
- return new WadlMethodFactory.WadlOptionsMethod(methods, resource, null, wadlGenerator, wadlApplicationContext);
- } else {
- // Remove the '/' from the beginning
- String path = p.getTemplate().getTemplate().substring(1);
- return new WadlMethodFactory.WadlOptionsMethod(methods, resource, path, wadlGenerator, wadlApplicationContext);
- }
- }
-
- /**
- * Check if JAXB is present in the class path
- * @return
- *
- * @throws java.lang.ClassNotFoundException
- */
- private static boolean isWadlEnabled(ResourceConfig resourceConfig) {
- return !resourceConfig.getFeature(ResourceConfig.FEATURE_DISABLE_WADL);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlMethodFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlMethodFactory.java
deleted file mode 100644
index 6a680fbc21f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlMethodFactory.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.wadl;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.server.impl.model.method.ResourceHttpOptionsMethod;
-import com.sun.jersey.server.impl.model.method.ResourceMethod;
-import com.sun.jersey.server.wadl.WadlApplicationContext;
-import com.sun.jersey.server.wadl.WadlBuilder;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.research.ws.wadl.Application;
-import com.sun.research.ws.wadl.Resource;
-
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-/* package */ final class WadlMethodFactory {
-
- public static final class WadlOptionsMethod extends ResourceMethod {
- public WadlOptionsMethod(Map<String, List<ResourceMethod>> methods,
- AbstractResource resource, String path, WadlGenerator wadlGenerator,
- WadlApplicationContext wadlApplicationContext) {
- super("OPTIONS",
- UriTemplate.EMPTY,
- MediaTypes.GENERAL_MEDIA_TYPE_LIST,
- MediaTypes.GENERAL_MEDIA_TYPE_LIST,
- false,
- new WadlOptionsMethodDispatcher(methods, resource, path, wadlGenerator, wadlApplicationContext));
- }
-
- @Override
- public String toString() {
- return "WADL OPTIONS method" ;
- }
- }
-
- private static final class WadlOptionsMethodDispatcher extends
- ResourceHttpOptionsMethod.OptionsRequestDispatcher {
- private final AbstractResource resource;
- private final String path;
- private final WadlGenerator wadlGenerator;
- private final WadlApplicationContext wadlApplicationContext;
-
- WadlOptionsMethodDispatcher(Map<String, List<ResourceMethod>> methods,
- AbstractResource resource, String path, WadlGenerator wadlGenerator,
- WadlApplicationContext wadlApplicationContext) {
- super(methods);
- this.resource = resource;
- this.path = path;
- this.wadlGenerator = wadlGenerator;
- this.wadlApplicationContext = wadlApplicationContext;
- }
-
- @Override
- public void dispatch(final Object o, final HttpContext context) {
- if(wadlApplicationContext.isWadlGenerationEnabled()) {
- final Application a = generateApplication(context.getUriInfo(),
- resource, path, wadlGenerator);
-
- context.getResponse().setResponse(
- Response.ok(a, MediaTypes.WADL).header("Allow", allow).build());
- } else {
- if(!wadlApplicationContext.isWadlGenerationEnabled())
- context.getResponse().setResponse(Response.status(Response.Status.NO_CONTENT).header("Allow", allow).build());
- }
- }
- }
-
- private static Application generateApplication(UriInfo info,
- AbstractResource resource, String path, WadlGenerator wadlGenerator) {
- Application a = path == null ? new WadlBuilder( wadlGenerator ).generate(resource) :
- new WadlBuilder( wadlGenerator ).generate(resource, path);
-
- a.getResources().setBase(info.getBaseUri().toString());
-
- final Resource r = a.getResources().getResource().get(0);
- r.setPath(info.getBaseUri().relativize(
- info.getAbsolutePath()).toString());
-
- // remove path params since path is fixed at this point
- r.getParam().clear();
-
- return a;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlResource.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlResource.java
deleted file mode 100644
index 9f287db2fec..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/impl/wadl/WadlResource.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.impl.wadl;
-
-import com.sun.jersey.server.wadl.WadlApplicationContext;
-import com.sun.jersey.spi.resource.Singleton;
-import com.sun.research.ws.wadl.Application;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.xml.bind.Marshaller;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-@Produces({"application/vnd.sun.wadl+xml", "application/xml"})
-@Singleton
-public final class WadlResource {
-
- private static final Logger LOGGER = Logger.getLogger(WadlResource.class.getName());
-
- private WadlApplicationContext wadlContext;
-
- private Application application;
-
- private byte[] wadlXmlRepresentation;
-
- public WadlResource(@Context WadlApplicationContext wadlContext) {
- this.wadlContext = wadlContext;
- this.application = wadlContext.getApplication();
- }
-
- @GET
- public synchronized Response getWadl(@Context UriInfo uriInfo) {
- if(!wadlContext.isWadlGenerationEnabled()) {
- return Response.status(Response.Status.NOT_FOUND).build();
- }
-
- if (wadlXmlRepresentation == null) {
- if (application.getResources().getBase() == null) {
- application.getResources().setBase(uriInfo.getBaseUri().toString());
- }
- try {
- final Marshaller marshaller = wadlContext.getJAXBContext().createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- final ByteArrayOutputStream os = new ByteArrayOutputStream();
- marshaller.marshal(application, os);
- wadlXmlRepresentation = os.toByteArray();
- os.close();
- } catch (Exception e) {
- LOGGER.log(Level.WARNING, "Could not marshal wadl Application.", e);
- return Response.ok(application).build();
- }
- }
-
- return Response.ok(new ByteArrayInputStream(wadlXmlRepresentation)).build();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/osgi/Activator.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/osgi/Activator.java
deleted file mode 100644
index 59f2883ee95..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/osgi/Activator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.osgi;
-
-import com.sun.jersey.server.impl.provider.RuntimeDelegateImpl;
-
-import javax.ws.rs.ext.RuntimeDelegate;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-import java.util.logging.Logger;
-
-/**
- *
- * @author japod
- */
-public class Activator implements BundleActivator {
-
- private static final Logger LOGGER = Logger.getLogger(Activator.class.getName());
-
- //@Override
- public void start(BundleContext bc) throws Exception {
- LOGGER.config("jersey-server bundle activator registers JAX-RS RuntimeDelegate instance");
- RuntimeDelegate.setInstance(new RuntimeDelegateImpl());
- }
-
- //@Override
- public void stop(BundleContext bc) throws Exception {
- // TODO: what now brown cow?
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/probes/UriRuleProbeProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/probes/UriRuleProbeProvider.java
deleted file mode 100644
index 52ef95d14a7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/probes/UriRuleProbeProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.probes;
-
-/**
- * A probe provider, for GlassFish monitoring, that reports low-level events
- * when URI rules are matched.
- *
- * @author pavel.bucek@sun.com
- */
-public class UriRuleProbeProvider {
- /**
- * Invoked when matching starts.
- *
- * @param requestUri the request URI.
- */
- public static void requestStart(java.net.URI requestUri) {
- }
-
- /**
- * Invoked when a UriRule is matched.
- *
- * @param ruleName the URI rule name.
- * @param path the matched path.
- * @param resourceClass the resource instance associated with matching.
- */
- public static void ruleAccept(String ruleName, CharSequence path, Object resourceClass) {
- }
-
- /**
- * Invoked when matching ends.
- */
- public static void requestEnd() {
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/probes/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/probes/package-info.java
deleted file mode 100644
index 2f75571445f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/probes/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support GlassFish monitoring probes.
- */
-package com.sun.jersey.server.probes; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentConstructor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentConstructor.java
deleted file mode 100644
index 7d3c784aa7a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentConstructor.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.spi.component;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceConstructor;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.spi.inject.Errors;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-/**
- * A constructor of a resource class.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ResourceComponentConstructor {
- private final Class c;
-
- private final ResourceComponentInjector rci;
-
- private final Constructor constructor;
-
- private final List<Method> postConstructs = new ArrayList<Method>();
-
- private final List<AbstractHttpContextInjectable> injectables;
-
- /**
- * A tuple of a constructor and the list of injectables associated with
- * the parameters of the constructor.
- *
- * @param <T> the type to construct.
- */
- private static class ConstructorInjectablePair {
- /**
- * The constructor.
- */
- private final Constructor con;
-
- /**
- * The list of injectables associated with the parameters of the
- * constructor;
- */
- private final List<Injectable> is;
-
- /**
- * Create a new tuple of a constructor and list of injectables.
- *
- * @param con the constructor
- * @param is the list of injectables.
- */
- private ConstructorInjectablePair(Constructor con, List<Injectable> is) {
- this.con = con;
- this.is = is;
- }
- }
-
- private static class ConstructorComparator<T> implements Comparator<ConstructorInjectablePair> {
- public int compare(ConstructorInjectablePair o1, ConstructorInjectablePair o2) {
- int p = Collections.frequency(o1.is, null) - Collections.frequency(o2.is, null);
- if (p != 0)
- return p;
-
- return o2.con.getParameterTypes().length - o1.con.getParameterTypes().length;
- }
- }
-
- public ResourceComponentConstructor(ServerInjectableProviderContext sipc,
- ComponentScope scope, AbstractResource ar) {
- this.c = ar.getResourceClass();
-
- final int modifiers = c.getModifiers();
- if (!Modifier.isPublic(modifiers)) {
- Errors.nonPublicClass(c);
- }
-
- if (Modifier.isAbstract(modifiers)) {
- if (Modifier.isInterface(modifiers)) {
- Errors.interfaceClass(c);
- } else {
- Errors.abstractClass(c);
- }
- }
-
- if (c.getEnclosingClass() != null && !Modifier.isStatic(modifiers)) {
- Errors.innerClass(c);
- }
-
- if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers)) {
- if (c.getConstructors().length == 0) {
- Errors.nonPublicConstructor(c);
- }
- }
-
- this.rci = new ResourceComponentInjector(
- sipc,
- scope,
- ar);
-
- this.postConstructs.addAll(ar.getPostConstructMethods());
-
- ConstructorInjectablePair cip = getConstructor(sipc, scope, ar);
- if (cip == null) {
- this.constructor = null;
- this.injectables = null;
- } else if (cip.is.isEmpty()) {
- this.constructor = cip.con;
- this.injectables = null;
- } else {
- if (cip.is.contains(null)) {
- // Missing dependency
- for (int i = 0; i < cip.is.size(); i++) {
- if (cip.is.get(i) == null) {
- Errors.missingDependency(cip.con, i);
- }
- }
- }
- this.constructor = cip.con;
- this.injectables = AbstractHttpContextInjectable.transform(cip.is);
- }
- }
-
- public Class getResourceClass() {
- return c;
- }
-
- public Object construct(HttpContext hc)
- throws InstantiationException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException {
- final Object o = _construct(hc);
- rci.inject(hc, o);
- for (Method postConstruct : postConstructs) {
- postConstruct.invoke(o);
- }
- return o;
- }
-
- private Object _construct(HttpContext hc)
- throws InstantiationException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException {
- if (injectables == null) {
- return (constructor != null) ? constructor.newInstance() : c.newInstance();
- } else {
- Object[] params = new Object[injectables.size()];
- int i = 0;
- for (AbstractHttpContextInjectable injectable : injectables) {
- params[i++] = (injectable != null) ? injectable.getValue(hc) : null;
- }
- return constructor.newInstance(params);
- }
- }
-
- /**
- * Get the most suitable constructor. The constructor with the most
- * parameters and that has the most parameters associated with
- * Injectable instances will be chosen.
- *
- * @param <T> the type of the resource.
- * @param c the class to instantiate.
- * @param ar the abstract resource.
- * @param s the scope for which the injectables will be used.
- * @return a list constructor and list of injectables for the constructor
- * parameters.
- */
- @SuppressWarnings("unchecked")
- private <T> ConstructorInjectablePair getConstructor(
- ServerInjectableProviderContext sipc,
- ComponentScope scope,
- AbstractResource ar) {
- if (ar.getConstructors().isEmpty())
- return null;
-
- SortedSet<ConstructorInjectablePair> cs = new TreeSet<ConstructorInjectablePair>(
- new ConstructorComparator());
- for (AbstractResourceConstructor arc : ar.getConstructors()) {
- List<Injectable> is = sipc.getInjectable(arc.getCtor(), arc.getParameters(), scope);
- cs.add(new ConstructorInjectablePair(arc.getCtor(), is));
- }
-
- return cs.first();
- }
- } \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentDestructor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentDestructor.java
deleted file mode 100644
index d9ee1f9cb16..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentDestructor.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.spi.component;
-
-import com.sun.jersey.api.model.AbstractResource;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A destructor of a resource class instance.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ResourceComponentDestructor {
- private final List<Method> preDestroys = new ArrayList<Method>();
-
- public ResourceComponentDestructor(AbstractResource ar) {
- preDestroys.addAll(ar.getPreDestroyMethods());
- }
-
- public void destroy(Object o) throws IllegalAccessException,
- IllegalArgumentException, InvocationTargetException {
- for (Method preDestroy : preDestroys) {
- preDestroy.invoke(o);
- }
- }
- } \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentInjector.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentInjector.java
deleted file mode 100644
index 93cb2171a7e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentInjector.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.spi.component;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractField;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractSetterMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.server.impl.inject.AbstractHttpContextInjectable;
-import com.sun.jersey.spi.inject.Injectable;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderContext;
-import com.sun.jersey.spi.inject.InjectableProviderContext.InjectableScopePair;
-import com.sun.jersey.spi.inject.Errors;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * An injector that injects onto properties of a resource.
- *
- * Analysis of the class will be performed using reflection to find
- * {@link Injectable} instances and as a result the use of reflection is
- * minimized when performing injection.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ResourceComponentInjector {
- private Field[] singletonFields;
- private Object[] singletonFieldValues;
-
- private Field[] perRequestFields;
- private AbstractHttpContextInjectable<?>[] perRequestFieldInjectables;
-
- private Method[] singletonSetters;
- private Object[] singletonSetterValues;
-
- private Method[] perRequestSetters;
- private AbstractHttpContextInjectable<?>[] perRequestSetterInjectables;
-
- /**
- * Create a new resource component injector.
- *
- * @param ipc the injectable provider context to obtain injectables.
- * @param s the scope under which injection will be performed.
- * @param resource the abstract resource model.
- */
- public ResourceComponentInjector(ServerInjectableProviderContext ipc, ComponentScope s, AbstractResource resource) {
- // processFields(ipc, s, resource.getResourceClass());
- processFields(ipc, s, resource.getFields());
- processSetters(ipc, s, resource.getSetterMethods());
- }
-
- /**
- * Ascertain if there are any injectable artifacts to be injected.
- *
- * @return true if there are any injectable artifacts to be injected.
- */
- public boolean hasInjectableArtifacts() {
- return singletonFields.length > 0 || perRequestFields.length > 0 ||
- singletonSetters.length > 0 || perRequestSetters.length > 0;
- }
-
- private void processFields(ServerInjectableProviderContext ipc, ComponentScope s,
- List<AbstractField> fields) {
- Map<Field, Injectable<?>> singletons = new HashMap<Field, Injectable<?>>();
- Map<Field, Injectable<?>> perRequest = new HashMap<Field, Injectable<?>>();
-
- for (AbstractField af : fields) {
- Parameter p = af.getParameters().get(0);
-
- InjectableScopePair isp = ipc.getInjectableiWithScope(af.getField(), p, s);
- if (isp != null) {
- configureField(af.getField());
- if (s == ComponentScope.PerRequest && isp.cs != ComponentScope.Singleton) {
- perRequest.put(af.getField(), isp.i);
- } else {
- singletons.put(af.getField(), isp.i);
- }
- } else if (ipc.isParameterTypeRegistered(p)) {
- // Missing dependency
- Errors.missingDependency(af.getField());
- }
- }
-
- int size = singletons.entrySet().size();
- singletonFields = new Field[size];
- singletonFieldValues = new Object[size];
- int i = 0;
- for (Map.Entry<Field, Injectable<?>> e : singletons.entrySet()) {
- singletonFields[i] = e.getKey();
- singletonFieldValues[i++] = e.getValue().getValue();
- }
-
- size = perRequest.entrySet().size();
- perRequestFields = new Field[size];
- perRequestFieldInjectables = new AbstractHttpContextInjectable<?>[size];
- i = 0;
- for (Map.Entry<Field, Injectable<?>> e : perRequest.entrySet()) {
- perRequestFields[i] = e.getKey();
- perRequestFieldInjectables[i++] = AbstractHttpContextInjectable.transform(e.getValue());
- }
- }
-
- private void configureField(final Field f) {
- if (!f.isAccessible()) {
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- @Override
- public Object run() {
- f.setAccessible(true);
- return null;
- }
- });
- }
- }
-
- private void processSetters(ServerInjectableProviderContext ipc, ComponentScope s,
- List<AbstractSetterMethod> setterMethods) {
- Map<Method, Injectable<?>> singletons = new HashMap<Method, Injectable<?>>();
- Map<Method, Injectable<?>> perRequest = new HashMap<Method, Injectable<?>>();
-
- int methodIndex = 0;
- for (AbstractSetterMethod sm : setterMethods) {
- Parameter p = sm.getParameters().get(0);
-
- InjectableScopePair isp = ipc.getInjectableiWithScope(sm.getMethod(), p, s);
- if (isp != null) {
- if (s == ComponentScope.PerRequest && isp.cs != ComponentScope.Singleton) {
- perRequest.put(sm.getMethod(), isp.i);
- } else {
- singletons.put(sm.getMethod(), isp.i);
- }
- } else if (ipc.isParameterTypeRegistered(p)) {
- // Missing dependency
- Errors.missingDependency(sm.getMethod(), methodIndex);
- }
- methodIndex++;
- }
-
- int size = singletons.entrySet().size();
- singletonSetters = new Method[size];
- singletonSetterValues = new Object[size];
- int i = 0;
- for (Map.Entry<Method, Injectable<?>> e : singletons.entrySet()) {
- singletonSetters[i] = e.getKey();
- singletonSetterValues[i++] = e.getValue().getValue();
- }
-
- size = perRequest.entrySet().size();
- perRequestSetters = new Method[size];
- perRequestSetterInjectables = new AbstractHttpContextInjectable<?>[size];
- i = 0;
- for (Map.Entry<Method, Injectable<?>> e : perRequest.entrySet()) {
- perRequestSetters[i] = e.getKey();
- perRequestSetterInjectables[i++] = AbstractHttpContextInjectable.transform(e.getValue());
- }
- }
-
- /**
- * Inject onto an instance of a resource class.
- *
- * @param c the HTTP context, may be set to null if not available for the
- * current scope.
- * @param o the resource.
- */
- public void inject(HttpContext c, Object o) {
- int i = 0;
- for (Field f : singletonFields) {
- try {
- f.set(o, singletonFieldValues[i++]);
- } catch (IllegalAccessException ex) {
- throw new ContainerException(ex);
- }
- }
-
- i = 0;
- for (Field f : perRequestFields) {
- try {
- f.set(o, perRequestFieldInjectables[i++].getValue(c));
- } catch (IllegalAccessException ex) {
- throw new ContainerException(ex);
- }
- }
-
- i = 0;
- for (Method m : singletonSetters) {
- try {
- m.invoke(o, singletonSetterValues[i++]);
- } catch (Exception ex) {
- throw new ContainerException(ex);
- }
- }
-
- i = 0;
- for (Method m : perRequestSetters) {
- try {
- m.invoke(o, perRequestSetterInjectables[i++].getValue(c));
- } catch (Exception ex) {
- throw new ContainerException(ex);
- }
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProvider.java
deleted file mode 100644
index c2ae4de5869..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProvider.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.spi.component;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.core.spi.component.ComponentProvider;
-import com.sun.jersey.core.spi.component.ComponentScope;
-
-/**
- * A resource class component provider.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ResourceComponentProvider extends ComponentProvider {
-
- /**
- * Initiate the component provider with the resource model.
- *
- * @param abstractResource
- */
- void init(AbstractResource abstractResource);
-
- /**
- * Get the scope.
- *
- * @return the scope.
- */
- ComponentScope getScope();
-
- /**
- * Get the instance.
- *
- * @param hc the HTTP context.
- * @return the instance.
- */
- Object getInstance(HttpContext hc);
-
- /**
- * Destroy the resource component provider.
- */
- void destroy();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.java
deleted file mode 100644
index 949341b72e9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.spi.component;
-
-import com.sun.jersey.core.spi.component.ComponentProviderFactory;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProvider;
-
-/**
- * A resource class component provider factory.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ResourceComponentProviderFactory extends ComponentProviderFactory<ResourceComponentProvider> {
- /**
- * Get the scope of the resource class.
- *
- * @param c the resource class.
- * @return the scope.
- */
- ComponentScope getScope(Class c);
-
- /**
- * Get the resource class component provider.
- *
- * @param icp the underlying IoC component provider.
- * @param c the resource class
- * @return the resource class component provider.
- */
- ResourceComponentProvider getComponentProvider(IoCComponentProvider icp, Class<?> c);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.java
deleted file mode 100644
index 5a3c6498cb3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.spi.component;
-
-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;
-
-/**
- * Specifies the resource component provider that is used to obtain an
- * instance of the resource class. Omission of this annotation
- * will result in the default provider being used.
- *
- * @see ResourceComponentProvider
- */
-@Target({ElementType.ANNOTATION_TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface ResourceComponentProviderFactoryClass {
- /**
- * The class of the resource component provider that is used to obtain an
- * instance of the resource class. The specified class must implement
- * {@link ResourceComponentProvider}.
- *
- * @return the resource component provider class.
- */
- public Class<? extends ResourceComponentProviderFactory> value();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/package-info.java
deleted file mode 100644
index 00661efcc78..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/spi/component/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for components that are resource classes.
- */
-package com.sun.jersey.server.spi.component; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlApplicationContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlApplicationContext.java
deleted file mode 100644
index 3a56ecb465b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlApplicationContext.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.wadl;
-
-import com.sun.research.ws.wadl.Application;
-import javax.ws.rs.core.UriInfo;
-import javax.xml.bind.JAXBContext;
-
-/**
- * A context to obtain WADL-based information.
- *
- * @author Paul.Sandoz
- */
-public interface WadlApplicationContext {
- /**
- * Get a WADL builder initiated with the configured {@link WadlGenerator}
- * for the Web application.
- *
- * @return the WADL builder.
- */
- WadlBuilder getWadlBuilder();
-
- /**
- * Get a new instance of a JAXB WADL {@link Application} corresponding to all
- * the root resource classes.
- *
- * @return the application, the contents may be modified.
- */
- Application getApplication();
-
- /**
- * Get a new instance of a JAXB WADL {@link Application} corresponding to all
- * the root resource classes, and configure the base URI.
- *
- * @param ui the URI information from which the base URI is set on the
- * WADL application.
- * @return the application, the contents may be modified.
- */
- Application getApplication(UriInfo ui);
-
- /**
- * Get the default JAXB context associated with the {@link WadlGenerator}
- * for the Web application.
- *
- * @return the default JAXB context.
- */
- JAXBContext getJAXBContext();
-
- /**
- * Get the default JAXB context path to create a {@link JAXBContext}.
- *
- * @return the default JAXB context.
- */
- String getJAXBContextPath();
-
- /**
- * Enable/disable WADL generation.
- *
- * @param wadlGenerationEnabled if wadlGenerationEnabled is true and
- * {@link com.sun.jersey.api.core.ResourceConfig#FEATURE_DISABLE_WADL}
- * is false, WADL generation is enabled. In all other cases is disabled.
- */
- void setWadlGenerationEnabled(boolean wadlGenerationEnabled);
-
- /**
- * Get WADL generation status.
- *
- * @return true when WADL generation is enabled. Does not take
- * {@link com.sun.jersey.api.core.ResourceConfig#FEATURE_DISABLE_WADL}
- */
- boolean isWadlGenerationEnabled();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlBuilder.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlBuilder.java
deleted file mode 100644
index ec758ad97a4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlBuilder.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.model.AbstractSubResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.model.Parameterized;
-import com.sun.jersey.server.impl.BuildId;
-import com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller;
-import com.sun.research.ws.wadl.Application;
-import com.sun.research.ws.wadl.Doc;
-import com.sun.research.ws.wadl.Param;
-import com.sun.research.ws.wadl.ParamStyle;
-import com.sun.research.ws.wadl.RepresentationType;
-import com.sun.research.ws.wadl.Request;
-import com.sun.research.ws.wadl.Resource;
-import com.sun.research.ws.wadl.Resources;
-import com.sun.research.ws.wadl.Response;
-
-import javax.ws.rs.FormParam;
-import javax.ws.rs.core.MediaType;
-import javax.xml.namespace.QName;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * This class implements the algorithm how the wadl is built for one or more
- * {@link AbstractResource} classes. Wadl artifacts are created by a
- * {@link WadlGenerator}.
- * Created on: Jun 18, 2008<br>
- *
- * @author Marc Hadley
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-public class WadlBuilder {
-
- private WadlGenerator _wadlGenerator;
-
- public WadlBuilder() {
- this(new WadlGeneratorImpl());
- }
-
- public WadlBuilder(WadlGenerator wadlGenerator) {
- _wadlGenerator = wadlGenerator;
- }
-
- /**
- * Generate WADL for a set of resources.
- * @param resources the set of resources
- * @return the JAXB WADL application bean
- */
- public Application generate(Set<AbstractResource> resources) {
- Application wadlApplication = _wadlGenerator.createApplication();
- Resources wadlResources = _wadlGenerator.createResources();
-
- // for each resource
- for (AbstractResource r : resources) {
- Resource wadlResource = generateResource(r, null);
- wadlResources.getResource().add(wadlResource);
- }
- wadlApplication.setResources(wadlResources);
-
- addVersion(wadlApplication);
- return wadlApplication;
- }
-
- /**
- * Generate WADL for a resource.
- * @param resource the resource
- * @return the JAXB WADL application bean
- */
- public Application generate(AbstractResource resource) {
- Application wadlApplication = _wadlGenerator.createApplication();
- Resources wadlResources = _wadlGenerator.createResources();
- Resource wadlResource = generateResource(resource, null);
- wadlResources.getResource().add(wadlResource);
- wadlApplication.setResources(wadlResources);
-
- addVersion(wadlApplication);
- return wadlApplication;
- }
-
- /**
- * Generate WADL for a virtual subresource resulting from sub resource
- * methods.
- * @param resource the parent resource
- * @param path the value of the methods path annotations
- * @return the JAXB WADL application bean
- */
- public Application generate(AbstractResource resource, String path) {
- Application wadlApplication = _wadlGenerator.createApplication();
- Resources wadlResources = _wadlGenerator.createResources();
- Resource wadlResource = generateSubResource(resource, path);
- wadlResources.getResource().add(wadlResource);
- wadlApplication.setResources(wadlResources);
-
- addVersion(wadlApplication);
- return wadlApplication;
- }
-
- private void addVersion(Application wadlApplication) {
- // Include Jersey version as doc element with generatedBy attribute
- Doc d = new Doc();
- d.getOtherAttributes().put(new QName("http://jersey.java.net/", "generatedBy", "jersey"),
- BuildId.getBuildId());
- wadlApplication.getDoc().add(0, d);
- }
-
- private com.sun.research.ws.wadl.Method generateMethod(AbstractResource r, final Map<String, Param> wadlResourceParams, final AbstractResourceMethod m) {
- com.sun.research.ws.wadl.Method wadlMethod = _wadlGenerator.createMethod(r, m);
- // generate the request part
- Request wadlRequest = generateRequest(r, m, wadlResourceParams);
- if (wadlRequest != null) {
- wadlMethod.setRequest(wadlRequest);
- }
- // generate the response part
- Response wadlResponse = generateResponse(r, m);
- if (wadlResponse != null) {
- wadlMethod.setResponse(wadlResponse);
- }
- return wadlMethod;
- }
-
- private Request generateRequest(AbstractResource r, final AbstractResourceMethod m,
- Map<String, Param> wadlResourceParams) {
- if (m.getParameters().isEmpty()) {
- return null;
- }
-
- Request wadlRequest = _wadlGenerator.createRequest(r, m);
-
- for (Parameter p : m.getParameters()) {
- if (p.getSource() == Parameter.Source.ENTITY) {
- for (MediaType mediaType : m.getSupportedInputTypes()) {
- setRepresentationForMediaType(r, m, mediaType, wadlRequest);
- }
- } else if (p.getAnnotation().annotationType() == FormParam.class) {
- // Use application/x-www-form-urlencoded if no @Consumes
- List<MediaType> supportedInputTypes = m.getSupportedInputTypes();
- if (supportedInputTypes.isEmpty()
- || (supportedInputTypes.size() == 1 && supportedInputTypes.get(0).isWildcardType())) {
- supportedInputTypes = Collections.singletonList(MediaType.APPLICATION_FORM_URLENCODED_TYPE);
- }
-
- for (MediaType mediaType : supportedInputTypes) {
- final RepresentationType wadlRepresentation = setRepresentationForMediaType(r, m, mediaType, wadlRequest);
- if (getParamByName(wadlRepresentation.getParam(), p.getSourceName()) == null) {
- final Param wadlParam = generateParam(r, m, p);
- if (wadlParam != null) {
- wadlRepresentation.getParam().add(wadlParam);
- }
- }
- }
- } else {
- Param wadlParam = generateParam(r, m, p);
- if (wadlParam == null) {
- continue;
- }
- if (wadlParam.getStyle() == ParamStyle.TEMPLATE) {
- wadlResourceParams.put(wadlParam.getName(), wadlParam);
- } else {
- wadlRequest.getParam().add(wadlParam);
- }
- }
- }
- if (wadlRequest.getRepresentation().size() + wadlRequest.getParam().size() == 0) {
- return null;
- } else {
- return wadlRequest;
- }
- }
-
- private Param getParamByName(final List<Param> params, final String name) {
- for (Param param : params) {
- if (param.getName().equals(name)) {
- return param;
- }
- }
- return null;
- }
-
- /**
- * Create the wadl {@link RepresentationType} for the specified {@link MediaType} if not yet
- * existing for the wadl {@link Request} and return it.
- * @param r the resource
- * @param m the resource method
- * @param mediaType an accepted media type of the resource method
- * @param wadlRequest the wadl request the wadl representation is to be created for (if not yet existing).
- * @author Martin Grotzke
- * @return the wadl request representation for the specified {@link MediaType}.
- */
- private RepresentationType setRepresentationForMediaType(AbstractResource r,
- final AbstractResourceMethod m, MediaType mediaType,
- Request wadlRequest) {
- RepresentationType wadlRepresentation = getRepresentationByMediaType(wadlRequest.getRepresentation(), mediaType);
- if (wadlRepresentation == null) {
- wadlRepresentation = _wadlGenerator.createRequestRepresentation(r, m, mediaType);
- wadlRequest.getRepresentation().add(wadlRepresentation);
- }
- return wadlRepresentation;
- }
-
- private RepresentationType getRepresentationByMediaType(
- final List<RepresentationType> representations, MediaType mediaType) {
- for (RepresentationType representation : representations) {
- if (mediaType.toString().equals(representation.getMediaType())) {
- return representation;
- }
- }
- return null;
- }
-
- private Param generateParam(AbstractResource r, AbstractMethod m, final Parameter p) {
- if (p.getSource() == Parameter.Source.ENTITY || p.getSource() == Parameter.Source.CONTEXT) {
- return null;
- }
- Param wadlParam = _wadlGenerator.createParam(r, m, p);
- return wadlParam;
- }
-
- private Resource generateResource(AbstractResource r, String path) {
- return generateResource(r, path, Collections.<Class<?>>emptySet());
- }
-
- private Resource generateResource(AbstractResource r, String path, Set<Class<?>> visitedClasses) {
- Resource wadlResource = _wadlGenerator.createResource(r, path);
-
- // prevent infinite recursion
- if (visitedClasses.contains(r.getResourceClass())) {
- return wadlResource;
- } else {
- visitedClasses = new HashSet<Class<?>>(visitedClasses);
- visitedClasses.add(r.getResourceClass());
- }
-
- Map<String, Param> wadlResourceParams = new HashMap<String, Param>();
-
- // add resource field/setter parameters that are associated with the resource PATH template
-
- List<Parameterized> fieldsOrSetters = new LinkedList<Parameterized>();
-
- if (r.getFields() != null) {
- fieldsOrSetters.addAll(r.getFields());
- }
- if (r.getSetterMethods() != null) {
- fieldsOrSetters.addAll(r.getSetterMethods());
- }
-
- for (Parameterized f : fieldsOrSetters) {
- for (Parameter fp : f.getParameters()) {
- Param wadlParam = generateParam(r, null, fp);
- if (wadlParam != null) {
- wadlResource.getParam().add(wadlParam);
- }
- }
- }
- // for each resource method
- for (AbstractResourceMethod m : r.getResourceMethods()) {
- com.sun.research.ws.wadl.Method wadlMethod = generateMethod(r, wadlResourceParams, m);
- wadlResource.getMethodOrResource().add(wadlMethod);
- }
- // add method parameters that are associated with the resource PATH template
- for (Param wadlParam : wadlResourceParams.values()) {
- wadlResource.getParam().add(wadlParam);
- }
-
- // for each sub-resource method
- Map<String, Resource> wadlSubResources = new HashMap<String, Resource>();
- Map<String, Map<String, Param>> wadlSubResourcesParams =
- new HashMap<String, Map<String, Param>>();
- for (AbstractSubResourceMethod m : r.getSubResourceMethods()) {
- // find or create sub resource for uri template
- String template = m.getPath().getValue();
- Resource wadlSubResource = wadlSubResources.get(template);
- Map<String, Param> wadlSubResourceParams = wadlSubResourcesParams.get(template);
- if (wadlSubResource == null) {
- wadlSubResource = new Resource();
- wadlSubResource.setPath(template);
- wadlSubResources.put(template, wadlSubResource);
- wadlSubResourceParams = new HashMap<String, Param>();
- wadlSubResourcesParams.put(template, wadlSubResourceParams);
- wadlResource.getMethodOrResource().add(wadlSubResource);
- }
- com.sun.research.ws.wadl.Method wadlMethod = generateMethod(r, wadlSubResourceParams, m);
- wadlSubResource.getMethodOrResource().add(wadlMethod);
- }
- // add parameters that are associated with each sub-resource method PATH template
- for (Map.Entry<String, Resource> e : wadlSubResources.entrySet()) {
- String template = e.getKey();
- Resource wadlSubResource = e.getValue();
- Map<String, Param> wadlSubResourceParams = wadlSubResourcesParams.get(template);
- for (Param wadlParam : wadlSubResourceParams.values()) {
- wadlSubResource.getParam().add(wadlParam);
- }
- }
-
- // for each sub resource locator
- for (AbstractSubResourceLocator l : r.getSubResourceLocators()) {
- AbstractResource subResource = IntrospectionModeller.createResource(
- l.getMethod().getReturnType());
- Resource wadlSubResource = generateResource(subResource,
- l.getPath().getValue(), visitedClasses);
- wadlResource.getMethodOrResource().add(wadlSubResource);
-
- for (Parameter p : l.getParameters()) {
- Param wadlParam = generateParam(r, l, p);
- if (wadlParam != null && wadlParam.getStyle() == ParamStyle.TEMPLATE) {
- wadlSubResource.getParam().add(wadlParam);
- }
- }
- }
- return wadlResource;
- }
-
- private Resource generateSubResource(AbstractResource r, String path) {
- Resource wadlResource = new Resource();
- if (r.isRootResource()) {
- StringBuilder b = new StringBuilder(r.getPath().getValue());
- if (!(r.getPath().getValue().endsWith("/") || path.startsWith("/"))) {
- b.append("/");
- }
- b.append(path);
- wadlResource.setPath(b.toString());
- }
- // for each sub-resource method
- Map<String, Param> wadlSubResourceParams = new HashMap<String, Param>();
- for (AbstractSubResourceMethod m : r.getSubResourceMethods()) {
- // find or create sub resource for uri template
- String template = m.getPath().getValue();
- if (!template.equals(path)) {
- continue;
- }
- com.sun.research.ws.wadl.Method wadlMethod = generateMethod(r, wadlSubResourceParams, m);
- wadlResource.getMethodOrResource().add(wadlMethod);
- }
- // add parameters that are associated with each sub-resource method PATH template
- for (Param wadlParam : wadlSubResourceParams.values()) {
- wadlResource.getParam().add(wadlParam);
- }
-
- return wadlResource;
- }
-
- private Response generateResponse(AbstractResource r, final AbstractResourceMethod m) {
- if (m.getMethod().getReturnType() == void.class) {
- return null;
- }
- Response wadlResponse = _wadlGenerator.createResponse(r, m);
- return wadlResponse;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGenerator.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGenerator.java
deleted file mode 100644
index 8fe8c3dfd80..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGenerator.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.wadl;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import javax.ws.rs.core.MediaType;
-import javax.xml.bind.annotation.XmlRegistry;
-
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.research.ws.wadl.Application;
-import com.sun.research.ws.wadl.Param;
-import com.sun.research.ws.wadl.RepresentationType;
-import com.sun.research.ws.wadl.Request;
-import com.sun.research.ws.wadl.Resource;
-import com.sun.research.ws.wadl.Resources;
-import com.sun.research.ws.wadl.Response;
-
-
-/**
- * A WadlGenerator creates artifacts related to wadl. This is designed as an interface,
- * so that several implementations can decorate existing ones. One decorator could e.g. add
- * references to definitions within some xsd for existing representations.<br>
- * Created on: Jun 16, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-public interface WadlGenerator {
-
- /**
- * Sets the delegate that is decorated by this wadl generator. Is invoked directly after
- * this generator is instantiated before {@link #init()} or any setter method is invoked.
- * @param delegate the wadl generator to decorate
- */
- void setWadlGeneratorDelegate( WadlGenerator delegate );
-
- /**
- * Invoked before all methods related to wadl-building are invoked. This method is used in a
- * decorator like manner, and therefore has to invoke <code>this.delegate.init()</code>.
- * @throws Exception
- */
- void init() throws Exception;
-
- /**
- * The jaxb context path that is used when the generated wadl application is marshalled
- * to a file.<br/>
- * This method is used in a decorator like manner.<br/>
- * The result return the path (or a colon-separated list of package names) containing
- * jaxb-beans that are added to wadl elements by this WadlGenerator, additionally to
- * the context path of the decorated WadlGenerator (set by {@link #setWadlGeneratorDelegate(WadlGenerator)}.<br/>
- * If you do not use custom jaxb beans, then simply return <code>_delegate.getRequiredJaxbContextPath()</code>,
- * otherwise return the delegate's {@link #getRequiredJaxbContextPath()} together with
- * your required context path (separated by a colon):<br/>
- * <pre><code>_delegate.getRequiredJaxbContextPath() == null
- ? ${yourContextPath}
- : _delegate.getRequiredJaxbContextPath() + ":" + ${yourContextPath};</code></pre>
- *
- * If you add the path for your custom jaxb beans, don't forget to add an
- * ObjectFactory (annotated with {@link XmlRegistry}) to this package.
- * @return simply the {@link #getRequiredJaxbContextPath()} of the delegate or the
- * {@link #getRequiredJaxbContextPath()} + ":" + ${yourContextPath}.
- */
- String getRequiredJaxbContextPath();
-
- // ================ methods for building the wadl application =============
-
- public Application createApplication();
-
- public Resources createResources();
-
- public Resource createResource(AbstractResource r,
- String path);
-
- public com.sun.research.ws.wadl.Method createMethod(AbstractResource r,
- AbstractResourceMethod m);
-
- public Request createRequest(AbstractResource r,
- AbstractResourceMethod m);
-
- public RepresentationType createRequestRepresentation(AbstractResource r,
- AbstractResourceMethod m,
- MediaType mediaType);
-
- public Response createResponse(AbstractResource r,
- AbstractResourceMethod m);
-
- public Param createParam(AbstractResource r,
- AbstractMethod m,
- Parameter p);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGeneratorImpl.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGeneratorImpl.java
deleted file mode 100644
index b3e470248ea..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/WadlGeneratorImpl.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.server.wadl;
-
-import com.sun.jersey.api.model.AbstractMethod;
-
-import javax.ws.rs.FormParam;
-import javax.ws.rs.core.MediaType;
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.research.ws.wadl.Application;
-import com.sun.research.ws.wadl.Param;
-import com.sun.research.ws.wadl.ParamStyle;
-import com.sun.research.ws.wadl.RepresentationType;
-import com.sun.research.ws.wadl.Request;
-import com.sun.research.ws.wadl.Resource;
-import com.sun.research.ws.wadl.Resources;
-import com.sun.research.ws.wadl.Response;
-
-/**
- * This WadlGenerator creates the basic wadl artifacts.<br>
- * Created on: Jun 16, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-public class WadlGeneratorImpl implements WadlGenerator {
-
- @Override
- public String getRequiredJaxbContextPath() {
- final String name = Application.class.getName();
- return name.substring(0, name.lastIndexOf('.'));
- }
-
- @Override
- public void init() throws Exception {
- }
-
- @Override
- public void setWadlGeneratorDelegate( WadlGenerator delegate ) {
- throw new UnsupportedOperationException( "No delegate supported." );
- }
-
- @Override
- public Resources createResources() {
- return new Resources();
- }
-
- @Override
- public Application createApplication() {
- return new Application();
- }
-
- @Override
- public com.sun.research.ws.wadl.Method createMethod(
- AbstractResource r, final AbstractResourceMethod m ) {
- com.sun.research.ws.wadl.Method wadlMethod =
- new com.sun.research.ws.wadl.Method();
- wadlMethod.setName(m.getHttpMethod());
- wadlMethod.setId( m.getMethod().getName() );
- return wadlMethod;
- }
-
- @Override
- public RepresentationType createRequestRepresentation( AbstractResource r, AbstractResourceMethod m, MediaType mediaType ) {
- RepresentationType wadlRepresentation = new RepresentationType();
- wadlRepresentation.setMediaType(mediaType.toString());
- return wadlRepresentation;
- }
-
- @Override
- public Request createRequest(AbstractResource r, AbstractResourceMethod m) {
- return new Request();
- }
-
- @Override
- public Param createParam( AbstractResource r, AbstractMethod m, final Parameter p ) {
- if (p.getSource() == Parameter.Source.UNKNOWN)
- return null;
-
- Param wadlParam = new Param();
- wadlParam.setName(p.getSourceName());
-
- switch (p.getSource()) {
- case FORM:
- wadlParam.setStyle(ParamStyle.QUERY);
- break;
- case QUERY:
- wadlParam.setStyle(ParamStyle.QUERY);
- break;
- case MATRIX:
- wadlParam.setStyle(ParamStyle.MATRIX);
- break;
- case PATH:
- wadlParam.setStyle(ParamStyle.TEMPLATE);
- break;
- case HEADER:
- wadlParam.setStyle(ParamStyle.HEADER);
- break;
- case COOKIE:
- // Generates name="Cookie" path="<name>"
- wadlParam.setStyle(ParamStyle.HEADER);
- wadlParam.setName("Cookie");
- wadlParam.setPath(p.getSourceName());
- break;
- default:
- break;
- }
-
- if (p.hasDefaultValue())
- wadlParam.setDefault(p.getDefaultValue());
- Class<?> pClass = p.getParameterClass();
- if (pClass.isArray()) {
- wadlParam.setRepeating(true);
- pClass = pClass.getComponentType();
- }
- if (pClass.equals(int.class) || pClass.equals(Integer.class))
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "int", "xs"));
- else if (pClass.equals(boolean.class) || pClass.equals(Boolean.class))
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "boolean", "xs"));
- else if (pClass.equals(long.class) || pClass.equals(Long.class))
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "long", "xs"));
- else if (pClass.equals(short.class) || pClass.equals(Short.class))
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "short", "xs"));
- else if (pClass.equals(byte.class) || pClass.equals(Byte.class))
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "byte", "xs"));
- else if (pClass.equals(float.class) || pClass.equals(Float.class))
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "float", "xs"));
- else if (pClass.equals(double.class) || pClass.equals(Double.class))
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "double", "xs"));
- else
- wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "string", "xs"));
- return wadlParam;
- }
-
- @Override
- public Resource createResource( AbstractResource r, String path ) {
- Resource wadlResource = new Resource();
- if (path != null)
- wadlResource.setPath(path);
- else if (r.isRootResource())
- wadlResource.setPath(r.getPath().getValue());
- return wadlResource;
- }
-
- @Override
- public Response createResponse( AbstractResource r, AbstractResourceMethod m ) {
- final Response response = new Response();
-
- for (MediaType mediaType: m.getSupportedOutputTypes()) {
- RepresentationType wadlRepresentation = createResponseRepresentation( r, m, mediaType );
- JAXBElement<RepresentationType> element = new JAXBElement<RepresentationType>(
- new QName("http://research.sun.com/wadl/2006/10","representation"),
- RepresentationType.class,
- wadlRepresentation);
- response.getRepresentationOrFault().add(element);
- }
-
- return response;
- }
-
- public RepresentationType createResponseRepresentation( AbstractResource r, AbstractResourceMethod m, MediaType mediaType ) {
- RepresentationType wadlRepresentation = new RepresentationType();
- wadlRepresentation.setMediaType(mediaType.toString());
- return wadlRepresentation;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ApplicationDocs.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ApplicationDocs.java
deleted file mode 100644
index 0dfc7aaebac..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ApplicationDocs.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-import com.sun.research.ws.wadl.Doc;
-
-/**
- * The wrapper root document for multiple {@link Doc} elements.
- * Created on: Jun 10, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: ApplicationDocs.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "applicationDocs", propOrder = {
- "docs"
-})
-@XmlRootElement(name = "applicationDocs")
-public class ApplicationDocs {
-
- @XmlElement(name = "doc" )
- protected List<Doc> docs;
-
- public List<Doc> getDocs() {
- if (docs == null) {
- docs = new ArrayList<Doc>();
- }
- return this.docs;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ObjectFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ObjectFactory.java
deleted file mode 100644
index 13246252e89..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/ObjectFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators;
-
-import javax.xml.bind.annotation.XmlRegistry;
-
-/**
- * The object factory for application docs jaxb bindings.<br>
- * Created on: Jun 17, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlRegistry
-public class ObjectFactory {
-
- public ApplicationDocs createApplicationDocs() {
- return new ApplicationDocs();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.java
deleted file mode 100644
index 6683b60c96f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.ws.rs.core.MediaType;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.wadl.config.WadlGeneratorConfig;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.research.ws.wadl.Application;
-import com.sun.research.ws.wadl.Method;
-import com.sun.research.ws.wadl.Param;
-import com.sun.research.ws.wadl.RepresentationType;
-import com.sun.research.ws.wadl.Request;
-import com.sun.research.ws.wadl.Resource;
-import com.sun.research.ws.wadl.Resources;
-import com.sun.research.ws.wadl.Response;
-
-/**
- * This {@link WadlGenerator} adds all doc elements provided by {@link ApplicationDocs#getDocs()}
- * to the generated wadl-file.
- * <p>
- * The {@link ApplicationDocs} content can either be provided via a {@link File} reference
- * ({@link #setApplicationDocsFile(File)}) or
- * via an {@link InputStream} ({@link #setApplicationDocsStream(InputStream)}).
- * </p>
- * <p>
- * The {@link File} should be used when using the maven-wadl-plugin for generating wadl offline,
- * the {@link InputStream} should be used when the extended wadl is generated by jersey at runtime, e.g.
- * using the {@link WadlGeneratorConfig} for configuration.
- * </p>
- *
- * Created on: Jun 16, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: WadlGeneratorApplicationDoc.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-public class WadlGeneratorApplicationDoc implements WadlGenerator {
-
- private WadlGenerator _delegate;
- private File _applicationDocsFile;
- private InputStream _applicationDocsStream;
- private ApplicationDocs _applicationDocs;
-
- public WadlGeneratorApplicationDoc() {
- }
-
- public WadlGeneratorApplicationDoc(WadlGenerator wadlGenerator, ApplicationDocs applicationDocs) {
- _delegate = wadlGenerator;
- _applicationDocs = applicationDocs;
- }
-
- public void setWadlGeneratorDelegate(WadlGenerator delegate) {
- _delegate = delegate;
- }
-
- public String getRequiredJaxbContextPath() {
- return _delegate.getRequiredJaxbContextPath();
- }
-
- public void setApplicationDocsFile(File applicationDocsFile) {
- if ( _applicationDocsStream != null ) {
- throw new IllegalStateException( "The applicationDocsStream property is already set," +
- " therefore you cannot set the applicationDocsFile property. Only one of both can be set at a time." );
- }
- _applicationDocsFile = applicationDocsFile;
- }
-
- public void setApplicationDocsStream(InputStream applicationDocsStream) {
- if ( _applicationDocsFile != null ) {
- throw new IllegalStateException( "The applicationDocsFile property is already set," +
- " therefore you cannot set the applicationDocsStream property. Only one of both can be set at a time." );
- }
- _applicationDocsStream = applicationDocsStream;
- }
-
- public void init() throws Exception {
- if ( _applicationDocsFile == null && _applicationDocsStream == null ) {
- throw new IllegalStateException( "Neither the applicationDocsFile nor the applicationDocsStream" +
- " is set, one of both is required." );
- }
- _delegate.init();
- String name = ApplicationDocs.class.getName();
- final int i = name.lastIndexOf('.');
- name = (i != -1) ? name.substring(0, i) : "";
- final JAXBContext c = JAXBContext.newInstance(name,
- Thread.currentThread().getContextClassLoader());
- final Unmarshaller m = c.createUnmarshaller();
- final Object obj = _applicationDocsFile != null
- ? m.unmarshal( _applicationDocsFile ) : m.unmarshal( _applicationDocsStream );
- _applicationDocs = ApplicationDocs.class.cast(obj);
- }
-
- /**
- * @return the application
- * @see com.sun.jersey.server.wadl.WadlGenerator#createApplication()
- */
- public Application createApplication() {
- final Application result = _delegate.createApplication();
- if (_applicationDocs != null && _applicationDocs.getDocs() != null &&
- !_applicationDocs.getDocs().isEmpty()) {
- result.getDoc().addAll(_applicationDocs.getDocs());
- }
- return result;
- }
-
- /**
- * @param r
- * @param m
- * @return the method
- * @see com.sun.jersey.server.wadl.WadlGenerator#createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Method createMethod(AbstractResource r, AbstractResourceMethod m) {
- return _delegate.createMethod(r, m);
- }
-
- /**
- * @param r
- * @param m
- * @param mediaType
- * @return representation type
- * @see com.sun.jersey.server.wadl.WadlGenerator#createRequestRepresentation(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod, javax.ws.rs.core.MediaType)
- */
- public RepresentationType createRequestRepresentation(AbstractResource r,
- AbstractResourceMethod m, MediaType mediaType) {
- return _delegate.createRequestRepresentation(r, m, mediaType);
- }
-
- /**
- * @param r
- * @param m
- * @return request
- * @see com.sun.jersey.server.wadl.WadlGenerator#createRequest(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Request createRequest(AbstractResource r, AbstractResourceMethod m) {
- return _delegate.createRequest(r, m);
- }
-
- /**
- * @param r
- * @param m
- * @param p
- * @return parameter
- * @see com.sun.jersey.server.wadl.WadlGenerator#createParam(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractMethod, com.sun.jersey.api.model.Parameter)
- */
- public Param createParam(AbstractResource r,
- AbstractMethod m, Parameter p) {
- return _delegate.createParam(r, m, p);
- }
-
- /**
- * @param r
- * @param path
- * @return resource
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResource(com.sun.jersey.api.model.AbstractResource, java.lang.String)
- */
- public Resource createResource(AbstractResource r, String path) {
- return _delegate.createResource(r, path);
- }
-
- /**
- * @param r
- * @param m
- * @return response
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResponse(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Response createResponse(AbstractResource r, AbstractResourceMethod m) {
- return _delegate.createResponse(r, m);
- }
-
- /**
- * @return resources
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResources()
- */
- public Resources createResources() {
- return _delegate.createResources();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.java
deleted file mode 100644
index 207477c5f91..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.logging.Logger;
-
-import javax.ws.rs.core.MediaType;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.wadl.config.WadlGeneratorConfig;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.research.ws.wadl.Application;
-import com.sun.research.ws.wadl.Grammars;
-import com.sun.research.ws.wadl.Method;
-import com.sun.research.ws.wadl.Param;
-import com.sun.research.ws.wadl.RepresentationType;
-import com.sun.research.ws.wadl.Request;
-import com.sun.research.ws.wadl.Resource;
-import com.sun.research.ws.wadl.Resources;
-import com.sun.research.ws.wadl.Response;
-
-/**
- * This {@link WadlGenerator} adds the provided {@link Grammars} element to the
- * generated wadl-file.
- * <p>
- * The {@link Grammars} content can either be provided via a {@link File} ({@link #setGrammarsFile(File)}) reference or
- * via an {@link InputStream} ({@link #setGrammarsStream(InputStream)}).
- * </p>
- * <p>
- * The {@link File} should be used when using the maven-wadl-plugin for generating wadl offline,
- * the {@link InputStream} should be used when the extended wadl is generated by jersey at runtime, e.g.
- * using the {@link WadlGeneratorConfig} for configuration.
- * </p>
- * Created on: Jun 24, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: WadlGeneratorGrammarsSupport.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-public class WadlGeneratorGrammarsSupport implements WadlGenerator {
-
- private static final Logger LOG = Logger.getLogger( WadlGeneratorGrammarsSupport.class.getName() );
-
- private WadlGenerator _delegate;
- private File _grammarsFile;
- private InputStream _grammarsStream;
- private Grammars _grammars;
-
- public WadlGeneratorGrammarsSupport() {
- }
-
- public WadlGeneratorGrammarsSupport( WadlGenerator delegate,
- Grammars grammars ) {
- _delegate = delegate;
- _grammars = grammars;
- }
-
- public void setWadlGeneratorDelegate( WadlGenerator delegate ) {
- _delegate = delegate;
- }
-
- public String getRequiredJaxbContextPath() {
- return _delegate.getRequiredJaxbContextPath();
- }
-
- public void setGrammarsFile( File grammarsFile ) {
- if ( _grammarsStream != null ) {
- throw new IllegalStateException( "The grammarsStream property is already set," +
- " therefore you cannot set the grammarsFile property. Only one of both can be set at a time." );
- }
- _grammarsFile = grammarsFile;
- }
-
- public void setGrammarsStream( InputStream grammarsStream ) {
- if ( _grammarsFile != null ) {
- throw new IllegalStateException( "The grammarsFile property is already set," +
- " therefore you cannot set the grammarsStream property. Only one of both can be set at a time." );
- }
- _grammarsStream = grammarsStream;
- }
-
- public void init() throws Exception {
- if ( _grammarsFile == null && _grammarsStream == null ) {
- throw new IllegalStateException( "Neither the grammarsFile nor the grammarsStream" +
- " is set, one of both is required." );
- }
- _delegate.init();
- final JAXBContext c = JAXBContext.newInstance( Grammars.class );
- final Unmarshaller m = c.createUnmarshaller();
- final Object obj = _grammarsFile != null ? m.unmarshal( _grammarsFile ) : m.unmarshal( _grammarsStream );
- _grammars = Grammars.class.cast( obj );
- }
-
- private <T> T loadFile( InputStream fileToLoad, Class<T> targetClass ) throws JAXBException {
- final JAXBContext c = JAXBContext.newInstance( targetClass );
- final Unmarshaller m = c.createUnmarshaller();
- return targetClass.cast( m.unmarshal( fileToLoad ) );
- }
-
- /**
- * @return application
- * @see com.sun.jersey.server.wadl.WadlGenerator#createApplication()
- */
- public Application createApplication() {
- final Application result = _delegate.createApplication();
- if ( result.getGrammars() != null ) {
- LOG.info( "The wadl application created by the delegate ("+ _delegate +") already contains a grammars element," +
- " we're adding elements of the provided grammars file." );
- if ( !_grammars.getAny().isEmpty() ) {
- result.getGrammars().getAny().addAll( _grammars.getAny() );
- }
- if ( !_grammars.getDoc().isEmpty() ) {
- result.getGrammars().getDoc().addAll( _grammars.getDoc() );
- }
- if ( !_grammars.getInclude().isEmpty() ) {
- result.getGrammars().getInclude().addAll( _grammars.getInclude() );
- }
- }
- else {
- result.setGrammars( _grammars );
- }
- return result;
- }
-
- /**
- * @param ar abstract resource
- * @param arm abstract resource method
- * @return method
- * @see com.sun.jersey.server.wadl.WadlGenerator#createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Method createMethod( AbstractResource ar,
- AbstractResourceMethod arm ) {
- return _delegate.createMethod( ar, arm );
- }
-
- /**
- * @param ar abstract resource
- * @param arm abstract resource method
- * @return request
- * @see com.sun.jersey.server.wadl.WadlGenerator#createRequest(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Request createRequest( AbstractResource ar,
- AbstractResourceMethod arm ) {
- return _delegate.createRequest( ar, arm );
- }
-
- /**
- * @param ar abstract resource
- * @param am abstract method
- * @param p parameter
- * @return parameter
- * @see com.sun.jersey.server.wadl.WadlGenerator#createParam(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractMethod, com.sun.jersey.api.model.Parameter)
- */
- public Param createParam( AbstractResource ar,
- AbstractMethod am, Parameter p ) {
- return _delegate.createParam( ar, am, p );
- }
-
- /**
- * @param ar abstract resource
- * @param arm abstract resource method
- * @param mt media type
- * @return respresentation type
- * @see com.sun.jersey.server.wadl.WadlGenerator#createRequestRepresentation(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod, javax.ws.rs.core.MediaType)
- */
- public RepresentationType createRequestRepresentation(
- AbstractResource ar, AbstractResourceMethod arm, MediaType mt ) {
- return _delegate.createRequestRepresentation( ar, arm, mt );
- }
-
- /**
- * @param ar abstract resource
- * @param path
- * @return resource
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResource(com.sun.jersey.api.model.AbstractResource, java.lang.String)
- */
- public Resource createResource( AbstractResource ar, String path ) {
- return _delegate.createResource( ar, path );
- }
-
- /**
- * @return resources
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResources()
- */
- public Resources createResources() {
- return _delegate.createResources();
- }
-
- /**
- * @param ar abstract resource
- * @param arm abstract resource method
- * @return response
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResponse(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Response createResponse( AbstractResource ar,
- AbstractResourceMethod arm ) {
- return _delegate.createResponse( ar, arm );
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/package-info.java
deleted file mode 100644
index 8eeabaaa094..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/package-info.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for JAXB WADL generation.
- * <p>
- * The different {@link com.sun.jersey.server.wadl.WadlGenerator} implementations
- * provide the possibility to add some content stored in a file to the generated wadl.
- * </p>
- * <p>
- * The content can either be provided via a {@link java.io.File} reference,
- * or via a resource that will be read as an {@link java.io.InputStream}.
- * </p>
- * <p>
- * The {@link java.io.File} reference is appropriate when generating wadl offline,
- * e.g. with the help of the
- * <a href="https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/contribs/maven-wadl-plugin/">maven-wadl-plugin</a>
- * (see the <a href="https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/samples/generate-wadl/">generate-wadl sample</a>).
- * <br/>
- * The {@link java.io.InputStream} is appropriate, when the wadl is generated from a jersey
- * application running in some servlet container or application server.
- * </p>
- */
-package com.sun.jersey.server.wadl.generators;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.java
deleted file mode 100644
index 9aece246043..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc;
-
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.AnnotationDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ClassDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.MethodDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.NamedValueType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ParamDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.RepresentationDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ResourceDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ResponseDocType;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-
-/**
- * A class providing access to information stored in a {@link ResourceDocType}.<br>
- * Created on: Jun 16, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-public class ResourceDocAccessor {
-
- private ResourceDocType _resourceDoc;
-
- public ResourceDocAccessor(ResourceDocType resourceDoc) {
- _resourceDoc = resourceDoc;
- }
-
- public ClassDocType getClassDoc( Class<?> resourceClass ) {
- for ( ClassDocType classDocType : _resourceDoc.getDocs() ) {
- if( resourceClass.getName().equals( classDocType.getClassName() ) ) {
- return classDocType;
- }
- }
- return null;
- }
-
- public MethodDocType getMethodDoc( Class<?> resourceClass, Method method ) {
- final ClassDocType classDoc = getClassDoc( resourceClass );
- if ( classDoc != null ) {
- for ( MethodDocType methodDocType : classDoc.getMethodDocs() ) {
- if (method != null && method.getName().equals(methodDocType.getMethodName())) {
- return methodDocType;
- }
- }
- }
- return null;
- }
-
- /**
- *
- * @param resourceClass
- * @param method
- * @param p
- * @return param doc type
- */
- public ParamDocType getParamDoc( Class<?> resourceClass, Method method,
- Parameter p ) {
- final MethodDocType methodDoc = getMethodDoc( resourceClass, method );
- if ( methodDoc != null ) {
- for ( ParamDocType paramDocType : methodDoc.getParamDocs() ) {
- for ( AnnotationDocType annotationDocType : paramDocType.getAnnotationDocs() ) {
- final Class<? extends Annotation> annotationType = p.getAnnotation().annotationType();
- if ( annotationType != null ) {
- final String sourceName = getSourceName(annotationDocType);
- if ( sourceName != null && sourceName.equals( p.getSourceName() ) ) {
- return paramDocType;
- }
- }
- }
- }
- }
- return null;
- }
-
- public RepresentationDocType getRequestRepresentation( Class<?> resourceClass, Method method, String mediaType ) {
- if ( mediaType == null ) {
- return null;
- }
- final MethodDocType methodDoc = getMethodDoc( resourceClass, method );
- return methodDoc != null
- && methodDoc.getRequestDoc() != null
- && methodDoc.getRequestDoc().getRepresentationDoc() != null
- // && mediaType.equals( methodDoc.getRequestDoc().getRepresentationDoc().getMediaType() )
- ? methodDoc.getRequestDoc().getRepresentationDoc() : null;
- }
-
- public ResponseDocType getResponse( Class<?> resourceClass, Method method ) {
- final MethodDocType methodDoc = getMethodDoc( resourceClass, method );
- return methodDoc != null && methodDoc.getResponseDoc() != null
- ? methodDoc.getResponseDoc() : null;
- }
-
- private String getSourceName(AnnotationDocType annotationDocType ) {
- if ( annotationDocType.hasAttributeDocs() ) {
- for ( NamedValueType namedValueType : annotationDocType.getAttributeDocs() ) {
- /* the value of the "value"-attribute is the param.sourceName...
- */
- if ( "value".equals( namedValueType.getName() ) ) {
- return namedValueType.getValue();
- }
- }
- }
- return null;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.java
deleted file mode 100644
index 7aeecfeffb7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc;
-
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.api.model.AbstractResource;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.Parameter;
-import com.sun.jersey.api.wadl.config.WadlGeneratorConfig;
-import com.sun.jersey.server.wadl.WadlGenerator;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ClassDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.MethodDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ParamDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.RepresentationDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ResourceDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.ResponseDocType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.model.WadlParamType;
-import com.sun.jersey.server.wadl.generators.resourcedoc.xhtml.Elements;
-import com.sun.research.ws.wadl.Application;
-import com.sun.research.ws.wadl.Doc;
-import com.sun.research.ws.wadl.Method;
-import com.sun.research.ws.wadl.Param;
-import com.sun.research.ws.wadl.ParamStyle;
-import com.sun.research.ws.wadl.RepresentationType;
-import com.sun.research.ws.wadl.Request;
-import com.sun.research.ws.wadl.Resource;
-import com.sun.research.ws.wadl.Resources;
-import com.sun.research.ws.wadl.Response;
-
-import javax.ws.rs.core.MediaType;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.namespace.QName;
-import java.io.File;
-import java.io.InputStream;
-import java.util.List;
-
-/**
- * A {@link WadlGenerator} implementation that enhances the generated wadl by
- * information read from a resourcedoc (containing javadoc information about resource
- * classes).
- * <p>
- * The resourcedoc information can either be provided via a {@link File} ({@link #setResourceDocFile(File)}) reference or
- * via an {@link InputStream} ({@link #setResourceDocStream(InputStream)}).
- * </p>
- * <p>
- * The {@link File} should be used when using the maven-wadl-plugin for generating wadl offline,
- * the {@link InputStream} should be used when the extended wadl is generated by jersey at runtime, e.g.
- * using the {@link WadlGeneratorConfig} for configuration.
- * </p>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: WadlGeneratorResourceDocSupport.java 4936 2011-05-10 15:30:24Z pavel_bucek $
- */
-public class WadlGeneratorResourceDocSupport implements WadlGenerator {
-
- public static final String RESOURCE_DOC_FILE = "resourcedoc.xml";
-
- private WadlGenerator _delegate;
- private File _resourceDocFile;
- private InputStream _resourceDocStream;
- private ResourceDocAccessor _resourceDoc;
-
- public WadlGeneratorResourceDocSupport() {
- }
-
- public WadlGeneratorResourceDocSupport( WadlGenerator wadlGenerator, ResourceDocType resourceDoc ) {
- _delegate = wadlGenerator;
- _resourceDoc = new ResourceDocAccessor( resourceDoc );
- }
-
- public void setWadlGeneratorDelegate( WadlGenerator delegate ) {
- _delegate = delegate;
- }
-
- /**
- * Set the <code>resourceDocFile</code> to the given file. Invoking this method is only allowed, as long as
- * the <code>resourceDocStream</code> is not set, otherwise an {@link IllegalStateException} will be thrown.
- * @param resourceDocFile the resourcedoc file to set.
- */
- public void setResourceDocFile( File resourceDocFile ) {
- if ( _resourceDocStream != null ) {
- throw new IllegalStateException( "The resourceDocStream property is already set," +
- " therefore you cannot set the resourceDocFile property. Only one of both can be set at a time." );
- }
- _resourceDocFile = resourceDocFile;
- }
-
- /**
- * Set the <code>resourceDocStream</code> to the given file. Invoking this method is only allowed, as long as
- * the <code>resourceDocFile</code> is not set, otherwise an {@link IllegalStateException} will be thrown.
- * <p>
- * The resourcedoc stream must be closed by the client providing the stream.
- * </p>
- * @param resourceDocStream the resourcedoc stream to set.
- */
- public void setResourceDocStream( InputStream resourceDocStream ) {
- if ( _resourceDocStream != null ) {
- throw new IllegalStateException( "The resourceDocFile property is already set," +
- " therefore you cannot set the resourceDocStream property. Only one of both can be set at a time." );
- }
- _resourceDocStream = resourceDocStream;
- }
-
- public void init() throws Exception {
- if ( _resourceDocFile == null && _resourceDocStream == null ) {
- throw new IllegalStateException( "Neither the resourceDocFile nor the resourceDocStream" +
- " is set, one of both is required." );
- }
- _delegate.init();
- final JAXBContext c = JAXBContext.newInstance( ResourceDocType.class );
- final Unmarshaller m = c.createUnmarshaller();
- final Object resourceDocObj = _resourceDocFile != null
- ? m.unmarshal( _resourceDocFile ) : m.unmarshal( _resourceDocStream );
- final ResourceDocType resourceDoc = ResourceDocType.class.cast( resourceDocObj );
- _resourceDoc = new ResourceDocAccessor( resourceDoc );
- }
-
- public String getRequiredJaxbContextPath() {
- String name = Elements.class.getName();
- name = name.substring(0, name.lastIndexOf('.'));
-
- return _delegate.getRequiredJaxbContextPath() == null
- ? name
- : _delegate.getRequiredJaxbContextPath() + ":" + name;
- }
-
- /**
- * @return the {@link Application} created by the delegate
- * @see com.sun.jersey.server.wadl.WadlGenerator#createApplication()
- */
- public Application createApplication() {
- return _delegate.createApplication();
- }
-
- /**
- * @param r
- * @param path
- * @return the enhanced {@link Resource}
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResource(com.sun.jersey.api.model.AbstractResource, java.lang.String)
- */
- public Resource createResource( AbstractResource r, String path ) {
- final Resource result = _delegate.createResource( r, path );
- final ClassDocType classDoc = _resourceDoc.getClassDoc( r.getResourceClass() );
- if ( classDoc != null && !isEmpty( classDoc.getCommentText() ) ) {
- final Doc doc = new Doc();
- doc.getContent().add( classDoc.getCommentText() );
- result.getDoc().add( doc );
- }
- return result;
- }
-
- /**
- * @param r
- * @param m
- * @return the enhanced {@link Method}
- * @see com.sun.jersey.server.wadl.WadlGenerator#createMethod(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Method createMethod( AbstractResource r, AbstractResourceMethod m ) {
- final Method result = _delegate.createMethod( r, m );
- final MethodDocType methodDoc = _resourceDoc.getMethodDoc( r.getResourceClass(), m.getMethod() );
- if ( methodDoc != null && !isEmpty( methodDoc.getCommentText() ) ) {
- final Doc doc = new Doc();
- doc.getContent().add( methodDoc.getCommentText() );
- // doc.getOtherAttributes().put( new QName( "xmlns" ), "http://www.w3.org/1999/xhtml" );
- result.getDoc().add( doc );
- }
- return result;
- }
-
- /**
- * @param r
- * @param m
- * @param mediaType
- * @return the enhanced {@link RepresentationType}
- * @see com.sun.jersey.server.wadl.WadlGenerator#createRequestRepresentation(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod, javax.ws.rs.core.MediaType)
- */
- public RepresentationType createRequestRepresentation( AbstractResource r,
- AbstractResourceMethod m, MediaType mediaType ) {
- final RepresentationType result = _delegate.createRequestRepresentation( r, m, mediaType );
- final RepresentationDocType requestRepresentation = _resourceDoc.getRequestRepresentation( r.getResourceClass(), m.getMethod(), result.getMediaType() );
- if ( requestRepresentation != null ) {
- result.setElement( requestRepresentation.getElement() );
- addDocForExample( result.getDoc(), requestRepresentation.getExample() );
- }
- return result;
- }
-
- /**
- * @param r
- * @param m
- * @return the enhanced {@link Request}
- * @see com.sun.jersey.server.wadl.WadlGenerator#createRequest(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Request createRequest( AbstractResource r, AbstractResourceMethod m ) {
- return _delegate.createRequest( r, m );
- }
-
- /**
- * @param r
- * @param m
- * @return the enhanced {@link Response}
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResponse(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractResourceMethod)
- */
- public Response createResponse( AbstractResource r, AbstractResourceMethod m ) {
- final ResponseDocType responseDoc = _resourceDoc.getResponse( r.getResourceClass(), m.getMethod() );
- final Response response;
- if ( responseDoc != null && responseDoc.hasRepresentations() ) {
- response = new Response();
-
- for ( RepresentationDocType representationDoc : responseDoc.getRepresentations() ) {
-
- final RepresentationType wadlRepresentation = new RepresentationType();
- wadlRepresentation.setElement( representationDoc.getElement() );
- wadlRepresentation.getStatus().add( representationDoc.getStatus() );
- wadlRepresentation.setMediaType( representationDoc.getMediaType() );
- addDocForExample( wadlRepresentation.getDoc(), representationDoc.getExample() );
- addDoc( wadlRepresentation.getDoc(), representationDoc.getDoc() );
-
- JAXBElement<RepresentationType> element = new JAXBElement<RepresentationType>(
- new QName("http://research.sun.com/wadl/2006/10","representation"),
- RepresentationType.class,
- wadlRepresentation);
-
- response.getRepresentationOrFault().add(element);
- }
-
- return response;
- }
- else {
- response = _delegate.createResponse( r, m );
- }
-
- /* add response params from resourcedoc
- */
- if ( responseDoc != null && !responseDoc.getWadlParams().isEmpty() ) {
- for ( WadlParamType wadlParamType : responseDoc.getWadlParams() ) {
- final Param param = new Param();
- param.setName( wadlParamType.getName() );
- param.setStyle( ParamStyle.fromValue( wadlParamType.getStyle() ) );
- param.setType( wadlParamType.getType() );
- addDoc( param.getDoc(), wadlParamType.getDoc() );
- response.getParam().add( param );
- }
- }
-
- if ( responseDoc != null && !isEmpty( responseDoc.getReturnDoc() ) ) {
- addDoc( response.getDoc(), responseDoc.getReturnDoc() );
- }
-
- return response;
- }
-
- private void addDocForExample( final List<Doc> docs, final String example ) {
- if ( !isEmpty( example ) ) {
- final Doc doc = new Doc();
-
- final Elements pElement = Elements.el( "p" )
- .add( Elements.val( "h6", "Example" ) )
- .add( Elements.el( "pre" ).add( Elements.val( "code", example ) ) );
-
- doc.getContent().add( pElement );
- docs.add( doc );
- }
- }
-
- private void addDoc( final List<Doc> docs, final String text ) {
- if ( !isEmpty( text ) ) {
- final Doc doc = new Doc();
- doc.getContent().add( text );
- docs.add( doc );
- }
- }
-
- /**
- * @param r
- * @param m
- * @param p
- * @return the enhanced {@link Param}
- * @see com.sun.jersey.server.wadl.WadlGenerator#createParam(com.sun.jersey.api.model.AbstractResource, com.sun.jersey.api.model.AbstractMethod, com.sun.jersey.api.model.Parameter)
- */
- public Param createParam( AbstractResource r,
- AbstractMethod m, Parameter p ) {
- final Param result = _delegate.createParam( r, m, p );
- final ParamDocType paramDoc = _resourceDoc.getParamDoc( r.getResourceClass(), m.getMethod(), p );
- if ( paramDoc != null && !isEmpty( paramDoc.getCommentText() ) ) {
- final Doc doc = new Doc();
- doc.getContent().add( paramDoc.getCommentText() );
- result.getDoc().add( doc );
- }
- return result;
- }
-
- /**
- * @return the {@link Resources} created by the delegate
- * @see com.sun.jersey.server.wadl.WadlGenerator#createResources()
- */
- public Resources createResources() {
- return _delegate.createResources();
- }
-
- private boolean isEmpty( String text ) {
- return text == null || text.length() == 0 || "".equals( text.trim() );
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.java
deleted file mode 100644
index 75997fecb7a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for annotations.<br>
- * Created on: Jun 12, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "annotationDoc", propOrder = {
-
-})
-public class AnnotationDocType {
-
- private String annotationTypeName;
-
- @XmlElementWrapper(name = "attributes")
- protected List<NamedValueType> attribute;
-
- public List<NamedValueType> getAttributeDocs() {
- if (attribute == null) {
- attribute = new ArrayList<NamedValueType>();
- }
- return this.attribute;
- }
-
- public boolean hasAttributeDocs() {
- return attribute != null && !attribute.isEmpty();
- }
-
- /**
- * @return the annotationTypeName
- */
- public String getAnnotationTypeName() {
- return annotationTypeName;
- }
-
- /**
- * @param annotationTypeName the annotationTypeName to set
- */
- public void setAnnotationTypeName( String annotationTypeName ) {
- this.annotationTypeName = annotationTypeName;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.java
deleted file mode 100644
index 6853945030f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for classes.<br>
- * Created on: Jun 12, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "classDoc", propOrder = {
-
-})
-public class ClassDocType {
-
- private String className;
- private String commentText;
-
- @XmlElementWrapper(name = "methodDocs")
- private List<MethodDocType> methodDoc;
-
- public List<MethodDocType> getMethodDocs() {
- if (methodDoc == null) {
- methodDoc = new ArrayList<MethodDocType>();
- }
- return this.methodDoc;
- }
-
- @XmlAnyElement(lax = true)
- private List<Object> any;
-
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * @return the commentText
- */
- public String getCommentText() {
- return commentText;
- }
-
- /**
- * @param commentText the commentText to set
- */
- public void setCommentText( String commentText ) {
- this.commentText = commentText;
- }
-
- /**
- * @return the className
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * @param className the className to set
- */
- public void setClassName( String className ) {
- this.className = className;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.java
deleted file mode 100644
index d7efa760859..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for methods.<br>
- * Created on: Jun 12, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "methodDoc", propOrder = {
-
-})
-public class MethodDocType {
-
- private String methodName;
-
- protected String commentText;
-
- /**
- * Gets the value of the commentText property.
- *
- * @return the commentText
- *
- */
- public String getCommentText() {
- return commentText;
- }
-
- /**
- * Sets the value of the commentText property.
- *
- * @param value the commentText
- *
- */
- public void setCommentText(String value) {
- this.commentText = value;
- }
-
- private String returnDoc;
- private String returnTypeExample;
-
- private RequestDocType requestDoc;
- private ResponseDocType responseDoc;
-
- @XmlElementWrapper(name = "paramDocs")
- protected List<ParamDocType> paramDoc;
-
- public List<ParamDocType> getParamDocs() {
- if (paramDoc == null) {
- paramDoc = new ArrayList<ParamDocType>();
- }
- return this.paramDoc;
- }
-
- @XmlAnyElement(lax = true)
- private List<Object> any;
-
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * @return the className
- */
- public String getMethodName() {
- return methodName;
- }
-
- /**
- * @param methodName the className to set
- */
- public void setMethodName( String methodName ) {
- this.methodName = methodName;
- }
-
- /**
- * @return the returnDoc
- */
- public String getReturnDoc() {
- return returnDoc;
- }
-
- /**
- * @param returnDoc the returnDoc to set
- */
- public void setReturnDoc( String returnDoc ) {
- this.returnDoc = returnDoc;
- }
-
- /**
- * @return the returnTypeExample
- */
- public String getReturnTypeExample() {
- return returnTypeExample;
- }
-
- /**
- * @param returnTypeExample the returnTypeExample to set
- */
- public void setReturnTypeExample( String returnTypeExample ) {
- this.returnTypeExample = returnTypeExample;
- }
-
- /**
- * @return the requestDoc
- */
- public RequestDocType getRequestDoc() {
- return requestDoc;
- }
-
- /**
- * @param requestDoc the requestDoc to set
- */
- public void setRequestDoc( RequestDocType requestDoc ) {
- this.requestDoc = requestDoc;
- }
-
- /**
- * @return the responseDoc
- */
- public ResponseDocType getResponseDoc() {
- return responseDoc;
- }
-
- /**
- * @param responseDoc the responseDoc to set
- */
- public void setResponseDoc( ResponseDocType responseDoc ) {
- this.responseDoc = responseDoc;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.java
deleted file mode 100644
index dd8f4ba5985..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for named values.<br>
- * Created on: Jun 12, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: NamedValueType.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "namedValue", propOrder = {
-
-})
-public class NamedValueType {
-
- private String name;
- private String value;
-
- public NamedValueType() {
- }
-
- public NamedValueType(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName( String name ) {
- this.name = name;
- }
-
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue( String value ) {
- this.value = value;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.java
deleted file mode 100644
index 92851c5cf3a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import javax.xml.bind.annotation.XmlRegistry;
-
-/**
- * The object factory for xhtml supporting jaxb bindings.<br>
- * Created on: Jun 17, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlRegistry
-public class ObjectFactory {
-
- public ResourceDocType createResourceDocType() {
- return new ResourceDocType();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.java
deleted file mode 100644
index 05f16f21501..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for params: method params, path params on a class etc.<br>
- * Created on: Jun 12, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id: ParamDocType.java 4584 2011-02-10 09:12:27Z pavel_bucek $
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "paramDoc", propOrder = {
-
-})
-public class ParamDocType {
-
- private String paramName;
- private String commentText;
-
- public ParamDocType() {
- }
-
- public ParamDocType(String paramName, String commentText) {
- this.paramName = paramName;
- this.commentText = commentText;
- }
-
- @XmlElementWrapper(name = "annotationDocs")
- protected List<AnnotationDocType> annotationDoc;
-
- public List<AnnotationDocType> getAnnotationDocs() {
- if (annotationDoc == null) {
- annotationDoc = new ArrayList<AnnotationDocType>();
- }
- return this.annotationDoc;
- }
-
- @XmlAnyElement(lax = true)
- private List<Object> any;
-
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * @return the commentText
- */
- public String getCommentText() {
- return commentText;
- }
-
- /**
- * @param commentText the commentText to set
- */
- public void setCommentText( String commentText ) {
- this.commentText = commentText;
- }
-
- /**
- * @return the className
- */
- public String getParamName() {
- return paramName;
- }
-
- /**
- * @param paramName the className to set
- */
- public void setParamName( String paramName ) {
- this.paramName = paramName;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.java
deleted file mode 100644
index abd5ae43b37..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-/**
- * The documentation type for representations.<br>
- * Created on: Jun 16, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "representationDoc", propOrder = {
-
-})
-public class RepresentationDocType {
-
- @XmlAttribute
- private QName element;
- private String example;
- @XmlAttribute
- private Long status;
- @XmlAttribute
- private String mediaType;
- private String doc;
-
- /**
- * @return the element
- */
- public QName getElement() {
- return element;
- }
- /**
- * @param element the element to set
- */
- public void setElement( QName element ) {
- this.element = element;
- }
- /**
- * @return the example
- */
- public String getExample() {
- return example;
- }
- /**
- * @param example the example to set
- */
- public void setExample( String example ) {
- this.example = example;
- }
- /**
- * @return the status
- */
- public Long getStatus() {
- return status;
- }
- /**
- * @param status the status to set
- */
- public void setStatus( Long status ) {
- this.status = status;
- }
- /**
- * @return the mediaType
- */
- public String getMediaType() {
- return mediaType;
- }
- /**
- * @param mediaType the mediaType to set
- */
- public void setMediaType( String mediaType ) {
- this.mediaType = mediaType;
- }
- /**
- * @return the doc
- */
- public String getDoc() {
- return doc;
- }
- /**
- * @param doc the doc to set
- */
- public void setDoc( String doc ) {
- this.doc = doc;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.java
deleted file mode 100644
index 5ef80a4a410..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for requests.<br>
- * Created on: Jun 16, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "requestDoc", propOrder = {
-
-})
-public class RequestDocType {
-
- private RepresentationDocType representationDoc;
-
- /**
- * @return the representationDoc
- */
- public RepresentationDocType getRepresentationDoc() {
- return representationDoc;
- }
-
- /**
- * @param representationDoc the representationDoc to set
- */
- public void setRepresentationDoc( RepresentationDocType representationDoc ) {
- this.representationDoc = representationDoc;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.java
deleted file mode 100644
index 6891cfb9001..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for resources.<br>
- * Created on: Jun 11, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-
-@XmlAccessorType( XmlAccessType.FIELD )
-@XmlType( name = "resourceDoc", propOrder = {
- "classDoc"
-} )
-@XmlRootElement( name = "resourceDoc" )
-public class ResourceDocType {
-
- @XmlElementWrapper(name = "classDocs")
- protected List<ClassDocType> classDoc;
-
- public List<ClassDocType> getDocs() {
- if (classDoc == null) {
- classDoc = new ArrayList<ClassDocType>();
- }
- return this.classDoc;
- }
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.java
deleted file mode 100644
index 18ab08e484d..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The documentation type for a response.<br>
- * Created on: Jun 16, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "responseDoc", propOrder = {
-
-})
-public class ResponseDocType {
-
- private String returnDoc;
-
- @XmlElementWrapper(name = "wadlParams")
- protected List<WadlParamType> wadlParam;
-
- public List<WadlParamType> getWadlParams() {
- if (wadlParam == null) {
- wadlParam = new ArrayList<WadlParamType>();
- }
- return this.wadlParam;
- }
-
- @XmlElementWrapper(name = "representations")
- protected List<RepresentationDocType> representation;
-
- public List<RepresentationDocType> getRepresentations() {
- if (representation == null) {
- representation = new ArrayList<RepresentationDocType>();
- }
- return this.representation;
- }
-
- public boolean hasRepresentations() {
- return this.representation != null && !this.representation.isEmpty();
- }
-
- /**
- * @return the returnDoc
- */
- public String getReturnDoc() {
- return returnDoc;
- }
-
- /**
- * @param returnDoc the returnDoc to set
- */
- public void setReturnDoc( String returnDoc ) {
- this.returnDoc = returnDoc;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.java
deleted file mode 100644
index 8729f0ab4bc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-/**
- * The documentation type for wadl params.<br>
- * Created on: Jun 12, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "wadlParam", propOrder = {
-
-})
-public class WadlParamType {
-
- @XmlAttribute
- private String name;
- @XmlAttribute
- private String style;
- @XmlAttribute
- private QName type;
- private String doc;
-
- /**
- * @return the commentText
- */
- public String getDoc() {
- return doc;
- }
-
- /**
- * @param commentText the commentText to set
- */
- public void setDoc( String commentText ) {
- this.doc = commentText;
- }
-
- /**
- * @return the className
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param paramName the className to set
- */
- public void setName( String paramName ) {
- this.name = paramName;
- }
-
- /**
- * @return the style
- */
- public String getStyle() {
- return style;
- }
-
- /**
- * @param style the style to set
- */
- public void setStyle( String style ) {
- this.style = style;
- }
-
- /**
- * @return the type
- */
- public QName getType() {
- return type;
- }
-
- /**
- * @param type the type to set
- */
- public void setType( QName type ) {
- this.type = type;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/package-info.java
deleted file mode 100644
index 7d2f956bebb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/model/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for JAXB-based resource class model.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.model;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/package-info.java
deleted file mode 100644
index 311a06f8b41..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for JAXB WADL generation for resource classes.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.java
deleted file mode 100644
index 54ac2e815b8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.xhtml;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
-
-/**
- * This class provides a fluent interface to xhtml supporting jaxb bindings.<br>
- * Created on: Jun 17, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-public class Elements extends JAXBElement<XhtmlElementType> {
-
- public static Elements el( String elementName ) {
- return createElement( elementName );
- }
-
- public static Object val( String elementName, String value ) {
- return createElement( elementName, value );
- }
-
- private static final long serialVersionUID = 1L;
-
- public Elements(QName name, Class<XhtmlElementType> clazz,
- XhtmlElementType element) {
- super( name, clazz, element );
- }
-
- public Elements add( Object ... childNodes ) {
- if ( childNodes != null ) {
- for ( Object childNode : childNodes ) {
- getValue().getChildNodes().add( childNode );
- }
- }
- return this;
- }
-
- public Elements addChild( Object child ) {
- getValue().getChildNodes().add( child );
- return this;
- }
-
- private static Elements createElement( final String elementName ) {
- try {
-
- final XhtmlElementType element = new XhtmlElementType();
-
- final Elements jaxbElement = new Elements(
- new QName( "http://www.w3.org/1999/xhtml", elementName ),
- XhtmlElementType.class,
- element );
-
- return jaxbElement;
-
- } catch ( Exception e ) {
- throw new RuntimeException( e );
- }
- }
-
- private static JAXBElement<XhtmlValueType> createElement( final String elementName, String value ) {
- try {
-
- final XhtmlValueType element = new XhtmlValueType();
- element.value = value;
-
- final JAXBElement<XhtmlValueType> jaxbElement = new JAXBElement<XhtmlValueType>(
- new QName( "http://www.w3.org/1999/xhtml", elementName ),
- XhtmlValueType.class,
- element );
-
- return jaxbElement;
-
- } catch ( Exception e ) {
- throw new RuntimeException( e );
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.java
deleted file mode 100644
index d843868d5df..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.xhtml;
-
-import javax.xml.bind.annotation.XmlRegistry;
-
-/**
- * The object factory for xhtml supporting jaxb bindings.<br>
- * Created on: Jun 17, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlRegistry
-public class ObjectFactory {
-
- public XhtmlElementType createXhtmlElementType() {
- return new XhtmlElementType();
- }
-
- public XhtmlValueType createXhtmlCodeType() {
- return new XhtmlValueType();
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.java
deleted file mode 100644
index 5e3dd364459..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.xhtml;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-
-/**
- * The type for an element holding child nodes.<br>
- * Created on: Jun 17, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType( XmlAccessType.FIELD )
-@XmlType( name = "foo", propOrder = { } )
-@XmlRootElement( name = "foo" )
-public class XhtmlElementType {
-
- @XmlAnyElement
- protected List<Object> any;
-
- public List<Object> getChildNodes() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.java
deleted file mode 100644
index 2ac24f1af2f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.xhtml;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-
-/**
- * The type for an element holding a string value.<br>
- * Created on: Jun 17, 2008<br>
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- * @version $Id$
- */
-@XmlAccessorType( XmlAccessType.FIELD )
-@XmlType( name = "valueType", propOrder = { } )
-@XmlRootElement( name = "valueType" )
-public class XhtmlValueType {
-
- @XmlValue
- protected String value;
-
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/package-info.java
deleted file mode 100644
index 10bdbac96c8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for JAXB-based XHTML.
- */
-package com.sun.jersey.server.wadl.generators.resourcedoc.xhtml;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/package-info.java
deleted file mode 100644
index 8cac7d56cd0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/server/wadl/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for WADL configuration and generation.
- */
-package com.sun.jersey.server.wadl;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/CloseableService.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/CloseableService.java
deleted file mode 100644
index 81250e3cea0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/CloseableService.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi;
-
-import java.io.Closeable;
-
-/**
- * A closeable service to add instances of {@link Closeable} that
- * are required to be closed.
- * <p>
- * This interface may be injected onto server-side components using
- * the {@link javax.ws.rs.core.Context} annotation.
- * <p>
- * The service may be used within the scope of a request to add instances
- * of {@link Closeable} that are to be closed when the request goes out
- * of scope, more specifically after the request has been processed and the
- * response has been returned.
- *
- * @author Paul.Sandoz
- */
-public interface CloseableService {
-
- /**
- * Add an instance of {@link Closeable} that is to be closed when the
- * request goes out of scope.
- *
- * @param c the instance of {@link Closeable}.
- */
- public void add(Closeable c);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/HeaderDelegateProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/HeaderDelegateProvider.java
deleted file mode 100644
index e5e3eb2a775..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/HeaderDelegateProvider.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi;
-
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-
-/**
- * A provider that supports the conversion of an HTTP header, of type T, to and
- * from a {@link String}.
- * <p>
- * An implementation (a service-provider) identifies itself by placing a
- * provider-configuration file (if not already present),
- * "com.sun.jersey.spi.HeaderDelegateProvider" in the
- * resource directory <tt>META-INF/services</tt>, and including the fully qualified
- * service-provider-class of the implementation in the file.
-
- * @param <T> the type of the header.
- * @author Paul.Sandoz@Sun.Com
- */
-public interface HeaderDelegateProvider<T> extends HeaderDelegate<T> {
-
- /**
- * Ascertain if the Provider supports a particular type.
- *
- * @param type the type that is to be supported.
- * @return true if the type is supported, otherwise false.
- */
- boolean supports(Class<?> type);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/MessageBodyWorkers.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/MessageBodyWorkers.java
deleted file mode 100644
index d0a75e2cffd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/MessageBodyWorkers.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-
-/**
- * An injectable interface providing lookup of {@link MessageBodyReader} and
- * {@link MessageBodyWriter} instances.
- *
- * @see javax.ws.rs.core.Context
- * @see MessageBodyReader
- * @see MessageBodyWriter
- * @author Paul.Sandoz@Sun.Com
- */
-public interface MessageBodyWorkers {
- /**
- * Get the map of media type to list of message body writers that are
- * compatible with a media type.
- *
- * @param mediaType the compatible media type.
- * @return the map of media type to list of message body writers.
- */
- public Map<MediaType, List<MessageBodyReader>> getReaders(MediaType mediaType);
-
- /**
- * Get the map of media type to list of message body writers that are
- * compatible with a media type.
- *
- * @param mediaType the compatible media type.
- * @return the map of media type to list of message body writers.
- */
- public Map<MediaType, List<MessageBodyWriter>> getWriters(MediaType mediaType);
-
- /**
- * Convert a map media type to list of message body readers to a string.
- *
- * @param readers the map media type to list of message body readers
- * @return the string representation.
- */
- public String readersToString(Map<MediaType, List<MessageBodyReader>> readers);
-
- /**
- * Convert a map media type to list of message body writers to a string.
- *
- * @param writers the map media type to list of message body readers
- * @return the string representation.
- */
- public String writersToString(Map<MediaType, List<MessageBodyWriter>> writers);
-
- /**
- * Get a message body reader that matches a set of criteria.
- *
- * @param <T> the type of object to be read.
- *
- * @param mediaType the media type of the data that will be read, this will
- * be compared to the values of {@link javax.ws.rs.Consumes} for
- * each candidate reader and only matching readers will be queried.
- *
- * @param type the class of object to be read.
- *
- * @param genericType the type of object to be produced. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the formal type of the method parameter as returned by
- * <code>Class.getGenericParameterTypes</code>.
- *
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be initialized with the produced instance. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the annotations on that parameter returned by
- * <code>Class.getParameterAnnotations</code>.
- *
- * @return a MessageBodyReader that matches the supplied criteria or null
- * if none is found.
- */
- <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type, Type genericType,
- Annotation annotations[], MediaType mediaType);
-
- /**
- * Get a message body writer that matches a set of criteria.
- *
- * @param <T> the type of the object that is to be written.
- *
- * @param mediaType the media type of the data that will be written, this will
- * be compared to the values of {@link javax.ws.rs.Produces} for
- * each candidate writer and only matching writers will be queried.
- *
- * @param type the class of object that is to be written.
- *
- * @param genericType the type of object to be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the declared type of the field as returned by
- * <code>Field.getGenericType</code>.
- *
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the annotations on that field returned by
- * <code>Field.getDeclaredAnnotations</code>.
- *
- * @return a MessageBodyReader that matches the supplied criteria or null
- * if none is found.
- */
- <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> type, Type genericType,
- Annotation annotations[], MediaType mediaType);
-
- /**
- * Get the list of media types supported for a Java type.
- *
- * @param <T> the type of object that is to be written.
- *
- * @param type the class of object that is to be written.
- *
- * @param genericType the type of object to be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the declared type of the field as returned by
- * <code>Field.getGenericType</code>.
- *
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the annotations on that field returned by
- * <code>Field.getDeclaredAnnotations</code>.
- *
- * @return the list of supported media types, the list is ordered as
- * follows: a/b &lt a/* &lt *\\/*
- */
- <T> List<MediaType> getMessageBodyWriterMediaTypes(
- Class<T> type,
- Type genericType,
- Annotation[] annotations);
-
- /**
- * Get the most acceptable media type supported for a Java type given a set
- * of acceptable media types.
- *
- * @param <T> the type of object that is to be written.
- *
- * @param type the class of object that is to be written.
- *
- * @param genericType the type of object to be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the declared type of the field as returned by
- * <code>Field.getGenericType</code>.
- *
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the annotations on that field returned by
- * <code>Field.getDeclaredAnnotations</code>.
- *
- * @param acceptableMediaTypes the list of acceptable media types, sorted
- * according to the quality with the media type of highest quality
- * occurring first first.
- * @return the best media types
- */
- <T> MediaType getMessageBodyWriterMediaType(
- Class<T> type,
- Type genericType,
- Annotation[] annotations,
- List<MediaType> acceptableMediaTypes);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReader.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReader.java
deleted file mode 100644
index 0536acdd5d0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReader.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi;
-
-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;
-
-/**
- * Read a string value and convert to a Java type.
- * <p>
- * A {@link StringReaderProvider} is responsible for providing an instance
- * of this interface.
- * <p>
- * If annotated with {@link ValidateDefaultValue} with a value of true or
- * the annotation is absent then the reader will be used to validate a default
- * value (if any) by calling the fromString method, perhaps at initialization,
- * before any value, default or otherwise, is actually required. This
- * enables the early reporting of errors for default values.
- * If annotated with {@link ValidateDefaultValue} with a value of false then
- * the reader will not be used to validate a default (if any) before any value,
- * default or otherwise, is actually required.
- *
- * @param <T> the Java type to convert to.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface StringReader<T> {
-
- /**
- * Declares whether validation of a default value should occur before any
- * value, default or otherwise, is actually required.
- */
- @Target({ElementType.TYPE})
- @Retention(RetentionPolicy.RUNTIME)
- @Documented
- public static @interface ValidateDefaultValue {
- boolean value() default true;
- }
-
- /**
- * Read a string value and convert to a Java type.
- *
- * @param value The string value.
- * @return the instance of the Java type.
- */
- T fromString(String value);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderProvider.java
deleted file mode 100644
index c3be439e91a..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * Contract for a provider that supports the conversion of a string to a
- * Java type. To add a <code>StringReaderProvider</code> implementation,
- * annotate the implementation class with <code>Provider</code>.
- * <p>
- * Such providers will be used when converting a String value to a java type
- * annotated by the *Param annotations such as {@link javax.ws.rs.QueryParam}.
- *
- * @param <T> The Java type.
- * @see javax.ws.rs.ext.Provider
- * @see com.sun.jersey.spi.StringReaderWorkers
- * @author Paul.Sandoz@Sun.Com
- */
-public interface StringReaderProvider<T> {
-
- /**
- * Obtain a StringReader that can produce an instance of a particular type
- * from a string.
- *
- * @param type the class of object to be produced.
- *
- * @param genericType the type of object to be produced. E.g. if the
- * string is to be converted into a method parameter, this will be
- * the formal type of the method parameter as returned by
- * <code>Class.getGenericParameterTypes</code>.
- *
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be initialized with the produced instance. E.g. if the
- * string is to be converted into a method parameter, this will be
- * the annotations on that parameter returned by
- * <code>Class.getParameterAnnotations</code>.
- *
- * @return the string reader, otherwise null.
- */
- StringReader<T> getStringReader(Class<?> type, Type genericType, Annotation annotations[]);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderWorkers.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderWorkers.java
deleted file mode 100644
index d1331cbbf07..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/StringReaderWorkers.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * An injectable interface providing lookup of {@link StringReader} instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface StringReaderWorkers {
-
- /**
- * Get a string reader that matches a set of criteria.
- *
- * @param <T> the type of object to be read from a string.
- *
- * @param type the class of object to be read.
- *
- * @param genericType the type of object to be produced. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the formal type of the method parameter as returned by
- * <code>Class.getGenericParameterTypes</code>.
- *
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be initialized with the produced instance. E.g. if the
- * string is to be converted into a method parameter, this will be
- * the annotations on that parameter returned by
- * <code>Class.getParameterAnnotations</code>.
- *
- * @return a StringReader that matches the supplied criteria or null
- * if none is found.
- */
- <T> StringReader<T> getStringReader(Class<T> type, Type genericType,
- Annotation annotations[]);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerRequest.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerRequest.java
deleted file mode 100644
index 28e5ee4b9de..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerRequest.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.core.header.InBoundHeaders;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.security.Principal;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.PathSegment;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.Variant;
-
-/**
- * An adapting in-bound HTTP request that may override the behaviour of
- * {@link ContainerRequest}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AdaptingContainerRequest extends ContainerRequest {
-
- /**
- * The adapted container request.
- */
- protected final ContainerRequest acr;
-
- /**
- * Create the adapting container request.
- *
- * @param acr the container request to adapt.
- */
- protected AdaptingContainerRequest(ContainerRequest acr) {
- super(acr);
- this.acr = acr;
- }
-
- @Override
- public Map<String, Object> getProperties() {
- return acr.getProperties();
- }
-
- @Override
- public void setMethod(String method) {
- acr.setMethod(method);
- }
-
- @Override
- public void setUris(URI baseUri, URI requestUri) {
- acr.setUris(baseUri, requestUri);
- }
-
- @Override
- public InputStream getEntityInputStream() {
- return acr.getEntityInputStream();
- }
-
- @Override
- public void setEntityInputStream(InputStream entity) {
- acr.setEntityInputStream(entity);
- }
-
- @Override
- public void setHeaders(InBoundHeaders headers) {
- acr.setHeaders(headers);
- }
-
- @Override
- public void setSecurityContext(SecurityContext securityContext) {
- acr.setSecurityContext(securityContext);
- }
-
- @Override
- public MessageBodyWorkers getMessageBodyWorkers() {
- return acr.getMessageBodyWorkers();
- }
-
- // Traceable
-
- @Override
- public boolean isTracingEnabled() {
- return acr.isTracingEnabled();
- }
-
- @Override
- public void trace(String message) {
- acr.trace(message);
- }
-
- // HttpRequestContext
-
- @Override
- public URI getBaseUri() {
- return acr.getBaseUri();
- }
-
- @Override
- public UriBuilder getBaseUriBuilder() {
- return acr.getBaseUriBuilder();
- }
-
- @Override
- public URI getRequestUri() {
- return acr.getRequestUri();
- }
-
- @Override
- public UriBuilder getRequestUriBuilder() {
- return acr.getRequestUriBuilder();
- }
-
- @Override
- public URI getAbsolutePath() {
- return acr.getAbsolutePath();
- }
-
- @Override
- public UriBuilder getAbsolutePathBuilder() {
- return acr.getAbsolutePathBuilder();
- }
-
- @Override
- public String getPath() {
- return acr.getPath();
- }
-
- @Override
- public String getPath(boolean decode) {
- return acr.getPath(decode);
- }
-
- @Override
- public List<PathSegment> getPathSegments() {
- return acr.getPathSegments();
- }
-
- @Override
- public List<PathSegment> getPathSegments(boolean decode) {
- return acr.getPathSegments(decode);
- }
-
- @Override
- public MultivaluedMap<String, String> getQueryParameters() {
- return acr.getQueryParameters();
- }
-
- @Override
- public MultivaluedMap<String, String> getQueryParameters(boolean decode) {
- return acr.getQueryParameters(decode);
- }
-
- @Override
- public String getHeaderValue(String name) {
- return acr.getHeaderValue(name);
- }
-
- @Override
- public MediaType getAcceptableMediaType(List<MediaType> mediaTypes) {
- return acr.getAcceptableMediaType(mediaTypes);
- }
-
- @Override
- public List<MediaType> getAcceptableMediaTypes(List<QualitySourceMediaType> priorityMediaTypes) {
- return acr.getAcceptableMediaTypes(priorityMediaTypes);
- }
-
- @Override
- public MultivaluedMap<String, String> getCookieNameValueMap() {
- return acr.getCookieNameValueMap();
- }
-
- @Override
- public <T> T getEntity(Class<T> type) throws WebApplicationException {
- return acr.getEntity(type);
- }
-
- @Override
- public <T> T getEntity(Class<T> type, Type genericType, Annotation[] as) throws WebApplicationException {
- return acr.getEntity(type, genericType, as);
- }
-
- @Override
- public Form getFormParameters() {
- return acr.getFormParameters();
- }
-
- @Override
- public List<String> getRequestHeader(String name) {
- return acr.getRequestHeader(name);
- }
-
- @Override
- public MultivaluedMap<String, String> getRequestHeaders() {
- return acr.getRequestHeaders();
- }
-
- @Override
- public List<MediaType> getAcceptableMediaTypes() {
- return acr.getAcceptableMediaTypes();
- }
-
- @Override
- public List<Locale> getAcceptableLanguages() {
- return acr.getAcceptableLanguages();
- }
-
- @Override
- public MediaType getMediaType() {
- return acr.getMediaType();
- }
-
- @Override
- public Locale getLanguage() {
- return acr.getLanguage();
- }
-
- @Override
- public Map<String, Cookie> getCookies() {
- return acr.getCookies();
- }
-
- @Override
- public String getMethod() {
- return acr.getMethod();
- }
-
- @Override
- public Variant selectVariant(List<Variant> variants) throws IllegalArgumentException {
- return acr.selectVariant(variants);
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions(EntityTag eTag) {
- return acr.evaluatePreconditions(eTag);
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions(Date lastModified) {
- return acr.evaluatePreconditions(lastModified);
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag eTag) {
- return acr.evaluatePreconditions(lastModified, eTag);
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions() {
- return acr.evaluatePreconditions();
- }
-
- @Override
- public Principal getUserPrincipal() {
- return acr.getUserPrincipal();
- }
-
- @Override
- public boolean isUserInRole(String role) {
- return acr.isUserInRole(role);
- }
-
- @Override
- public boolean isSecure() {
- return acr.isSecure();
- }
-
- @Override
- public String getAuthenticationScheme() {
- return acr.getAuthenticationScheme();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerResponse.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerResponse.java
deleted file mode 100644
index de9e6f32af2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/AdaptingContainerResponse.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.StatusType;
-
-/**
- * An adapting in-bound HTTP response that may override the behaviour of
- * {@link ContainerResponse}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AdaptingContainerResponse extends ContainerResponse {
-
- /**
- * The adapted container response.
- */
- protected final ContainerResponse acr;
-
- /**
- * Create the adapting container response.
- *
- * @param acr the container response to adapt.
- */
- protected AdaptingContainerResponse(ContainerResponse acr) {
- super(acr);
- this.acr = acr;
- }
-
-
- @Override
- public void write() throws IOException {
- acr.write();
- }
-
- @Override
- public void reset() {
- acr.reset();
- }
-
- @Override
- public ContainerRequest getContainerRequest() {
- return acr.getContainerRequest();
- }
-
- @Override
- public void setContainerRequest(ContainerRequest request) {
- acr.setContainerRequest(request);
- }
-
- @Override
- public ContainerResponseWriter getContainerResponseWriter() {
- return acr.getContainerResponseWriter();
- }
-
- @Override
- public void setContainerResponseWriter(ContainerResponseWriter responseWriter) {
- acr.setContainerResponseWriter(responseWriter);
- }
-
- @Override
- public MessageBodyWorkers getMessageBodyWorkers() {
- return acr.getMessageBodyWorkers();
- }
-
- @Override
- public void mapMappableContainerException(MappableContainerException e) {
- acr.mapMappableContainerException(e);
- }
-
- @Override
- public void mapWebApplicationException(WebApplicationException e) {
- acr.mapWebApplicationException(e);
- }
-
- @Override
- public boolean mapException(Throwable e) {
- return acr.mapException(e);
- }
-
- // HttpResponseContext
-
- @Override
- public Response getResponse() {
- return acr.getResponse();
- }
-
- @Override
- public void setResponse(Response response) {
- acr.setResponse(response);
- }
-
- @Override
- public boolean isResponseSet() {
- return acr.isResponseSet();
- }
-
- @Override
- public Throwable getMappedThrowable() {
- return acr.getMappedThrowable();
- }
-
- @Override
- public StatusType getStatusType() {
- return acr.getStatusType();
- }
-
- @Override
- public void setStatusType(StatusType statusType) {
- acr.setStatusType(statusType);
- }
-
- @Override
- public int getStatus() {
- return acr.getStatus();
- }
-
- @Override
- public void setStatus(int status) {
- acr.setStatus(status);
- }
-
- @Override
- public Object getEntity() {
- return acr.getEntity();
- }
-
- @Override
- public Type getEntityType() {
- return acr.getEntityType();
- }
-
- @Override
- public Object getOriginalEntity() {
- return acr.getOriginalEntity();
- }
-
- @Override
- public void setEntity(Object entity) {
- acr.setEntity(entity);
- }
-
- @Override
- public void setEntity(Object entity, Type entityType) {
- acr.setEntity(entity, entityType);
- }
-
- @Override
- public Annotation[] getAnnotations() {
- return acr.getAnnotations();
- }
-
- @Override
- public void setAnnotations(Annotation[] annotations) {
- acr.setAnnotations(annotations);
- }
-
- @Override
- public MultivaluedMap<String, Object> getHttpHeaders() {
- return acr.getHttpHeaders();
- }
-
- @Override
- public MediaType getMediaType() {
- return acr.getMediaType();
- }
-
- @Override
- public OutputStream getOutputStream() throws IOException {
- return acr.getOutputStream();
- }
-
- @Override
- public boolean isCommitted() {
- return acr.isCommitted();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/CachedEntityContainerRequest.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/CachedEntityContainerRequest.java
deleted file mode 100644
index d184bed9da7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/CachedEntityContainerRequest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * A cached entity in-bound HTTP request that caches the entity instance
- * obtained from the adapted container request.
- * <p>
- * A filter may utilize this class if it requires an entity of a specific type
- * and that same type will also be utilized by a resource method.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class CachedEntityContainerRequest extends AdaptingContainerRequest {
-
- Object entity;
-
- public CachedEntityContainerRequest(ContainerRequest acr) {
- super(acr);
- }
-
- /**
- * Get the entity or a cached instance.
- *
- * @return If called for the first time obtain the entity from the adapting
- * container request and cache the instance. If called for second or
- * subsequent time return the cached instance.
- * @throws ClassCastException if the cached entity cannot be cast to the
- * type requested.
- */
- @Override
- public <T> T getEntity(Class<T> type) throws ClassCastException {
- if (entity == null) {
- T t = acr.getEntity(type);
- entity = t;
- return t;
- } else {
- return type.cast(entity);
- }
- }
-
- /**
- * Get the entity or a cached instance.
- *
- * @return If called for the first time obtain the entity from the adapting
- * container request and cache the instance. If called for second or
- * subsequent time return the cached instance.
- * @throws ClassCastException if the cached entity cannot be cast to the
- * type requested.
- */
- @Override
- public <T> T getEntity(Class<T> type, Type genericType, Annotation[] as) throws ClassCastException {
- if (entity == null) {
- T t = acr.getEntity(type, genericType, as);
- entity = t;
- return t;
- } else {
- return type.cast(entity);
- }
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerListener.java
deleted file mode 100644
index 8d454407935..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-/**
- * A listener that is registered with a {@link ContainerNotifier} to get
- * notified of container related events.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ContainerListener extends ReloadListener {
- /**
- * Called when reloading of the container is requested.
- */
- void onReload();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerNotifier.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerNotifier.java
deleted file mode 100644
index 54f37dcef8c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerNotifier.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.core.ResourceConfig;
-
-/**
- * A container notifier that is used to register container listeners.
- * <p>
- * An implementation may be registered in a {@link ResourceConfig} using the
- * property (@link ResourceConfig#PROPERTY_CONTAINER_NOTIFIER}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ContainerNotifier {
- /**
- * Add a container listener to be notified when the container
- * events occur.
- *
- * @param l the listener.
- */
- void addListener(ContainerListener l);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerProvider.java
deleted file mode 100644
index 2096302538f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerProvider.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ResourceConfig;
-
-/**
- * Service-provider interface for creating container instances.
- * <p>
- * A container instance will be created according to the
- * the supporting generic type of the container.
- * <p>
- * A provider shall support a one-to-one mapping between a type that is not of
- * the type Object. A provider may support
- * more than one one-to-one mapping or a mapping of sub-types of a type
- * (that is not of the type Object). A provider shall not conflict with other
- * providers.
- * <p>
- * An implementation (a service-provider) identifies itself by placing a
- * provider-configuration file (if not already present),
- * "com.sun.jersey.spi.container.ContainerProvider" in the
- * resource directory <tt>META-INF/services</tt>, and including the fully qualified
- * service-provider-class of the implementation in the file.
- *
- * @param <T> the type of the container.
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ContainerProvider<T> {
-
- /**
- * Create an container of type T.
- * <p>
- * The container provider SHOULD NOT initiate the Web application. The container
- * provider MAY modify the resource configuraton.
- * <p>
- * @return the container, otherwise null if the provider does not support
- * the requested <code>type</code>.
- * @param type the type of the container.
- * @param resourceConfig the resource configuration.
- * @param application the Web application the container delegates to for
- * the handling of HTTP requests.
- * @throws ContainerException if there is an error creating the container.
- */
- T createContainer(Class<T> type, ResourceConfig resourceConfig,
- WebApplication application)
- throws ContainerException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequest.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequest.java
deleted file mode 100644
index b5176a5b400..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequest.java
+++ /dev/null
@@ -1,903 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.MessageException;
-import com.sun.jersey.api.Responses;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.core.HttpRequestContext;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.core.TraceInformation;
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.api.uri.UriComponent;
-import com.sun.jersey.core.header.AcceptableLanguageTag;
-import com.sun.jersey.core.header.InBoundHeaders;
-import com.sun.jersey.core.header.MatchingEntityTag;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.header.QualitySourceMediaType;
-import com.sun.jersey.core.header.reader.HttpHeaderReader;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import com.sun.jersey.core.util.ReaderWriter;
-import com.sun.jersey.server.impl.VariantSelector;
-import com.sun.jersey.server.impl.model.HttpHelper;
-import com.sun.jersey.spi.MessageBodyWorkers;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.PathSegment;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.SecurityContext;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.Variant;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.security.Principal;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-
-/**
- * An in-bound HTTP request to be processed by the web application.
- * <p/>
- * Containers instantiate, or inherit, and provide an instance to the
- * {@link WebApplication}.
- * <p/>
- * By default the implementation of {@link SecurityContext} will throw
- * {@link UnsupportedOperationException} if the methods are invoked.
- * Containers SHOULD use the method {@link #setSecurityContext(javax.ws.rs.core.SecurityContext) }
- * to define security context behaviour rather than extending from this class
- * and overriding the methods.
- *
- * @author Paul.Sandoz@Sun.Com
- * @author pavel.bucek@oracle.com
- */
-public class ContainerRequest implements HttpRequestContext {
- private static final Logger LOGGER = Logger.getLogger(ContainerRequest.class.getName());
-
- private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
-
- public static final String VARY_HEADER = "Vary";
-
- private final WebApplication wa;
-
- private final boolean isTraceEnabled;
-
- private Map<String, Object> properties;
-
- private String method;
-
- private InputStream entity;
-
- private URI baseUri;
-
- private URI requestUri;
-
- private URI absolutePathUri;
-
- private String encodedPath;
-
- private String decodedPath;
-
- private List<PathSegment> decodedPathSegments;
-
- private List<PathSegment> encodedPathSegments;
-
- private MultivaluedMap<String, String> decodedQueryParameters;
-
- private MultivaluedMap<String, String> encodedQueryParameters;
-
- private InBoundHeaders headers;
-
- private int headersModCount;
-
- private MediaType contentType;
-
- private List<MediaType> accept;
-
- private List<Locale> acceptLanguages;
-
- private Map<String, Cookie> cookies;
-
- private MultivaluedMap<String, String> cookieNames;
-
- private SecurityContext securityContext;
-
- /**
- * Create a new container request.
- * <p/>
- * The base URI and the request URI must contain the same scheme, user info,
- * host and port components.
- * <p/>
- * The base URI must not contain the query and fragment components. The
- * encoded path component of the request URI must start with the encoded
- * path component of the base URI. The encoded path component of the base
- * URI must end in a '/' character.
- *
- * @param wa the web application
- * @param method the HTTP method
- * @param baseUri the base URI of the request
- * @param requestUri the request URI
- * @param headers the request headers
- * @param entity the InputStream of the request entity
- */
- public ContainerRequest(
- WebApplication wa,
- String method,
- URI baseUri,
- URI requestUri,
- InBoundHeaders headers,
- InputStream entity) {
- this.wa = wa;
- this.isTraceEnabled = wa.isTracingEnabled();
- this.method = method;
- this.baseUri = baseUri;
- this.requestUri = requestUri;
- this.headers = headers;
- this.headersModCount = headers.getModCount();
- this.entity = entity;
- }
-
- /* package */ ContainerRequest(ContainerRequest r) {
- this.wa = r.wa;
- this.isTraceEnabled = r.isTraceEnabled;
- }
-
- // ContainerRequest
-
- /**
- * Get the mutable properties.
- * <p/>
- * Care should be taken not to clear the properties or remove properties
- * that are unknown otherwise unspecified behaviour may result.
- *
- * @return the properties.
- */
- public Map<String, Object> getProperties() {
- if (properties != null) {
- return properties;
- }
-
- return properties = new HashMap<String, Object>();
- }
-
- /**
- * Set the HTTP method.
- *
- * @param method the method.
- */
- public void setMethod(String method) {
- this.method = method;
- }
-
- /**
- * Set the base and request URI.
- *
- * @param baseUri the base URI.
- * @param requestUri the (complete) request URI.
- */
- public void setUris(URI baseUri, URI requestUri) {
- this.baseUri = baseUri;
- this.requestUri = requestUri;
-
- // reset state
- absolutePathUri = null;
-
- encodedPath = decodedPath = null;
-
- decodedPathSegments = encodedPathSegments = null;
-
- decodedQueryParameters = encodedQueryParameters = null;
- }
-
- /**
- * Get the input stream of the entity.
- *
- * @return the input stream of the entity.
- */
- public InputStream getEntityInputStream() {
- return entity;
- }
-
- /**
- * Set the input stream of the entity.
- *
- * @param entity the input stream of the entity.
- */
- public void setEntityInputStream(InputStream entity) {
- this.entity = entity;
- }
-
- /**
- * Set the request headers.
- *
- * @param headers the request headers.
- */
- public void setHeaders(InBoundHeaders headers) {
- this.headers = headers;
- this.headersModCount = headers.getModCount();
-
- // reset state
- contentType = null;
- accept = null;
- cookies = null;
- cookieNames = null;
- }
-
- /**
- * Set the security context.
- *
- * @param securityContext the security context.
- */
- public void setSecurityContext(SecurityContext securityContext) {
- this.securityContext = securityContext;
- }
-
- /**
- * Get the message body workers.
- *
- * @return the message body workers.
- */
- public MessageBodyWorkers getMessageBodyWorkers() {
- return wa.getMessageBodyWorkers();
- }
-
- // Traceable
- @Override
- public boolean isTracingEnabled() {
- return isTraceEnabled;
- }
-
- @Override
- public void trace(String message) {
- if (!isTracingEnabled())
- return;
-
- if (wa.getFeaturesAndProperties().getFeature(ResourceConfig.FEATURE_TRACE_PER_REQUEST) &&
- !getRequestHeaders().containsKey("X-Jersey-Trace-Accept"))
- return;
-
- TraceInformation ti = (TraceInformation) getProperties().
- get(TraceInformation.class.getName());
- ti.trace(message);
- }
-
-
- // HttpRequestContext
- @Override
- public URI getBaseUri() {
- return baseUri;
- }
-
- @Override
- public UriBuilder getBaseUriBuilder() {
- return UriBuilder.fromUri(getBaseUri());
- }
-
- @Override
- public URI getRequestUri() {
- return requestUri;
- }
-
- @Override
- public UriBuilder getRequestUriBuilder() {
- return UriBuilder.fromUri(getRequestUri());
- }
-
- @Override
- public URI getAbsolutePath() {
- if (absolutePathUri != null) return absolutePathUri;
-
- return absolutePathUri = UriBuilder.fromUri(requestUri).
- replaceQuery("").fragment("").
- build();
- }
-
- @Override
- public UriBuilder getAbsolutePathBuilder() {
- return UriBuilder.fromUri(getAbsolutePath());
- }
-
- @Override
- public String getPath() {
- return getPath(true);
- }
-
- @Override
- public String getPath(boolean decode) {
- if (decode) {
- if (decodedPath != null) return decodedPath;
-
- return decodedPath = UriComponent.decode(
- getEncodedPath(),
- UriComponent.Type.PATH);
- } else {
- return getEncodedPath();
- }
- }
-
- private String getEncodedPath() {
- if (encodedPath != null) return encodedPath;
-
- return encodedPath = getRequestUri().getRawPath().substring(
- getBaseUri().getRawPath().length());
- }
-
- @Override
- public List<PathSegment> getPathSegments() {
- return getPathSegments(true);
- }
-
- @Override
- public List<PathSegment> getPathSegments(boolean decode) {
- if (decode) {
- if (decodedPathSegments != null)
- return decodedPathSegments;
-
- return decodedPathSegments = UriComponent.decodePath(getPath(false), true);
- } else {
- if (encodedPathSegments != null)
- return encodedPathSegments;
-
- return encodedPathSegments = UriComponent.decodePath(getPath(false), false);
- }
- }
-
- @Override
- public MultivaluedMap<String, String> getQueryParameters() {
- return getQueryParameters(true);
- }
-
- @Override
- public MultivaluedMap<String, String> getQueryParameters(boolean decode) {
- if (decode) {
- if (decodedQueryParameters != null)
- return decodedQueryParameters;
-
- return decodedQueryParameters = UriComponent.decodeQuery(
- getRequestUri(), true);
- } else {
- if (encodedQueryParameters != null)
- return encodedQueryParameters;
-
- return encodedQueryParameters = UriComponent.decodeQuery(
- getRequestUri(), false);
- }
- }
-
- @Override
- public String getHeaderValue(String name) {
- final List<String> v = getRequestHeaders().get(name);
-
- if (v == null) return null;
-
- if (v.isEmpty()) return "";
-
- if (v.size() == 1) return v.get(0);
-
- StringBuilder sb = new StringBuilder(v.get(0));
- for (int i = 1; i < v.size(); i++) {
- final String s = v.get(i);
- if (s.length() > 0)
- sb.append(',').append(s);
- }
- return sb.toString();
- }
-
- @Override
- public <T> T getEntity(Class<T> type, Type genericType, Annotation[] as) {
- MediaType mediaType = getMediaType();
- if (mediaType == null) {
- mediaType = MediaType.APPLICATION_OCTET_STREAM_TYPE;
- }
-
- MessageBodyReader<T> bw = getMessageBodyWorkers().getMessageBodyReader(
- type, genericType,
- as, mediaType);
- if (bw == null) {
- String message = "A message body reader for Java class " + type.getName() +
- ", and Java type " + genericType +
- ", and MIME media type " + mediaType + " was not found.\n";
- Map<MediaType, List<MessageBodyReader>> m = getMessageBodyWorkers().
- getReaders(mediaType);
- message += "The registered message body readers compatible with the MIME media type are:\n" +
- getMessageBodyWorkers().readersToString(m);
- LOGGER.severe(message);
- throw new WebApplicationException(
- new MessageException(message),
- Responses.unsupportedMediaType().build());
- }
-
- if (isTracingEnabled()) {
- trace(String.format("matched message body reader: %s, \"%s\" -> %s",
- genericType,
- mediaType,
- ReflectionHelper.objectToString(bw)));
- }
-
- try {
- return bw.readFrom(type, genericType, as, mediaType, headers, entity);
- } catch (WebApplicationException ex) {
- throw ex;
- } catch (Exception e) {
- throw new MappableContainerException(e);
- }
- }
-
- /**
- * Set the request entity.
- *
- * @param type the class of object that is to be written.
- * @param genericType the type of object to be written, obtained either
- * by reflection of a resource method return type or by inspection
- * of the returned instance. {@link javax.ws.rs.core.GenericEntity}
- * provides a way to specify this information at runtime.
- * @param annotations an array of the annotations on the resource
- * method that returns the object.
- * @param mediaType the media type of the HTTP entity.
- * @param httpHeaders a mutable map of the HTTP response headers.
- * @param entity the entity instance to write.
- * @throws MappableContainerException encapsulates exceptions thrown while
- * serializing the entity.
- */
- public <T> void setEntity(final Class<T> type, final Type genericType,
- final Annotation annotations[], final MediaType mediaType,
- final MultivaluedMap<String, Object> httpHeaders, final T entity) {
-
- final MessageBodyWriter<T> writer = getMessageBodyWorkers().getMessageBodyWriter(type, genericType, annotations, mediaType);
-
- if (writer == null) {
- String message = "A message body writer for Java class " + type.getName() +
- ", and Java type " + genericType +
- ", and MIME media type " + mediaType + " was not found.\n";
- Map<MediaType, List<MessageBodyReader>> m = getMessageBodyWorkers().
- getReaders(mediaType);
- message += "The registered message body readers compatible with the MIME media type are:\n" +
- getMessageBodyWorkers().readersToString(m);
- LOGGER.severe(message);
- throw new WebApplicationException(
- new MessageException(message),
- Responses.unsupportedMediaType().build());
- }
-
- if (isTracingEnabled()) {
- trace(String.format("matched message body writer: %s, \"%s\" -> %s",
- genericType,
- mediaType,
- ReflectionHelper.objectToString(writer)));
- }
-
- final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-
- try {
- writer.writeTo(entity, type, genericType, annotations, mediaType, httpHeaders, byteArrayOutputStream);
- } catch (IOException e) {
- throw new MappableContainerException(e);
- }
-
- this.entity = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
- }
-
- @Override
- public <T> T getEntity(Class<T> type) {
- return getEntity(type, type, EMPTY_ANNOTATIONS);
- }
-
- @Override
- public MediaType getAcceptableMediaType(List<MediaType> mediaTypes) {
- if (mediaTypes.isEmpty())
- return getAcceptableMediaTypes().get(0);
-
- for (MediaType a : getAcceptableMediaTypes()) {
- if (a.getType().equals(MediaType.MEDIA_TYPE_WILDCARD))
- return mediaTypes.get(0);
-
- for (MediaType m : mediaTypes)
- if (m.isCompatible(a) && !m.isWildcardType() && !m.isWildcardSubtype())
- return m;
- }
- return null;
- }
-
- @Override
- public List<MediaType> getAcceptableMediaTypes(List<QualitySourceMediaType> priorityMediaTypes) {
- return new ArrayList<MediaType>(HttpHelper.getAccept(this, priorityMediaTypes));
- }
-
- @Override
- public MultivaluedMap<String, String> getCookieNameValueMap() {
- if (cookieNames == null || headersModCount != headers.getModCount()) {
- cookieNames = new MultivaluedMapImpl();
- for (Map.Entry<String, Cookie> e : getCookies().entrySet()) {
- cookieNames.putSingle(e.getKey(), e.getValue().getValue());
- }
- }
-
- return cookieNames;
- }
-
- @Override
- public Form getFormParameters() {
- if (MediaTypes.typeEquals(MediaType.APPLICATION_FORM_URLENCODED_TYPE, getMediaType())) {
- InputStream in = getEntityInputStream();
- if (in.getClass() != ByteArrayInputStream.class) {
- // Buffer input
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- try {
- ReaderWriter.writeTo(in, byteArrayOutputStream);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
-
- in = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
- setEntityInputStream(in);
- }
-
- ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) in;
- Form f = getEntity(Form.class);
- byteArrayInputStream.reset();
- return f;
- } else {
- return new Form();
- }
- }
-
-
- // HttpHeaders
- @Override
- public MultivaluedMap<String, String> getRequestHeaders() {
- return headers;
- }
-
- @Override
- public List<String> getRequestHeader(String name) {
- return headers.get(name);
- }
-
- @Override
- public List<MediaType> getAcceptableMediaTypes() {
- if (accept == null || headersModCount != headers.getModCount())
- accept = new ArrayList<MediaType>(HttpHelper.getAccept(this));
-
- return accept;
- }
-
- @Override
- public List<Locale> getAcceptableLanguages() {
- if (acceptLanguages == null || headersModCount != headers.getModCount()) {
- List<AcceptableLanguageTag> alts = HttpHelper.getAcceptLangauge(this);
-
- acceptLanguages = new ArrayList<Locale>(alts.size());
- for (AcceptableLanguageTag alt : alts) {
- acceptLanguages.add(alt.getAsLocale());
- }
- }
-
- return acceptLanguages;
- }
-
- @Override
- public MediaType getMediaType() {
- if (contentType == null || headersModCount != headers.getModCount())
- contentType = HttpHelper.getContentType(this);
-
- return contentType;
- }
-
- @Override
- public Locale getLanguage() {
- return HttpHelper.getContentLanguageAsLocale(this);
- }
-
- @Override
- public Map<String, Cookie> getCookies() {
- if (cookies == null || headersModCount != headers.getModCount()) {
- cookies = new HashMap<String, Cookie>();
-
- List<String> cl = getRequestHeaders().get(HttpHeaders.COOKIE);
- if (cl != null) {
- for (String cookie : cl) {
- if (cookie != null)
- cookies.putAll(
- HttpHeaderReader.readCookies(cookie));
- }
- }
- }
-
- return cookies;
- }
-
-
- // Request
- @Override
- public String getMethod() {
- return method;
- }
-
- @Override
- public Variant selectVariant(List<Variant> variants) {
- if (variants == null || variants.isEmpty())
- throw new IllegalArgumentException("The list of variants is null or empty");
-
- // TODO mark the Vary header to be added to the response
-
- return VariantSelector.selectVariant(this, variants);
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions() {
- Set<MatchingEntityTag> matchingTags = HttpHelper.getIfMatch(this);
- if (matchingTags == null) {
- return null;
- }
-
- // Since the resource does not exist the method must not be
- // perform and 412 Precondition Failed is returned
- return Responses.preconditionFailed();
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions(EntityTag eTag) {
- ResponseBuilder r = evaluateIfMatch(eTag);
- if (r != null)
- return r;
-
- return evaluateIfNoneMatch(eTag);
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions(Date lastModified) {
- final long lastModifiedTime = lastModified.getTime();
- ResponseBuilder r = evaluateIfUnmodifiedSince(lastModifiedTime);
- if (r != null)
- return r;
-
- return evaluateIfModifiedSince(lastModifiedTime);
- }
-
- @Override
- public ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag eTag) {
- ResponseBuilder r = evaluateIfMatch(eTag);
- if (r != null)
- return r;
-
- final long lastModifiedTime = lastModified.getTime();
- r = evaluateIfUnmodifiedSince(lastModifiedTime);
- if (r != null)
- return r;
-
- final boolean isGetOrHead = getMethod().equals("GET") || getMethod().equals("HEAD");
- final Set<MatchingEntityTag> matchingTags = HttpHelper.getIfNoneMatch(this);
- if (matchingTags != null) {
- r = evaluateIfNoneMatch(eTag, matchingTags, isGetOrHead);
- // If the If-None-Match header is present and there is no
- // match then the If-Modified-Since header must be ignored
- if (r == null)
- return r;
-
- // Otherwise if the If-None-Match header is present and there
- // is a match then the If-Modified-Since header must be checked
- // for consistency
- }
-
- final String ifModifiedSinceHeader = getRequestHeaders().getFirst("If-Modified-Since");
- if (ifModifiedSinceHeader != null && isGetOrHead) {
- r = evaluateIfModifiedSince(lastModifiedTime, ifModifiedSinceHeader);
- if (r != null)
- r.tag(eTag);
- }
-
- return r;
- }
-
- private ResponseBuilder evaluateIfMatch(EntityTag eTag) {
- Set<MatchingEntityTag> matchingTags = HttpHelper.getIfMatch(this);
- if (matchingTags == null) {
- return null;
- }
-
- // The strong comparison function must be used to compare the entity
- // tags. Thus if the entity tag of the entity is weak then matching
- // of entity tags in the If-Match header should fail.
- if (eTag.isWeak()) {
- return Responses.preconditionFailed();
- }
-
- if (matchingTags != MatchingEntityTag.ANY_MATCH &&
- !matchingTags.contains(eTag)) {
- // 412 Precondition Failed
- return Responses.preconditionFailed();
- }
-
- return null;
- }
-
- private ResponseBuilder evaluateIfNoneMatch(EntityTag eTag) {
- Set<MatchingEntityTag> matchingTags = HttpHelper.getIfNoneMatch(this);
- if (matchingTags == null)
- return null;
-
- final String httpMethod = getMethod();
- return evaluateIfNoneMatch(
- eTag,
- matchingTags,
- httpMethod.equals("GET") || httpMethod.equals("HEAD"));
- }
-
- private ResponseBuilder evaluateIfNoneMatch(
- EntityTag eTag,
- Set<MatchingEntityTag> matchingTags,
- boolean isGetOrHead) {
- if (isGetOrHead) {
- if (matchingTags == MatchingEntityTag.ANY_MATCH) {
- // 304 Not modified
- return Response.notModified(eTag);
- }
-
- // The weak comparison function may be used to compare entity tags
- if (matchingTags.contains(eTag) || matchingTags.contains(new EntityTag(eTag.getValue(), !eTag.isWeak()))) {
- // 304 Not modified
- return Response.notModified(eTag);
-
- }
- } else {
- // The strong comparison function must be used to compare the entity
- // tags. Thus if the entity tag of the entity is weak then matching
- // of entity tags in the If-None-Match header should fail if the
- // HTTP method is not GET or not HEAD.
- if (eTag.isWeak()) {
- return null;
- }
-
- if (matchingTags == MatchingEntityTag.ANY_MATCH || matchingTags.contains(eTag)) {
- // 412 Precondition Failed
- return Responses.preconditionFailed();
- }
- }
-
- return null;
- }
-
- private ResponseBuilder evaluateIfUnmodifiedSince(long lastModified) {
- String ifUnmodifiedSinceHeader = getRequestHeaders().getFirst("If-Unmodified-Since");
- if (ifUnmodifiedSinceHeader != null) {
- try {
- long ifUnmodifiedSince = HttpHeaderReader.readDate(ifUnmodifiedSinceHeader).getTime();
- if (roundDown(lastModified) > ifUnmodifiedSince) {
- // 412 Precondition Failed
- return Responses.preconditionFailed();
- }
- } catch (ParseException ex) {
- // Ignore the header if parsing error
- }
- }
-
- return null;
- }
-
- private ResponseBuilder evaluateIfModifiedSince(long lastModified) {
- String ifModifiedSinceHeader = getRequestHeaders().getFirst("If-Modified-Since");
- if (ifModifiedSinceHeader == null)
- return null;
-
- final String httpMethod = getMethod();
- if (httpMethod.equals("GET") || httpMethod.equals("HEAD")) {
- return evaluateIfModifiedSince(
- lastModified,
- ifModifiedSinceHeader);
- } else {
- return null;
- }
- }
-
- private ResponseBuilder evaluateIfModifiedSince(
- long lastModified,
- String ifModifiedSinceHeader) {
- try {
- long ifModifiedSince = HttpHeaderReader.readDate(ifModifiedSinceHeader).getTime();
- if (roundDown(lastModified) <= ifModifiedSince) {
- // 304 Not modified
- return Responses.notModified();
- }
- } catch (ParseException ex) {
- // Ignore the header if parsing error
- }
-
- return null;
- }
-
- /**
- * Round down the time to the nearest second.
- *
- * @param time the time to round down.
- * @return the rounded down time.
- */
- private static long roundDown(long time) {
- return time - time % 1000;
- }
-
- // SecurityContext
-
- @Override
- public Principal getUserPrincipal() {
- if (securityContext == null)
- throw new UnsupportedOperationException();
- return securityContext.getUserPrincipal();
- }
-
- @Override
- public boolean isUserInRole(String role) {
- if (securityContext == null)
- throw new UnsupportedOperationException();
- return securityContext.isUserInRole(role);
- }
-
- @Override
- public boolean isSecure() {
- if (securityContext == null)
- throw new UnsupportedOperationException();
- return securityContext.isSecure();
- }
-
- @Override
- public String getAuthenticationScheme() {
- if (securityContext == null)
- throw new UnsupportedOperationException();
- return securityContext.getAuthenticationScheme();
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequestFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequestFilter.java
deleted file mode 100644
index 1a09bb9fbe9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerRequestFilter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-/**
- * A filter for filtering a request.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public interface ContainerRequestFilter {
- /**
- * Filter the request.
- * <p>
- * An implementation may modify the state of the request or
- * create a new instance.
- *
- * @param request the request.
- * @return the request.
- */
- ContainerRequest filter(ContainerRequest request);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponse.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponse.java
deleted file mode 100644
index 367012d0253..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponse.java
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.MessageException;
-import com.sun.jersey.core.header.OutBoundHeaders;
-import com.sun.jersey.api.Responses;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.core.HttpResponseContext;
-import com.sun.jersey.api.core.TraceInformation;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.factory.ResponseImpl;
-import com.sun.jersey.server.impl.uri.rules.HttpMethodRule;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.GenericEntity;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.Response.StatusType;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.RuntimeDelegate;
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-
-/**
- * An out-bound HTTP response to be processed by the web application.
- * <p>
- * Containers instantiate, or inherit, and provide an instance to the
- * {@link WebApplication}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class ContainerResponse implements HttpResponseContext {
- private static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0];
-
- private static final Logger LOGGER = Logger.getLogger(ContainerResponse.class.getName());
-
- private static final RuntimeDelegate rd = RuntimeDelegate.getInstance();
-
- private final WebApplication wa;
-
- private ContainerRequest request;
-
- private ContainerResponseWriter responseWriter;
-
- private Response response;
-
- private Throwable mappedThrowable;
-
- private StatusType statusType;
-
- private MultivaluedMap<String, Object> headers;
-
- private Object originalEntity;
-
- private Object entity;
-
- private Type entityType;
-
- private boolean isCommitted;
-
- private CommittingOutputStream out;
-
- private Annotation[] annotations = EMPTY_ANNOTATIONS;
-
- private final class CommittingOutputStream extends OutputStream {
- private final long size;
-
- private OutputStream o;
-
- CommittingOutputStream(long size) {
- this.size = size;
- }
-
- @Override
- public void write(byte b[]) throws IOException {
- commitWrite();
- o.write(b);
- }
-
- @Override
- public void write(byte b[], int off, int len) throws IOException {
- commitWrite();
- o.write(b, off, len);
- }
-
- public void write(int b) throws IOException {
- commitWrite();
- o.write(b);
- }
-
- @Override
- public void flush() throws IOException {
- commitWrite();
- o.flush();
- }
-
- @Override
- public void close() throws IOException {
- commitClose();
- o.close();
- }
-
- private void commitWrite() throws IOException {
- if (!isCommitted) {
- if (getStatus() == 204)
- setStatus(200);
- isCommitted = true;
- o = responseWriter.writeStatusAndHeaders(size, ContainerResponse.this);
- }
- }
-
- private void commitClose() throws IOException {
- if (!isCommitted) {
- isCommitted = true;
- o = responseWriter.writeStatusAndHeaders(-1, ContainerResponse.this);
- }
- }
- };
-
- /**
- * Instantate a new ContainerResponse.
- *
- * @param wa the web application.
- * @param request the container request associated with this response.
- * @param responseWriter the response writer
- */
- public ContainerResponse(
- WebApplication wa,
- ContainerRequest request,
- ContainerResponseWriter responseWriter) {
- this.wa = wa;
- this.request = request;
- this.responseWriter = responseWriter;
- this.statusType = Status.NO_CONTENT;
- }
-
- /*package */ ContainerResponse(
- ContainerResponse acr) {
- this.wa = acr.wa;
- }
-
- // ContainerResponse
-
- /**
- * Convert a header value, represented as a general object, to the
- * string value.
- * <p>
- * This method defers to {@link RuntimeDelegate#createHeaderDelegate} to
- * obtain a {@link HeaderDelegate} to convert the value to a string. If
- * a {@link HeaderDelegate} is not found then the <code>toString</code>
- * is utilized.
- * <p>
- * Containers may use this method to convert the header values obtained
- * from the {@link #getHttpHeaders}
- *
- * @param headerValue the header value as an object
- * @return the string value
- */
- public static String getHeaderValue(Object headerValue) {
- HeaderDelegate hp = rd.createHeaderDelegate(headerValue.getClass());
-
- return (hp != null) ? hp.toString(headerValue) : headerValue.toString();
- }
-
- /**
- * Write the response.
- * <p>
- * The status and headers will be written by calling the method
- * {@link ContainerResponseWriter#writeStatusAndHeaders} on the provided
- * {@link ContainerResponseWriter} instance. The {@link OutputStream}
- * returned from that method call is used to write the entity (if any)
- * to that {@link OutputStream}. An appropriate {@link MessageBodyWriter}
- * will be found to write the entity.
- *
- * @throws WebApplication if {@link MessageBodyWriter} cannot be
- * found for the entity with a 500 (Internal Server error) response.
- * @throws java.io.IOException if there is an error writing the entity
- */
- public void write() throws IOException {
- if (isCommitted)
- return;
-
- if (request.isTracingEnabled()) {
- configureTrace(responseWriter);
- }
-
- if (entity == null) {
- isCommitted = true;
- responseWriter.writeStatusAndHeaders(-1, this);
- responseWriter.finish();
- return;
- }
-
- if (!getHttpHeaders().containsKey(HttpHeaders.VARY)) {
- final String varyHeader = (String)request.getProperties().get(ContainerRequest.VARY_HEADER);
- if (varyHeader != null) {
- getHttpHeaders().add(HttpHeaders.VARY, varyHeader);
- }
- }
-
- MediaType contentType = getMediaType();
- if (contentType == null) {
- contentType = getMessageBodyWorkers().getMessageBodyWriterMediaType(
- entity.getClass(),
- entityType,
- annotations,
- request.getAcceptableMediaTypes());
- if (contentType == null ||
- contentType.isWildcardType() || contentType.isWildcardSubtype())
- contentType = MediaType.APPLICATION_OCTET_STREAM_TYPE;
-
- getHttpHeaders().putSingle(HttpHeaders.CONTENT_TYPE, contentType);
- }
-
- final MessageBodyWriter p = getMessageBodyWorkers().getMessageBodyWriter(
- entity.getClass(), entityType,
- annotations, contentType);
- if (p == null) {
- String message = "A message body writer for Java class " + entity.getClass().getName() +
- ", and Java type " + entityType +
- ", and MIME media type " + contentType + " was not found";
- LOGGER.severe(message);
- Map<MediaType, List<MessageBodyWriter>> m = getMessageBodyWorkers().
- getWriters(contentType);
- LOGGER.severe("The registered message body writers compatible with the MIME media type are:\n" +
- getMessageBodyWorkers().writersToString(m));
-
- if (request.getMethod().equals("HEAD")) {
- isCommitted = true;
- responseWriter.writeStatusAndHeaders(-1, this);
- responseWriter.finish();
- return;
- } else {
- throw new WebApplicationException(new MessageException(message), 500);
- }
- }
-
- final long size = p.getSize(entity, entity.getClass(), entityType,
- annotations, contentType);
- if (request.getMethod().equals("HEAD")) {
- if (size != -1)
- getHttpHeaders().putSingle(HttpHeaders.CONTENT_LENGTH, Long.toString(size));
- isCommitted = true;
- responseWriter.writeStatusAndHeaders(0, this);
- } else {
- if (request.isTracingEnabled()) {
- request.trace(String.format("matched message body writer: %s, \"%s\" -> %s",
- ReflectionHelper.objectToString(entity),
- contentType,
- ReflectionHelper.objectToString(p)));
- }
-
- if (out == null)
- out = new CommittingOutputStream(size);
- p.writeTo(entity, entity.getClass(), entityType,
- annotations, contentType, getHttpHeaders(),
- out);
- if (!isCommitted) {
- isCommitted = true;
- responseWriter.writeStatusAndHeaders(-1, this);
- }
- }
- responseWriter.finish();
- }
-
- private void configureTrace(final ContainerResponseWriter crw) {
- final TraceInformation ti = (TraceInformation)request.getProperties().
- get(TraceInformation.class.getName());
- setContainerResponseWriter(new ContainerResponseWriter() {
- public OutputStream writeStatusAndHeaders(long contentLength,
- ContainerResponse response) throws IOException {
- ti.addTraceHeaders();
- return crw.writeStatusAndHeaders(contentLength, response);
- }
-
- public void finish() throws IOException {
- crw.finish();
- }
- });
- }
-
- /**
- * Reset the response to 204 (No content) with no headers.
- */
- public void reset() {
- setResponse(Responses.noContent().build());
- }
-
- /**
- * Get the container request.
- *
- * @return the container request.
- */
- public ContainerRequest getContainerRequest() {
- return request;
- }
-
- /**
- * Set the container request.
- *
- * @param request the container request.
- */
- public void setContainerRequest(ContainerRequest request) {
- this.request = request;
- }
-
- /**
- * Get the container response writer.
- *
- * @return the container response writer
- */
- public ContainerResponseWriter getContainerResponseWriter() {
- return responseWriter;
- }
-
- /**
- * Set the container response writer.
- *
- * @param responseWriter the container response writer
- */
- public void setContainerResponseWriter(ContainerResponseWriter responseWriter) {
- this.responseWriter = responseWriter;
- }
-
- /**
- * Get the message body workers.
- *
- * @return the message body workers.
- */
- public MessageBodyWorkers getMessageBodyWorkers() {
- return wa.getMessageBodyWorkers();
- }
-
- /**
- * Map the cause of a mapable container exception to a response.
- * <p>
- * If the cause cannot be mapped and then that cause is re-thrown
- * if a runtime exception otherwise the mappable contaner exception is
- * re-thrown.
- *
- * @param e the mappable container exception whose cause will be mapped to
- * a response.
- */
- public void mapMappableContainerException(MappableContainerException e) {
- Throwable cause = e.getCause();
-
- if (cause instanceof WebApplicationException) {
- mapWebApplicationException((WebApplicationException)cause);
- } else if (!mapException(cause)) {
- if (cause instanceof RuntimeException) {
- LOGGER.log(Level.SEVERE, "The RuntimeException could not be mapped to a response, " +
- "re-throwing to the HTTP container", cause);
- throw (RuntimeException)cause;
- } else {
- LOGGER.log(Level.SEVERE, "The exception contained within " +
- "MappableContainerException could not be mapped to a response, " +
- "re-throwing to the HTTP container", cause);
- throw e;
- }
- }
- }
-
- /**
- * Map a web application exception to a response.
- *
- * @param e the web application exception.
- */
- public void mapWebApplicationException(WebApplicationException e) {
- if (e.getResponse().getEntity() != null) {
- onException(e, e.getResponse(), false);
- } else {
- if (!mapException(e)) {
- onException(e, e.getResponse(), false);
- }
- }
- }
-
- /**
- * Map an exception to a response.
- *
- * @param e the exception.
- * @return true if the exception was mapped, otherwise false.
- */
- public boolean mapException(Throwable e) {
- ExceptionMapper em = wa.getExceptionMapperContext().find(e.getClass());
- if (em == null) return false;
-
- wa.getResponseListener().onMappedException(
- Thread.currentThread().getId(),
- e,
- em
- );
-
- if (request.isTracingEnabled()) {
- request.trace(String.format("matched exception mapper: %s -> %s",
- ReflectionHelper.objectToString(e),
- ReflectionHelper.objectToString(em)));
- }
-
- try {
- Response r = em.toResponse(e);
- if (r == null)
- r = Response.noContent().build();
- onException(e, r, true);
- } catch (MappableContainerException ex) {
- // If the exception mapper throws a MappableContainerException then
- // rethrow it to the HTTP container
- throw ex;
- } catch (RuntimeException ex) {
- LOGGER.severe("Exception mapper " + em +
- " for Throwable " + e +
- " threw a RuntimeException when " +
- "attempting to obtain the response");
- Response r = Response.serverError().build();
- onException(ex, r, false);
- }
- return true;
- }
-
- private void onException(Throwable e, Response r, boolean mapped) {
- if (request.isTracingEnabled()) {
- Response.Status s = Response.Status.fromStatusCode(r.getStatus());
- if (s != null) {
- request.trace(String.format("mapped exception to response: %s -> %d (%s)",
- ReflectionHelper.objectToString(e),
- r.getStatus(),
- s.getReasonPhrase()));
- } else {
- request.trace(String.format("mapped exception to response: %s -> %d",
- ReflectionHelper.objectToString(e),
- r.getStatus()));
- }
- }
-
- if (!mapped && r.getStatus() >= 500) {
- logException(e, r, Level.SEVERE);
- } else if (LOGGER.isLoggable(Level.FINE)) {
- logException(e, r, Level.FINE);
- }
-
- setResponse(r);
-
- this.mappedThrowable = e;
-
- if (getEntity() != null &&
- getHttpHeaders().getFirst(HttpHeaders.CONTENT_TYPE) == null) {
- Object m = request.getProperties().get(HttpMethodRule.CONTENT_TYPE_PROPERTY);
- if (m != null) {
- request.getProperties().remove(HttpMethodRule.CONTENT_TYPE_PROPERTY);
- getHttpHeaders().putSingle(HttpHeaders.CONTENT_TYPE, m);
- }
- }
- }
-
- private void logException(Throwable e, Response r, Level l) {
- Response.Status s = Response.Status.fromStatusCode(r.getStatus());
- if (s != null) {
- LOGGER.log(l,
- "Mapped exception to response: " + r.getStatus() + " (" + s.getReasonPhrase() + ")",
- e);
- } else {
- LOGGER.log(l,
- "Mapped exception to response: " + r.getStatus(),
- e);
- }
- }
-
- // HttpResponseContext
-
- public Response getResponse() {
- if (response == null) {
- setResponse((Response)null);
- }
-
- return response;
- }
-
- public void setResponse(Response response) {
- this.isCommitted = false;
- this.out = null;
- this.response = response = (response != null) ? response : Responses.noContent().build();
- this.mappedThrowable = null;
-
- if (response instanceof ResponseImpl) {
- final ResponseImpl responseImpl = (ResponseImpl)response;
- setStatusType(responseImpl.getStatusType());
- setHeaders(response.getMetadata());
- setEntity(responseImpl.getEntity(), responseImpl.getEntityType());
- } else {
- setStatus(response.getStatus());
- setHeaders(response.getMetadata());
- setEntity(response.getEntity());
- }
- }
-
- public boolean isResponseSet() {
- return response != null;
- }
-
- public Throwable getMappedThrowable() {
- return mappedThrowable;
- }
-
- public StatusType getStatusType() {
- return statusType;
- }
-
- public void setStatusType(StatusType statusType) {
- this.statusType = statusType;
- }
-
- public int getStatus() {
- return statusType.getStatusCode();
- }
-
- public void setStatus(int status) {
- this.statusType = ResponseImpl.toStatusType(status);
- }
-
- public Object getEntity() {
- return entity;
- }
-
- public Type getEntityType() {
- return entityType;
- }
-
- public Object getOriginalEntity() {
- return originalEntity;
- }
-
- public void setEntity(Object entity) {
- setEntity(entity, (entity == null) ? null : entity.getClass());
- }
-
- public void setEntity(Object entity, Type entityType) {
- this.originalEntity = this.entity = entity;
- this.entityType = entityType;
- if (this.entity instanceof GenericEntity) {
- final GenericEntity ge = (GenericEntity)this.entity;
- this.entity = ge.getEntity();
- this.entityType = ge.getType();
- }
- }
-
- public Annotation[] getAnnotations() {
- return annotations;
- }
-
- public void setAnnotations(Annotation[] annotations) {
- this.annotations = (annotations != null) ? annotations : EMPTY_ANNOTATIONS;
- }
-
- public MultivaluedMap<String, Object> getHttpHeaders() {
- if (headers == null)
- headers = new OutBoundHeaders();
- return headers;
- }
-
- public MediaType getMediaType() {
- final Object mediaTypeHeader = getHttpHeaders().getFirst(HttpHeaders.CONTENT_TYPE);
- if (mediaTypeHeader instanceof MediaType) {
- return (MediaType)mediaTypeHeader;
- } else if (mediaTypeHeader != null) {
- return MediaType.valueOf(mediaTypeHeader.toString());
- }
-
- return null;
- }
-
- public OutputStream getOutputStream() throws IOException {
- if (out == null)
- out = new CommittingOutputStream(-1);
-
- return out;
- }
-
- public boolean isCommitted() {
- return isCommitted;
- }
-
-
- //
-
- private void setHeaders(MultivaluedMap<String, Object> headers) {
- this.headers = headers;
- Object location = headers.getFirst(HttpHeaders.LOCATION);
- if (location != null) {
- if (location instanceof URI) {
- final URI locationUri = (URI)location;
- if (!locationUri.isAbsolute()) {
- final URI base = (statusType.getStatusCode() == Status.CREATED.getStatusCode())
- ? request.getAbsolutePath()
- : request.getBaseUri();
- location = UriBuilder.fromUri(base).
- path(locationUri.getRawPath()).
- replaceQuery(locationUri.getRawQuery()).
- fragment(locationUri.getRawFragment()).
- build();
- }
- headers.putSingle(HttpHeaders.LOCATION, location);
- }
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseFilter.java
deleted file mode 100644
index 2898b4d2d72..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseFilter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-/**
- * A filter for filtering a response.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public interface ContainerResponseFilter {
- /**
- * Filter the response.
- * <p>
- * An implementation may modify the state of the response or
- * return a new instance.
- *
- * @param request the request.
- * @param response the response.
- * @return the response.
- */
- ContainerResponse filter(ContainerRequest request, ContainerResponse response);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseWriter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseWriter.java
deleted file mode 100644
index 68157c8189c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ContainerResponseWriter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * Containers implement this interface and provide an instance to the
- * {@link WebApplication} or {@link ContainerResponse}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ContainerResponseWriter {
- /**
- * Write the status and headers of the response and return an output stream
- * for the web application to write the entity of the response.
- *
- * @param contentLength >=0 if the content length in bytes of the
- * entity to be written is known, otherwise -1. Containers
- * may use this value to determine whether the "Content-Length"
- * header can be set or utilize chunked transfer encoding.
- * @param response the container response. The status and headers are
- * obtained from the response.
- * @return the output stream to write the entity (if any).
- * @throws java.io.IOException if an error occured when writing out the
- * status and headers or obtaining the output stream.
- */
- OutputStream writeStatusAndHeaders(
- long contentLength,
- ContainerResponse response) throws IOException;
-
- /**
- * Finish writing the response. This enables the container response
- * writer to clean up any state or flush any streams.
- *
- * @throws java.io.IOException
- */
- void finish() throws IOException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ExceptionMapperContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ExceptionMapperContext.java
deleted file mode 100644
index 14a9c8bb764..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ExceptionMapperContext.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import javax.ws.rs.ext.ExceptionMapper;
-
-/**
- * Provides lookup of {@link ExceptionMapper} instances that can be used
- * to map exceptions to responses.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ExceptionMapperContext {
- /**
- * Find an exception mapper for a class of throwable that is capable
- * of converting a throwable to a response.
- *
- * @param c the throwable class.
- * @return the exception mapper, otherwise null.
- */
- ExceptionMapper find(Class<? extends Throwable> c);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvoker.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvoker.java
deleted file mode 100644
index 41f7fcbefdb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvoker.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- *
- * @author Jakub.Podlesak@Oracle.com
- */
-public interface JavaMethodInvoker {
-
- public Object invoke(Method m, Object o, Object... parameters) throws InvocationTargetException, IllegalAccessException;
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvokerFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvokerFactory.java
deleted file mode 100644
index b65a03929b8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/JavaMethodInvokerFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- *
- * @author japod
- */
-public final class JavaMethodInvokerFactory {
-
- public static JavaMethodInvoker getDefault() {
- return defaultInstance;
- }
-
- static JavaMethodInvoker defaultInstance = new JavaMethodInvoker() {
-
- @Override
- public Object invoke(Method m, Object o, Object... parameters) throws InvocationTargetException, IllegalAccessException {
- return m.invoke(o, parameters);
- }
- };
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ParamQualifier.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ParamQualifier.java
deleted file mode 100644
index b5c565964f0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ParamQualifier.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-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;
-
-/**
- * A meta-annotation that identifies an annotation as a parameter-based
- * annotation.
- *
- * @author Paul.Sandoz@Oracle.Com
- */
-@Target({ElementType.ANNOTATION_TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface ParamQualifier {
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ReloadListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ReloadListener.java
deleted file mode 100644
index 9a4814bee12..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ReloadListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-public interface ReloadListener {
- /**
- * Called when reloading of the container is requested.
- */
- void onReload();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilter.java
deleted file mode 100644
index 4d599a74a01..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilter.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-/**
- * A resource filter to be used to filter a resource method,
- * a sub-resource method, or a sub-resource locator.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public interface ResourceFilter {
-
- /**
- * Get the request filter.
- *
- * @return the request filter, otherwise null if request filtering
- * is not supported.
- */
- ContainerRequestFilter getRequestFilter();
-
- /**
- * Get the response filter.
- *
- * @return the response filter, otherwise null if response filtering
- * is not supported.
- */
- ContainerResponseFilter getResponseFilter();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilterFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilterFactory.java
deleted file mode 100644
index 3020cfda8c5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilterFactory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.model.AbstractMethod;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-import com.sun.jersey.api.model.AbstractSubResourceMethod;
-import java.util.List;
-
-/**
- * A resource filter factory responsible for creating {@link ResourceFilter}
- * instances that match methods of the abstract resource model.
- * <p>
- * Resource filter factories are registered with the {@link ResourceConfig}
- * using the property {@link ResourceConfig#PROPERTY_RESOURCE_FILTER_FACTORIES}.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-public interface ResourceFilterFactory {
-
- /**
- * Create a list of {@link ResourceFilter} instance given a method
- * of the abstract resource model.
- * <p>
- * When applying the list of resource filters to a request each resource filter
- * is applied, in order, from the first to last entry in the list.
- * When applying the list of resource filters to a response each resource filter
- * is applied, in reverse order, from the last to first entry in the list.
- *
- * @param am the abstract method. This may be an instance
- * of the following: {@link AbstractResourceMethod},
- * {@link AbstractSubResourceMethod} or {@link AbstractSubResourceLocator}.
- * @return the list of resource filter, otherwise an empty list or null if
- * no resource filters are associated with the method.
- */
- List<ResourceFilter> create(AbstractMethod am);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilters.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilters.java
deleted file mode 100644
index 87d7cefad6f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceFilters.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines the list of application-declared {@link ResourceFilter}
- * classes associated with a resource method, a sub-resource method,
- * or a sub-resource locator.
- * <p>
- * The classes will be instantiated as singleton components. Thus, if there
- * is the same class declared more than once in the same or a different
- * declaration of this annotation then only one instance of the class will be
- * instantiated.
- * <p>
- * This annotation can be specified on a class or on method(s). Specifying it
- * at a class level means that it applies to all the methods in the class.
- * Specifying it on a method means that it is applicable to that method only.
- * If applied at both the class and methods level , the method value overrides
- * the class value.
- *
- * @author Paul.Sandoz@Sun.Com
- * @see com.sun.jersey.api.container.filter
- */
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ResourceFilters {
- Class<? extends ResourceFilter>[] value();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.java
deleted file mode 100644
index a7d46d58f69..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.impl.ImplMessages;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.core.spi.component.ProviderServices;
-import com.sun.jersey.server.impl.application.ResourceMethodDispatcherFactory;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-import com.sun.jersey.spi.inject.Errors;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- *
- * @author Jakub.Podlesak@Oracle.com
- */
-public class ResourceMethodCustomInvokerDispatchFactory {
-
- private static final Logger LOGGER = Logger.getLogger(ResourceMethodDispatcherFactory.class.getName());
-
- final Set<ResourceMethodCustomInvokerDispatchProvider> customInvokerDispatchProviders;
-
- public ResourceMethodCustomInvokerDispatchFactory(ProviderServices providerServices) {
- customInvokerDispatchProviders = providerServices.getProvidersAndServices(ResourceMethodCustomInvokerDispatchProvider.class);
- }
-
- // this is to address EJB integration issues in WLS/GF:
- public RequestDispatcher getDispatcher(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker) {
-
- if (invoker == null) {
- return null;
- }
- // Mark the errors so it is possible to reset
- Errors.mark();
-
- for (ResourceMethodCustomInvokerDispatchProvider rmdp : customInvokerDispatchProviders) {
-
- try {
- RequestDispatcher d = rmdp.create(abstractResourceMethod, invoker);
- if (d != null) {
- // Reset any errors, if any, produced from previous dispatch
- // providers
- Errors.reset();
- return d;
- }
- } catch (Exception e) {
- LOGGER.log(Level.SEVERE, ImplMessages.ERROR_PROCESSING_METHOD(
- abstractResourceMethod.getMethod(),
- rmdp.getClass().getName()), e);
- }
- }
-
- Errors.unmark();
- return null;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.java
deleted file mode 100644
index 5542e2e4cbb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-
-/**
- * Service-provider interface for creating {@link RequestDispatcher} instances.
- * <p>
- * An implementation (a service-provider) identifies itself by placing a
- * provider-configuration file (if not already present),
- * "com.sun.research.ws.rest.spi.invoker.ResourceMethodCustomInvokerDispatchProvider" in the
- * resource directory <tt>META-INF/services</tt>, and including the fully qualified
- * service-provider-class of the implementation in the file.
- * <p>
- * This interface is similar to {@link ResourceMethodDispatchProvider}, but allows
- * to use a custom {@link JavaMethodInvoker} instance, which will be used to make
- * the final Java method call.
- *
- * @author Jakub.Podlesak@Oracle.com
- */
-public interface ResourceMethodCustomInvokerDispatchProvider {
-
- /**
- * Create a {@link RequestDispatcher} for a resource method of
- * a resource.
- *
- * @param abstractResourceMethod the abstract resource method.
- * @param invoker custom Java method invoker instance
- * @return the request dispatcher, otherwise null if it could not be created
- * for the abstract resource method.
- */
- RequestDispatcher create(AbstractResourceMethod abstractResourceMethod, JavaMethodInvoker invoker);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.java
deleted file mode 100644
index e0c971d4a50..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-/**
- * A provider that can adapt a @{link ResourceMethodDispatchProvider}.
- *
- * @author Paul Sandoz
- */
-public interface ResourceMethodDispatchAdapter {
-
- /**
- * Adapt a @{link ResourceMethodDispatchProvider}.
- *
- * @param provider the provider to adapt.
- * @return the adapted provider.
- */
- ResourceMethodDispatchProvider adapt(ResourceMethodDispatchProvider provider);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.java
deleted file mode 100644
index c71bafafb0c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.spi.dispatch.RequestDispatcher;
-
-/**
- * Service-provider interface for creating {@link RequestDispatcher} instances.
- * <p>
- * An implementation (a service-provider) identifies itself by placing a
- * provider-configuration file (if not already present),
- * "com.sun.research.ws.rest.spi.invoker.ResourceMethodDispatchProvider" in the
- * resource directory <tt>META-INF/services</tt>, and including the fully qualified
- * service-provider-class of the implementation in the file.
- * <p>
- * A provider will examine the model of the Web resource method and
- * determine if an invoker can be created for that Web resource method.
- * <p>
- * Multiple providers can specify the support for different Web resource method
- * patterns, ranging from simple patterns (such as void return and input
- * parameters) to complex patterns that take type URI and query arguments
- * and HTTP request headers as typed parameters.
- *
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ResourceMethodDispatchProvider {
-
- /**
- * Create a {@link RequestDispatcher} for a resource method of
- * a resource.
- *
- * @param abstractResourceMethod the abstract resource method.
- * @return the request dispatcher, otherwise null if it could not be created
- * for the abstract resource method.
- */
- RequestDispatcher create(AbstractResourceMethod abstractResourceMethod);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplication.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplication.java
deleted file mode 100644
index 4cffde55719..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplication.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.core.Traceable;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.core.util.FeaturesAndProperties;
-import com.sun.jersey.server.impl.inject.ServerInjectableProviderFactory;
-import com.sun.jersey.spi.MessageBodyWorkers;
-import com.sun.jersey.spi.monitoring.DispatchingListener;
-import com.sun.jersey.spi.monitoring.RequestListener;
-import com.sun.jersey.spi.monitoring.ResponseListener;
-
-import javax.ws.rs.ext.Providers;
-import java.io.IOException;
-
-/**
- * A Web application that manages a set of resource classes.
- * <p>
- * The web application will dispatch HTTP requests to the matching resource
- * method on the matching resource class.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface WebApplication extends Traceable {
- /**
- *
- * @return true if th web application is initiated, otherwise false.
- */
- boolean isInitiated();
-
- /**
- * Initiate the Web application.
- * <p>
- * This method can only be called once. Further calls will result in an
- * exception.
- *
- * @param resourceConfig the resource configuration containing the set
- * of Web resources to be managed by the Web application.
- * @throws IllegalArgumentException if resourceConfig is null.
- * @throws ContainerException if a second or further call to the method
- * is invoked.
- */
- void initiate(ResourceConfig resourceConfig)
- throws IllegalArgumentException, ContainerException;
-
- /**
- * Initiate the Web application.
- * <p>
- * This method can only be called once. Further calls will result in an
- * exception.
- *
- * @param resourceConfig the resource configuration containing the set
- * of Web resources to be managed by the Web application.
- * @param provider the IoC component provider factory to use, if null the default
- * component provider factory will be used.
- * @throws IllegalArgumentException if resourceConfig is null.
- * @throws ContainerException if a second or further call to the method
- * is invoked.
- */
- void initiate(ResourceConfig resourceConfig, IoCComponentProviderFactory provider)
- throws IllegalArgumentException, ContainerException;
-
- /**
- * Clone the WebApplication instance.
- * <p>
- * A new WebApplication instance will be created that is initiated with
- * the {@link ResourceConfig} and {@link IoCComponentProviderFactory} instances
- * that were used to initiate this WebApplication instance.
- *
- * @return the cloned instance.
- */
- WebApplication clone();
-
- /**
- * Get the features and properties.
- *
- * @return the features and properties.
- */
- FeaturesAndProperties getFeaturesAndProperties();
-
- /**
- * Get the providers.
- *
- * @return the providers.
- * @since 1.3
- */
- Providers getProviders();
-
- /**
- * Get the message body workers that can be used for getting
- * message body readers and writers.
- *
- * @return the message body workers. The return value is
- * undefined before the web application is initialized.
- */
- MessageBodyWorkers getMessageBodyWorkers();
-
- /**
- * Get the exception mapper context that can be used to map exceptions
- * to responses.
- *
- * @return the exception mapper context.
- */
- ExceptionMapperContext getExceptionMapperContext();
-
- /**
- * Get an instance of {@link HttpContext} that is a proxy to
- * a thread local instance of {@link HttpContext}.
- *
- * @return the thread local instance of HttpContext.
- */
- HttpContext getThreadLocalHttpContext();
-
- /**
- * Get the server injectable provider factory.
- *
- * @return the server injectable provider factory
- */
- ServerInjectableProviderFactory getServerInjectableProviderFactory();
-
- /**
- * Get an instance of {@link RequestListener} that should be
- * used to monitor request processing.
- *
- * @return the actual request listener
- */
- RequestListener getRequestListener();
-
- /**
- * Get an instance of {@link DispatchingListener} that should be
- * used to monitor request processing.
- *
- * @return the actual dispatching listener
- */
- DispatchingListener getDispatchingListener();
-
- /**
- * Get an instance of {@link ResponseListener} that should be
- * used to monitor request processing.
- *
- * @return the actual response listener
- */
- ResponseListener getResponseListener();
-
- /**
- * Handle an HTTP request by dispatching the request to the appropriate
- * matching Web resource that produces the response or otherwise producing
- * the appropriate HTTP error response.
- * <p>
- * @param request the HTTP container request.
- * @param responseWriter the HTTP container response writer.
- * @throws IOException if there is an IO error handling the request.
- */
- void handleRequest(ContainerRequest request, ContainerResponseWriter responseWriter)
- throws IOException;
-
- /**
- * Handle an HTTP request by dispatching the request to the appropriate
- * matching Web resource that produces the response or otherwise producing
- * the appropriate HTTP error response.
- * <p>
- * @param request the HTTP container request.
- * @param response the HTTP container response.
- * @throws IOException if there is an IO error handling the request.
- */
- void handleRequest(ContainerRequest request, ContainerResponse response)
- throws IOException;
-
- /**
- * Destroy the Web application.
- * <p>
- * This method MUST only be called only once. Calls to <code>handlerRequest</code>
- * MUST not occur while and after this method has been called.
- */
- void destroy();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationFactory.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationFactory.java
deleted file mode 100644
index a1f2d66d25b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.spi.service.ServiceFinder;
-
-/**
- * A factory for {@link WebApplication} instances. Container providers use this class
- * to obtain an instance of {@link WebApplication} to initiate.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class WebApplicationFactory {
-
- private WebApplicationFactory() {
- }
-
- /**
- * Create a Web application instance.
- *
- * @return the web application.
- * @throws ContainerException if there is an error creating the Web application.
- */
- public static WebApplication createWebApplication() throws ContainerException {
- for (WebApplicationProvider wap : ServiceFinder.find(WebApplicationProvider.class)) {
- // Use the first provider found
- return wap.createWebApplication();
- }
-
- throw new ContainerException("No WebApplication provider is present");
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationListener.java
deleted file mode 100644
index 8e52380d726..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationListener.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container;
-
-public interface WebApplicationListener {
- void onWebApplicationReady();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationProvider.java
deleted file mode 100644
index 2f700023b81..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/WebApplicationProvider.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container;
-
-import com.sun.jersey.api.container.ContainerException;
-
-/**
- * Service-provider interface for creating Web application instances.
- * <p>
- * An implementation (a service-provider) identifies itself by placing a
- * provider-configuration file (if not already present),
- * "com.sun.research.ws.rest.spi.container.WebApplicationProvider" in the
- * resource directory <tt>META-INF/services</tt>, and including the fully qualified
- * service-provider-class of the implementation in the file.
- * <p>
- * Only the first registered provider in the provider-configuration file will
- * be used any subsequent providers (if present) will be ignored.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface WebApplicationProvider {
-
- /**
- * Instantiate a new {@link WebApplication}.
- *
- * @return the Web application.
- * @throws ContainerException if there is an error creating the Web application.
- */
- public abstract WebApplication createWebApplication()
- throws ContainerException;
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/package-info.java
deleted file mode 100644
index 29dba7156a5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/package-info.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for containers and the web application that manages
- * resource classes.
- */
-package com.sun.jersey.spi.container; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/PerSession.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/PerSession.java
deleted file mode 100644
index 62d29771e26..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/PerSession.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container.servlet;
-
-import com.sun.jersey.server.impl.container.servlet.PerSessionFactory;
-import com.sun.jersey.server.spi.component.ResourceComponentProviderFactoryClass;
-import java.io.Serializable;
-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;
-
-/**
- * Used to annotate resource classes that require a new instance
- * for each HTTP servlet session.
- * <p>
- * Resource classes must implement {@link Serializable} if state is to be
- * persisted.
- */
-@Target({ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@ResourceComponentProviderFactoryClass(PerSessionFactory.class)
-public @interface PerSession {} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/ServletContainer.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/ServletContainer.java
deleted file mode 100644
index c864a52a4f1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/ServletContainer.java
+++ /dev/null
@@ -1,903 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container.servlet;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.core.ClasspathResourceConfig;
-import com.sun.jersey.api.core.PackagesResourceConfig;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.core.WebAppResourceConfig;
-import com.sun.jersey.api.uri.UriComponent;
-import com.sun.jersey.core.spi.component.ioc.IoCComponentProviderFactory;
-import com.sun.jersey.server.impl.application.DeferredResourceConfig;
-import com.sun.jersey.spi.container.ContainerNotifier;
-import com.sun.jersey.spi.container.ReloadListener;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.container.WebApplicationFactory;
-import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
-import com.sun.jersey.spi.service.ServiceFinder;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.Servlet;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.UriBuilder;
-import java.io.IOException;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-
-/**
- * A {@link Servlet} or {@link Filter} for deploying root resource classes.
- * <p>
- * If this class is declared as a filter and the initialization parameter
- * {@link #PROPERTY_WEB_PAGE_CONTENT_REGEX} is not set
- * or {@link #FEATURE_FILTER_FORWARD_ON_404} is not set to true then the filter
- * must be declared at the last position in the filter chain as the filter will
- * not forward any request to a next filter (if any) in the chain.
- * <p>
- * The following sections make reference to initialization parameters. Unless
- * otherwise specified the initialization parameters apply to both server
- * and filter initialization parameters.
- * <p>
- * The servlet or filter may be configured to have an initialization
- * parameter "com.sun.jersey.config.property.resourceConfigClass" or
- * "javax.ws.rs.Application" and whose value is a
- * fully qualified name of a class that implements {@link ResourceConfig} or
- * {@link Application}.
- * If the concrete class has a constructor that takes a single parameter of the
- * type Map then the class is instantiated with that constructor and an instance
- * of Map that contains all the initialization parameters is passed as the
- * parameter. Otherwise, the class is instantiated as a singleton component
- * managed by the runtime, and injection may be performed (the artifacts that
- * may be injected are limited to injectable providers registered when
- * the servlet or filter is configured).
- * <p>
- * If the initialization parameter
- * "com.sun.jersey.config.property.resourceConfigClass" or
- * "javax.ws.rs.Application" is not present and a
- * initialization parameter "com.sun.jersey.config.property.packages" is present
- * (see {@link PackagesResourceConfig#PROPERTY_PACKAGES}) a new instance of
- * {@link PackagesResourceConfig} is created. The initialization parameter
- * "com.sun.jersey.config.property.packages" MUST be set to provide one or
- * more package names. Each package name MUST be separated by ';'.
- *
- * The package names are added as a property value to a Map instance using
- * the property name (@link PackagesResourceConfig#PROPERTY_PACKAGES}. Any
- * additional initialization parameters are then added to the Map instance.
- * Then that Map instance is passed to the constructor of
- * {@link PackagesResourceConfig}.
- *
- * <p>
- * If none of the above resource configuration related initialization parameters
- * are present a new instance of {@link WebAppResourceConfig} is created. The
- * initialization parameter "com.sun.jersey.config.property.classpath" MAY be
- * set to provide one or more resource paths. Each path MUST be separated by ';'.
- *
- * The resource paths are added as a property value to a Map instance using
- * the property name (@link ClasspathResourceConfig.PROPERTY_CLASSPATH}. Any
- * additional initialization parameters are then added to the Map instance.
- * Then that Map instance is passed to the constructor of
- * {@link WebAppResourceConfig}.
- *
- * If the initialization parameter is not present then the following resource
- * paths are utilized:
- * "/WEB-INF/lib" and "/WEB-INF/classes".
- * <p>
- * All initialization parameters are added as properties of the created
- * {@link ResourceConfig}.
- * <p>
- * A new {@link WebApplication} instance will be created and configured such
- * that the following classes may be injected onto a root resource, provider
- * and {@link Application} classes using {@link javax.ws.rs.core.Context}:
- * {@link HttpServletRequest}, {@link HttpServletResponse},
- * {@link ServletContext}, {@link ServletConfig} and {@link WebConfig}.
- * If this class is used as a Servlet then the {@link ServletConfig} class may
- * be injected. If this class is used as a Filter then the {@link FilterConfig}
- * class may be injected. {@link WebConfig} may be injected to abstract
- * servlet or filter deployment.
- * <p>
- * A {@link IoCComponentProviderFactory} instance may be registered by extending this class
- * and overriding the method {@link #initiate(ResourceConfig, WebApplication)}
- * to initiate the {@link WebApplication} with the {@link IoCComponentProviderFactory}
- * instance.
- *
- */
-public class ServletContainer extends HttpServlet implements Filter {
- /**
- * The servlet initialization property whose boolean value determines
- * if GlassFish default error pages will be returned or not.
- * <p>
- * The default value is true.
- * <p>
- * If false then GlassFish will not return default error pages.
- * <p>
- * This property is supported on GlassFish version 3.1 or greater.
- * @since 1.5
- */
- public static final String GLASSFISH_DEFAULT_ERROR_PAGE_RESPONSE = "org.glassfish.web.isDefaultErrorPageEnabled";
-
- /**
- * The servlet initialization property whose value is a fully qualified
- * class name of a class that implements {@link ResourceConfig} or
- * {@link Application}.
- */
- public static final String APPLICATION_CONFIG_CLASS =
- "javax.ws.rs.Application";
-
- /**
- * The servlet initialization property whose value is a fully qualified
- * class name of a class that implements {@link ResourceConfig} or
- * {@link Application}.
- */
- public static final String RESOURCE_CONFIG_CLASS =
- "com.sun.jersey.config.property.resourceConfigClass";
-
- /**
- * The base path in the Web Pages where JSP templates, associated with
- * viewables of resource classes, are located.
- * <p>
- * If this property is not set then the base path will be the root path
- * of the Web Pages.
- */
- public static final String JSP_TEMPLATES_BASE_PATH =
- "com.sun.jersey.config.property.JSPTemplatesBasePath";
-
- /**
- * If set the regular expression used to match an incoming servlet path URI
- * to some web page content such as static resources or JSPs to be handled
- * by the underlying servlet engine.
- * <p>
- * The type of this property must be a String and the value must be a valid
- * regular expression.
- * <p>
- * This property is only applicable when this class is used as a
- * {@link Filter}, otherwise this property will be ignored and not
- * processed.
- * <p>
- * If a servlet path matches this regular expression then the filter
- * forwards the request to the next filter in the filter chain so that the
- * underlying servlet engine can process the request otherwise Jersey
- * will process the request.
- * <p>
- * For example if you set the value to
- * <code>/(image|css)/.*</code>
- * then you can serve up images and CSS files for your Implicit or Explicit
- * Views while still processing your JAX-RS resources.
- */
- public static final String PROPERTY_WEB_PAGE_CONTENT_REGEX
- = "com.sun.jersey.config.property.WebPageContentRegex";
-
- /**
- * If true and a 404 response with no entity body is returned from either
- * the runtime or the application then the runtime forwards the request to
- * the next filter in the filter chain. This enables another filter or
- * the underlying servlet engine to process the request.
- * Before the request is forwarded the response status is set to 200.
- * <p>
- * This property is only applicable when this class is used as a
- * {@link Filter}, otherwise this property will be ignored and not
- * processed.
- * <p>
- * Application code, such as methods corresponding to sub-resource locators
- * may be invoked when this feature is enabled.
- * <p>
- * This feature is an alternative to setting
- * {@link #PROPERTY_WEB_PAGE_CONTENT_REGEX} and requires less configuration.
- * However, application code, such as methods corresponding to sub-resource
- * locators, may be invoked when this feature is enabled.
- * <p>
- * The default value is false.
- */
- public static final String FEATURE_FILTER_FORWARD_ON_404
- = "com.sun.jersey.config.feature.FilterForwardOn404";
-
- /**
- * The filter context path.
- * <p>
- * If the URL pattern of a filter is set to a base path and a wildcard,
- * such as "/base/*", then this property can be used to declare a filter
- * context path that behaves in the same manner as the Servlet context
- * path for determining the base URI of the application. (Note that with
- * the Servlet 2.x API it is not possible to determine the URL pattern
- * without parsing the web.xml, hence why this property is necessary.)
- * <p>
- * This property is only applicable when this class is used as a
- * {@link Filter}, otherwise this property will be ignored and not
- * processed.
- * <p>
- * This property may consist of one or more path segments separate by '/'.
- */
- public static final String PROPERTY_FILTER_CONTEXT_PATH
- = "com.sun.jersey.config.feature.FilterContextPath";
-
- /**
- * A helper class for creating an injectable provider that supports
- * {@link Context} with a type and constant value.
- *
- * @param <T> the type of the constant value.
- */
- protected static class ContextInjectableProvider<T> extends
- SingletonTypeInjectableProvider<Context, T> {
-
- /**
- * Create a new instance.
- *
- * @param type the type of the constant value.
- * @param instance the constant value.
- */
- protected ContextInjectableProvider(Type type, T instance) {
- super(type, instance);
- }
- }
-
- private transient WebComponent webComponent;
-
- private transient FilterConfig filterConfig;
-
- private transient Pattern staticContentPattern;
-
- private transient boolean forwardOn404;
-
- private class InternalWebComponent extends WebComponent {
-
- InternalWebComponent() {
- }
-
- InternalWebComponent(Application app) {
- super(app);
- }
-
- @Override
- protected WebApplication create() {
- return ServletContainer.this.create();
- }
-
- @Override
- protected void configure(WebConfig wc, ResourceConfig rc, WebApplication wa) {
- super.configure(wc, rc, wa);
-
- ServletContainer.this.configure(wc, rc, wa);
- }
-
- @Override
- protected void initiate(ResourceConfig rc, WebApplication wa) {
- ServletContainer.this.initiate(rc, wa);
- }
-
- @Override
- protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props,
- WebConfig wc) throws ServletException {
- return ServletContainer.this.getDefaultResourceConfig(props, wc);
- }
- }
-
- private transient final Application app;
-
- public ServletContainer() {
- this.app = null;
- }
-
- public ServletContainer(Class<? extends Application> appClass) {
- this.app = new DeferredResourceConfig(appClass);
- }
-
- public ServletContainer(Application app) {
- this.app = app;
- }
-
- // GenericServlet
-
- /**
- * Get the servlet context for the servlet or filter, depending on
- * how this class is registered.
- * <p>
- * It is recommended that the {@link WebConfig} be utilized,
- * see the method {@link #getWebConfig() }, to obtain the servlet context
- * and initialization parameters for a servlet or filter.
- *
- * @return the servlet context for the servlet or filter.
- */
- @Override
- public ServletContext getServletContext() {
- if (filterConfig != null)
- return filterConfig.getServletContext();
-
- return super.getServletContext();
- }
-
- /**
- * Initiate the Web component.
- *
- * @param webConfig the Web configuration.
- *
- * @throws javax.servlet.ServletException in case of an initialization failure
- */
- protected void init(WebConfig webConfig) throws ServletException {
- webComponent = (app == null)
- ? new InternalWebComponent()
- : new InternalWebComponent(app);
- webComponent.init(webConfig);
- }
-
- /**
- * Get the Web configuration.
- *
- * @return the Web configuration.
- */
- protected WebConfig getWebConfig() {
- return webComponent.getWebConfig();
- }
-
- /**
- * Create a new instance of a {@link WebApplication}.
- *
- * @return the {@link WebApplication} instance.
- */
- protected WebApplication create() {
- return WebApplicationFactory.createWebApplication();
- }
-
- /**
- * Get the default resource configuration if one is not declared in the
- * web.xml.
- * <p>
- * This implementation returns an instance of {@link WebAppResourceConfig}
- * that scans in files and directories as declared by the
- * {@link ClasspathResourceConfig#PROPERTY_CLASSPATH} if present, otherwise
- * in the "WEB-INF/lib" and "WEB-INF/classes" directories.
- * <p>
- * An inheriting class may override this method to supply a different
- * default resource configuration implementation.
- *
- * @param props the properties to pass to the resource configuration.
- * @param wc the web configuration.
- * @return the default resource configuration.
- *
- * @throws javax.servlet.ServletException in case there was an error while retrieving the default resource config
- */
- protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props,
- WebConfig wc) throws ServletException {
- return webComponent.getWebAppResourceConfig(props, wc);
- }
-
- /**
- * Configure the {@link ResourceConfig}.
- * <p>
- * The {@link ResourceConfig} is configured such that the following classes
- * may be injected onto the field of a root resource class or a parameter
- * of a method of root resource class that is annotated with
- * {@link javax.ws.rs.core.Context}: {@link HttpServletRequest}, {@link HttpServletResponse}
- * , {@link ServletContext} and {@link WebConfig}.
- * <p>
- * Any root resource class in registered in the resource configuration
- * that is an interface is processed as follows.
- * If the class is an interface and there exists a JNDI named object
- * with the fully qualified class name as the JNDI name then that named
- * object is added as a singleton root resource and the class is removed
- * from the set of root resource classes.
- * <p>
- * An inheriting class may override this method to configure the
- * {@link ResourceConfig} to provide alternative or additional instances
- * that are resource or provider classes or instances, and may modify the
- * features and properties of the {@link ResourceConfig}. For an inheriting
- * class to extend configuration behaviour the overriding method MUST call
- * <code>super.configure(servletConfig, rc, wa)</code> as the first statement
- * of that method.
- * <p>
- * This method will be called only once at initiation. Subsequent
- * reloads of the Web application will not result in subsequence calls to
- * this method.
- *
- * @param wc the Web configuration
- * @param rc the Resource configuration
- * @param wa the Web application
- */
- protected void configure(WebConfig wc, ResourceConfig rc, WebApplication wa) {
- if (getServletConfig() != null)
- configure(getServletConfig(), rc, wa);
- else if (filterConfig != null)
- configure(filterConfig, rc, wa);
-
- if (rc instanceof ReloadListener) {
- List<ContainerNotifier> notifiers = new ArrayList<ContainerNotifier>();
-
- Object o = rc.getProperties().get(ResourceConfig.PROPERTY_CONTAINER_NOTIFIER);
-
- if (o instanceof ContainerNotifier)
- notifiers.add((ContainerNotifier) o);
- else if (o instanceof List)
- for (Object elem : (List) o)
- if (elem instanceof ContainerNotifier)
- notifiers.add((ContainerNotifier) elem);
-
- for (ContainerNotifier cn : ServiceFinder.find(ContainerNotifier.class)) {
- notifiers.add(cn);
- }
-
- rc.getProperties().put(ResourceConfig.PROPERTY_CONTAINER_NOTIFIER, notifiers);
- }
- }
-
- /**
- * Initiate the {@link WebApplication}.
- * <p>
- * This method will be called once at initiation and for
- * each reload of the Web application.
- * <p>
- * An inheriting class may override this method to initiate the
- * Web application with different parameters.
- *
- * @param rc the Resource configuration
- * @param wa the Web application
- */
- protected void initiate(ResourceConfig rc, WebApplication wa) {
- wa.initiate(rc);
- }
-
- /**
- * Load the Web application. This will create, configure and initiate
- * the web application.
- */
- public void load() {
- webComponent.load();
- }
-
- /**
- * Reload the Web application. This will create and initiate the web
- * application using the same {@link ResourceConfig} implementation
- * that was used to load the Web application.
- * <p>
- * This method may be called at runtime, more than once, to reload the
- * Web application. For example, if a {@link ResourceConfig} implementation
- * is capable of detecting changes to resource classes (addition or removal)
- * or providers then this method may be invoked to reload the web
- * application for such changes to take effect.
- * <p>
- * If this method is called when there are pending requests then such
- * requests will be processed using the previously loaded web application.
- */
- public void reload() {
- webComponent.onReload();
- }
-
- /**
- * Dispatch client requests to a resource class.
- *
- * @param baseUri the base URI of the request.
- * @param requestUri the URI of the request.
- * @param request the {@link HttpServletRequest} object that
- * contains the request the client made to
- * the Web component.
- * @param response the {@link HttpServletResponse} object that
- * contains the response the Web component returns
- * to the client.
- * @return the status code of the response.
- * @exception IOException if an input or output error occurs
- * while the Web component is handling the
- * HTTP request.
- * @exception ServletException if the HTTP request cannot
- * be handled.
- */
- public int service(URI baseUri, URI requestUri, final HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- return webComponent.service(baseUri, requestUri, request, response);
- }
-
- /**
- * Destroy this Servlet or Filter.
- *
- */
- @Override
- public void destroy() {
- if (webComponent != null) {
- webComponent.destroy();
- }
- }
-
-
- // Servlet
-
- @Override
- public void init() throws ServletException {
- init(new WebServletConfig(this));
- }
-
- /**
- * Get the default resource configuration if one is not declared in the
- * web.xml.
- * <p>
- * This implementation returns an instance of {@link WebAppResourceConfig}
- * that scans in files and directories as declared by the
- * {@link ClasspathResourceConfig#PROPERTY_CLASSPATH} if present, otherwise
- * in the "WEB-INF/lib" and "WEB-INF/classes" directories.
- * <p>
- * An inheriting class may override this method to supply a different
- * default resource configuration implementation.
- *
- * @param props the properties to pass to the resource configuration.
- * @param servletConfig the servlet configuration.
- * @return the default resource configuration.
- *
- * @throws javax.servlet.ServletException in case there was an error while retrieving the default resource config
- * @deprecated methods should implement {@link #getDefaultResourceConfig(java.util.Map, com.sun.jersey.spi.container.servlet.WebConfig) }.
- */
- @Deprecated
- protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props,
- ServletConfig servletConfig) throws ServletException {
- return getDefaultResourceConfig(props, getWebConfig());
- }
-
- /**
- * Configure the {@link ResourceConfig} for a Servlet.
- * <p>
- * The {@link ResourceConfig} is configured such that the following classes
- * may be injected onto the field of a root resource class or a parameter
- * of a method of root resource class that is annotated with
- * {@link javax.ws.rs.core.Context}: {@link ServletConfig}.
- * <p>
- * An inheriting class may override this method to configure the
- * {@link ResourceConfig} to provide alternative or additional instances
- * that are resource or provider classes or instances, and may modify the
- * features and properties of the {@link ResourceConfig}. For an inheriting
- * class to extend configuration behaviour the overriding method MUST call
- * <code>super.configure(servletConfig, rc, wa)</code> as the first statement of that
- * method.
- * <p>
- * This method will be called only once at servlet initiation. Subsequent
- * reloads of the Web application will not result in subsequence calls to
- * this method.
- *
- * @param sc the Servlet configuration
- * @param rc the Resource configuration
- * @param wa the Web application
- */
- protected void configure(final ServletConfig sc, ResourceConfig rc, WebApplication wa) {
- rc.getSingletons().add(new ContextInjectableProvider<ServletConfig>(
- ServletConfig.class, sc));
- }
-
- /**
- * Dispatches client requests to the {@link #service(java.net.URI, java.net.URI, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) }
- * method.
- *
- * @param request the {@link HttpServletRequest} object that
- * contains the request the client made to
- * the servlet.
- * @param response the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client.
- * @exception IOException if an input or output error occurs
- * while the servlet is handling the
- * HTTP request.
- * @exception ServletException if the HTTP request cannot
- * be handled.
- */
- @Override
- public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- /**
- * There is an annoying edge case where the service method is
- * invoked for the case when the URI is equal to the deployment URL
- * minus the '/', for example http://locahost:8080/HelloWorldWebApp
- */
- final String servletPath = request.getServletPath();
- String pathInfo = request.getPathInfo();
- StringBuffer requestURL = request.getRequestURL();
- String requestURI = request.getRequestURI();
- final boolean checkPathInfo = pathInfo == null || pathInfo.isEmpty() || pathInfo.equals("/");
- final boolean checkServletPath = servletPath == null || servletPath.isEmpty();
- if (checkPathInfo && checkServletPath && !request.getRequestURI().endsWith("/")) {
- if (webComponent.getResourceConfig().getFeature(ResourceConfig.FEATURE_REDIRECT)) {
- URI l = UriBuilder.fromUri(request.getRequestURL().toString()).
- path("/").
- replaceQuery(request.getQueryString()).build();
-
- response.setStatus(307);
- response.setHeader("Location", l.toASCIIString());
- return;
- } else {
- pathInfo = "/";
- requestURL.append("/");
- requestURI += "/";
- }
- }
-
- /**
- * The HttpServletRequest.getRequestURL() contains the complete URI
- * minus the query and fragment components.
- */
- UriBuilder absoluteUriBuilder = UriBuilder.fromUri(
- requestURL.toString());
-
- /**
- * The HttpServletRequest.getPathInfo() and
- * HttpServletRequest.getServletPath() are in decoded form.
- *
- * On some servlet implementations the getPathInfo() removed
- * contiguous '/' characters. This is problematic if URIs
- * are embedded, for example as the last path segment.
- * We need to work around this and not use getPathInfo
- * for the decodedPath.
- */
- final String decodedBasePath = (pathInfo != null)
- ? request.getContextPath() + servletPath + "/"
- : request.getContextPath() + "/";
-
- final String encodedBasePath = UriComponent.encode(decodedBasePath,
- UriComponent.Type.PATH);
-
- if (!decodedBasePath.equals(encodedBasePath)) {
- throw new ContainerException("The servlet context path and/or the " +
- "servlet path contain characters that are percent encoded");
- }
-
- final URI baseUri = absoluteUriBuilder.replacePath(encodedBasePath).
- build();
-
- String queryParameters = request.getQueryString();
- if (queryParameters == null) {
- queryParameters = "";
- }
-
- final URI requestUri = absoluteUriBuilder.replacePath(requestURI).
- replaceQuery(queryParameters).
- build();
-
- service(baseUri, requestUri, request, response);
- }
-
-
- // Filter
-
- private String filterContextPath = null;
-
- public void init(FilterConfig filterConfig) throws ServletException {
- this.filterConfig = filterConfig;
-
- init(new WebFilterConfig(filterConfig));
- }
-
- /**
- * @return the {@link Pattern} compiled from a regular expression that is
- * the property value of {@link #PROPERTY_WEB_PAGE_CONTENT_REGEX}.
- * A <code>null</code> value will be returned if the property is not present
- * is or an empty String.
- */
- public Pattern getStaticContentPattern() {
- return staticContentPattern;
- }
-
- /**
- * Configure the {@link ResourceConfig} for a Filter.
- * <p>
- * The {@link ResourceConfig} is configured such that the following classes
- * may be injected onto the field of a root resource class or a parameter
- * of a method of root resource class that is annotated with
- * {@link javax.ws.rs.core.Context}: {@link FilterConfig}.
- * <p>
- * An inheriting class may override this method to configure the
- * {@link ResourceConfig} to provide alternative or additional instances
- * that are resource or provider classes or instances, and may modify the
- * features and properties of the {@link ResourceConfig}. For an inheriting
- * class to extend configuration behaviour the overriding method MUST call
- * <code>super.configure(servletConfig, rc, wa)</code> as the first statement of that
- * method.
- * <p>
- * This method will be called only once at servlet initiation. Subsequent
- * reloads of the Web application will not result in subsequence calls to
- * this method.
- *
- * @param fc the Filter configuration
- * @param rc the Resource configuration
- * @param wa the Web application
- */
- protected void configure(final FilterConfig fc, ResourceConfig rc, WebApplication wa) {
- rc.getSingletons().add(new ContextInjectableProvider<FilterConfig>(
- FilterConfig.class, fc));
-
- String regex = (String)rc.getProperty(PROPERTY_WEB_PAGE_CONTENT_REGEX);
- if (regex != null && regex.length() > 0) {
- try {
- staticContentPattern = Pattern.compile(regex);
- } catch (PatternSyntaxException ex) {
- throw new ContainerException(
- "The syntax is invalid for the regular expression, " + regex +
- ", associated with the initialization parameter " + PROPERTY_WEB_PAGE_CONTENT_REGEX, ex);
- }
- }
-
- forwardOn404 = rc.getFeature(FEATURE_FILTER_FORWARD_ON_404);
-
- this.filterContextPath = filterConfig.getInitParameter(PROPERTY_FILTER_CONTEXT_PATH);
- if (filterContextPath != null) {
- if (filterContextPath.isEmpty()) {
- filterContextPath = null;
- } else {
- if (!filterContextPath.startsWith("/")) {
- filterContextPath = '/' + filterContextPath;
- }
- if (filterContextPath.endsWith("/")) {
- filterContextPath = filterContextPath.substring(0, filterContextPath.length() - 1);
- }
- }
- }
- }
-
- /**
- * Dispatches client requests to the {@link #doFilter(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.FilterChain) }
- * method.
- *
- * @param request the {@link HttpServletRequest} object that
- * contains the request the client made to
- * the servlet.
- * @param response the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client.
- * @param chain the chain of filters from which the next filter can be invoked.
- * @throws java.io.IOException
- * @throws javax.servlet.ServletException
- */
- public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
- try {
- doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain);
- } catch (ClassCastException e) {
- throw new ServletException("non-HTTP request or response");
- }
- }
-
- /**
- * Dispatches client requests to the {@link #service(java.net.URI, java.net.URI, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) }
- * method.
- * <p>
- * If the servlet path matches the regular expression declared by the
- * property {@link #PROPERTY_WEB_PAGE_CONTENT_REGEX} then the request
- * is forwarded to the next filter in the filter chain so that the
- * underlying servlet engine can process the request otherwise Jersey
- * will process the request.
- *
- * @param request the {@link HttpServletRequest} object that
- * contains the request the client made to
- * the servlet.
- * @param response the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client.
- * @param chain the chain of filters from which the next filter can be invoked.
- * @throws java.io.IOException
- * @throws javax.servlet.ServletException
- */
- public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
- if (request.getAttribute("javax.servlet.include.request_uri") != null) {
- final String includeRequestURI = (String)request.getAttribute("javax.servlet.include.request_uri");
-
- if (!includeRequestURI.equals(request.getRequestURI())) {
- doFilter(request, response, chain,
- includeRequestURI,
- (String)request.getAttribute("javax.servlet.include.servlet_path"),
- (String)request.getAttribute("javax.servlet.include.query_string"));
- return;
- }
- }
-
- doFilter(request, response, chain,
- request.getRequestURI(),
- request.getServletPath(),
- request.getQueryString());
- }
-
- private void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain,
- String requestURI, String servletPath, String queryString) throws IOException, ServletException {
- // if we match the static content regular expression lets delegate to
- // the filter chain to use the default container servlets & handlers
- final Pattern p = getStaticContentPattern();
- if (p != null && p.matcher(servletPath).matches()) {
- chain.doFilter(request, response);
- return;
- }
-
- if (filterContextPath != null) {
- if (!servletPath.startsWith(filterContextPath)) {
- throw new ContainerException("The servlet path, \"" + servletPath +
- "\", does not start with the filter context path, \"" + filterContextPath + "\"");
- } else if (servletPath.length() == filterContextPath.length()) {
- // Path does not end in a slash, may need to redirect
- if (webComponent.getResourceConfig().getFeature(ResourceConfig.FEATURE_REDIRECT)) {
- URI l = UriBuilder.fromUri(request.getRequestURL().toString()).
- path("/").
- replaceQuery(queryString).build();
-
- response.setStatus(307);
- response.setHeader("Location", l.toASCIIString());
- return;
- } else {
- requestURI += "/";
- }
- }
- }
-
- final UriBuilder absoluteUriBuilder = UriBuilder.fromUri(
- request.getRequestURL().toString());
-
- final URI baseUri = (filterContextPath == null)
- ? absoluteUriBuilder.replacePath(request.getContextPath()).
- path("/").
- build()
- : absoluteUriBuilder.replacePath(request.getContextPath()).
- path(filterContextPath).
- path("/").
- build();
-
- final URI requestUri = absoluteUriBuilder.replacePath(requestURI).
- replaceQuery(queryString).
- build();
-
- final int status = service(baseUri, requestUri, request, response);
-
- // If forwarding is configured and response is a 404 with no entity
- // body then call the next filter in the chain
- if (forwardOn404 && status == 404 && !response.isCommitted()) {
- // lets clear the response to OK before we forward to the next in the chain
- // as OK is the default set by servlet containers before filters/servlets do any wor
- // so lets hide our footsteps and pretend we were never in the chain at all and let the
- // next filter or servlet return the 404 if they can't find anything to return
- //
- // We could add an optional flag to disable this step if anyone can ever find a case where
- // this causes a problem, though I suspect any problems will really be with downstream
- // servlets not correctly setting an error status if they cannot find something to return
- response.setStatus(HttpServletResponse.SC_OK);
- chain.doFilter(request, response);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebComponent.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebComponent.java
deleted file mode 100644
index 3b563563d6e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebComponent.java
+++ /dev/null
@@ -1,891 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container.servlet;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.container.MappableContainerException;
-import com.sun.jersey.api.core.ApplicationAdapter;
-import com.sun.jersey.api.core.ClasspathResourceConfig;
-import com.sun.jersey.api.core.PackagesResourceConfig;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.core.TraceInformation;
-import com.sun.jersey.api.core.WebAppResourceConfig;
-import com.sun.jersey.api.representation.Form;
-import com.sun.jersey.core.header.InBoundHeaders;
-import com.sun.jersey.core.header.MediaTypes;
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.util.ReaderWriter;
-import com.sun.jersey.server.impl.InitialContextHelper;
-import com.sun.jersey.server.impl.ThreadLocalInvoker;
-import com.sun.jersey.server.impl.application.DeferredResourceConfig;
-import com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer;
-import com.sun.jersey.server.impl.container.servlet.JSPTemplateProcessor;
-import com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer;
-import com.sun.jersey.server.impl.managedbeans.ManagedBeanComponentProviderFactoryInitilizer;
-import com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider;
-import com.sun.jersey.server.impl.monitoring.GlassFishMonitoringInitializer;
-import com.sun.jersey.server.probes.UriRuleProbeProvider;
-import com.sun.jersey.spi.container.ContainerListener;
-import com.sun.jersey.spi.container.ContainerNotifier;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseWriter;
-import com.sun.jersey.spi.container.ReloadListener;
-import com.sun.jersey.spi.container.WebApplication;
-import com.sun.jersey.spi.container.WebApplicationFactory;
-import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider;
-import com.sun.jersey.spi.monitoring.RequestListener;
-import com.sun.jersey.spi.monitoring.ResponseListener;
-
-import javax.naming.NamingException;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.GenericEntity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.SecurityContext;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.Type;
-import java.net.URI;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An abstract Web component that may be extended a Servlet and/or
- * Filter implementation, or encapsulated by a Servlet or Filter implementation.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WebComponent implements ContainerListener {
- /**
- * The servlet initialization property whose value is a fully qualified
- * class name of a class that implements {@link ResourceConfig} or
- * {@link Application}.
- */
- public static final String APPLICATION_CONFIG_CLASS =
- "javax.ws.rs.Application";
-
- /**
- * The servlet initialization property whose value is a fully qualified
- * class name of a class that implements {@link ResourceConfig} or
- * {@link Application}.
- */
- public static final String RESOURCE_CONFIG_CLASS =
- "com.sun.jersey.config.property.resourceConfigClass";
-
- /**
- * The base path in the Web Pages where JSP templates, associated with
- * viewables of resource classes, are located.
- * <p/>
- * If this property is not set then the base path will be the root path
- * of the Web Pages.
- */
- public static final String JSP_TEMPLATES_BASE_PATH =
- "com.sun.jersey.config.property.JSPTemplatesBasePath";
-
-
- private static final Logger LOGGER =
- Logger.getLogger(WebComponent.class.getName());
-
- private final ThreadLocalInvoker<HttpServletRequest> requestInvoker =
- new ThreadLocalInvoker<HttpServletRequest>();
-
- private final ThreadLocalInvoker<HttpServletResponse> responseInvoker =
- new ThreadLocalInvoker<HttpServletResponse>();
-
-
- private WebConfig config;
-
- private ResourceConfig resourceConfig;
-
- private boolean useSetStatusOn404 = false;
-
- private WebApplication application;
-
- public WebComponent() {
- }
-
- public WebComponent(Application app) {
- if (app == null)
- throw new IllegalArgumentException();
-
- if (app instanceof ResourceConfig) {
- resourceConfig = (ResourceConfig) app;
- } else {
- resourceConfig = new ApplicationAdapter(app);
- }
- }
-
- /**
- * Get the Web configuration.
- *
- * @return the Web configuration.
- */
- public WebConfig getWebConfig() {
- return config;
- }
-
- /**
- * Get the resource configuration.
- *
- * @return the resource configuration.
- */
- public ResourceConfig getResourceConfig() {
- return resourceConfig;
- }
-
- /**
- * Initiate the Web component.
- *
- * @param webConfig the Web configuration.
- * @throws javax.servlet.ServletException in case of any initialization error
- */
- public void init(WebConfig webConfig) throws ServletException {
- config = webConfig;
-
- if (resourceConfig == null)
- resourceConfig = createResourceConfig(config);
-
- if (config.getConfigType() == WebConfig.ConfigType.FilterConfig &&
- resourceConfig.getFeature(ServletContainer.FEATURE_FILTER_FORWARD_ON_404)) {
- useSetStatusOn404 = true;
- }
-
- load();
-
- Object o = resourceConfig.getProperties().get(
- ResourceConfig.PROPERTY_CONTAINER_NOTIFIER);
- if (o instanceof List) {
- List list = (List) o;
- for (Object elem : list) {
- if (elem instanceof ContainerNotifier) {
- ContainerNotifier crf = (ContainerNotifier) elem;
- crf.addListener(this);
- }
- }
- } else if (o instanceof ContainerNotifier) {
- ContainerNotifier crf = (ContainerNotifier) o;
- crf.addListener(this);
- }
- }
-
- /**
- * Destroy this Web component.
- * <p/>
- * This will destroy the Web application created by this this Web component.
- */
- public void destroy() {
- if (application != null)
- application.destroy();
- }
-
- private final static class Writer extends OutputStream implements ContainerResponseWriter {
- final HttpServletResponse response;
-
- final boolean useSetStatusOn404;
-
- ContainerResponse cResponse;
-
- long contentLength;
-
- OutputStream out;
-
- boolean statusAndHeadersWritten = false;
-
- Writer(boolean useSetStatusOn404, HttpServletResponse response) {
- this.useSetStatusOn404 = useSetStatusOn404;
- this.response = response;
- }
-
- public OutputStream writeStatusAndHeaders(long contentLength,
- ContainerResponse cResponse) throws IOException {
- this.contentLength = contentLength;
- this.cResponse = cResponse;
- this.statusAndHeadersWritten = false;
- return this;
- }
-
- public void finish() throws IOException {
- if (statusAndHeadersWritten)
- return;
-
- // Note that the writing of headers MUST be performed before
- // the invocation of sendError as on some Servlet implementations
- // modification of the response headers will have no effect
- // after the invocation of sendError.
- writeHeaders();
-
- if (cResponse.getStatus() >= 400) {
- if (useSetStatusOn404 && cResponse.getStatus() == 404) {
- response.setStatus(cResponse.getStatus());
- } else {
- final String reason = cResponse.getStatusType().getReasonPhrase();
- if (reason == null || reason.isEmpty()) {
- response.sendError(cResponse.getStatus());
- } else {
- response.sendError(cResponse.getStatus(), reason);
- }
- }
- } else {
- response.setStatus(cResponse.getStatus());
- }
- }
-
- public void write(int b) throws IOException {
- initiate();
- out.write(b);
- }
-
- @Override
- public void write(byte b[]) throws IOException {
- if (b.length > 0) {
- initiate();
- out.write(b);
- }
- }
-
- @Override
- public void write(byte b[], int off, int len) throws IOException {
- if (len > 0) {
- initiate();
- out.write(b, off, len);
- }
- }
-
- @Override
- public void flush() throws IOException {
- writeStatusAndHeaders();
- if (out != null)
- out.flush();
- }
-
- @Override
- public void close() throws IOException {
- initiate();
- out.close();
- }
-
- void initiate() throws IOException {
- if (out == null) {
- writeStatusAndHeaders();
- out = response.getOutputStream();
- }
- }
-
- void writeStatusAndHeaders() {
- if (statusAndHeadersWritten)
- return;
-
- writeHeaders();
- response.setStatus(cResponse.getStatus());
- statusAndHeadersWritten = true;
- }
-
- void writeHeaders() {
- if (contentLength != -1 && contentLength < Integer.MAX_VALUE)
- response.setContentLength((int) contentLength);
-
- MultivaluedMap<String, Object> headers = cResponse.getHttpHeaders();
- for (Map.Entry<String, List<Object>> e : headers.entrySet()) {
- for (Object v : e.getValue()) {
- response.addHeader(e.getKey(), ContainerResponse.getHeaderValue(v));
- }
- }
- }
- }
-
- /**
- * Dispatch client requests to a resource class.
- *
- * @param baseUri the base URI of the request.
- * @param requestUri the URI of the request.
- * @param request the {@link HttpServletRequest} object that
- * contains the request the client made to
- * the Web component.
- * @param response the {@link HttpServletResponse} object that
- * contains the response the Web component returns
- * to the client.
- * @return the status code of the response.
- * @throws IOException if an input or output error occurs
- * while the Web component is handling the
- * HTTP request.
- * @throws ServletException if the HTTP request cannot
- * be handled.
- */
- public int service(URI baseUri, URI requestUri,
- final HttpServletRequest request,
- final HttpServletResponse response)
- throws ServletException, IOException {
- // Copy the application field to local instance to ensure that the
- // currently loaded web application is used to process
- // request
- final WebApplication _application = application;
-
- final ContainerRequest cRequest = createRequest(
- _application,
- request,
- baseUri,
- requestUri);
-
- cRequest.setSecurityContext(new SecurityContext() {
- public Principal getUserPrincipal() {
- return request.getUserPrincipal();
- }
-
- public boolean isUserInRole(String role) {
- return request.isUserInRole(role);
- }
-
- public boolean isSecure() {
- return request.isSecure();
- }
-
- public String getAuthenticationScheme() {
- return request.getAuthType();
- }
- });
-
- // Check if any servlet filters have consumed a request entity
- // of the media type application/x-www-form-urlencoded
- // This can happen if a filter calls request.getParameter(...)
- filterFormParameters(request, cRequest);
-
- try {
- UriRuleProbeProvider.requestStart(requestUri);
-
- requestInvoker.set(request);
- responseInvoker.set(response);
-
- final Writer w = new Writer(useSetStatusOn404, response);
- _application.handleRequest(cRequest, w);
- return w.cResponse.getStatus();
- } catch (MappableContainerException ex) {
- traceOnException(cRequest, response);
- throw new ServletException(ex.getCause());
- } catch (ContainerException ex) {
- traceOnException(cRequest, response);
- // TODO: this needs to become generic (not servlet specific only)
- // responseListener.onError(Thread.currentThread().getId(), ex);
- throw new ServletException(ex);
- } catch (RuntimeException ex) {
- traceOnException(cRequest, response);
- // TODO: this needs to become generic (not servlet specific only)
- // responseListener.onError(Thread.currentThread().getId(), ex);
- throw ex;
- } finally {
- UriRuleProbeProvider.requestEnd();
- requestInvoker.set(null);
- responseInvoker.set(null);
- }
- }
-
- /**
- * Extension point for creating your custom container request.
- *
- * @param app the web app
- * @param request the current servlet api request
- * @param baseUri the base uri
- * @param requestUri the request uri
- * @return the request container
- * @throws IOException if any error occurs when getting the input stream
- */
- protected ContainerRequest createRequest(WebApplication app,
- HttpServletRequest request, URI baseUri, URI requestUri) throws IOException {
- return new ContainerRequest(
- app,
- request.getMethod(),
- baseUri,
- requestUri,
- getHeaders(request),
- request.getInputStream());
- }
-
- private void traceOnException(final ContainerRequest cRequest, final HttpServletResponse response) {
- if (cRequest.isTracingEnabled()) {
- final TraceInformation ti = (TraceInformation) cRequest.getProperties().
- get(TraceInformation.class.getName());
-
- ti.addTraceHeaders(new TraceInformation.TraceHeaderListener() {
- public void onHeader(String name, String value) {
- response.addHeader(name, value);
- }
- });
- }
- }
-
- /**
- * Create a new instance of a {@link WebApplication}.
- *
- * @return the {@link WebApplication} instance.
- */
- protected WebApplication create() {
- return WebApplicationFactory.createWebApplication();
- }
-
- /**
- * A helper class for creating an injectable provider that supports
- * {@link Context} with a type and constant value.
- *
- * @param <T> the type of the constant value.
- */
- protected static class ContextInjectableProvider<T> extends
- SingletonTypeInjectableProvider<Context, T> {
-
- /**
- * Create a new instance.
- *
- * @param type the type of the constant value.
- * @param instance the constant value.
- */
- protected ContextInjectableProvider(Type type, T instance) {
- super(type, instance);
- }
- }
-
- /**
- * Configure the {@link ResourceConfig}.
- * <p/>
- * The {@link ResourceConfig} is configured such that the following classes
- * may be injected onto the field of a root resource class or a parameter
- * of a method of root resource class that is annotated with
- * {@link javax.ws.rs.core.Context}: {@link HttpServletRequest}, {@link HttpServletResponse}
- * , {@link ServletContext} and {@link WebConfig}.
- * <p/>
- * Any root resource class in registered in the resource configuration
- * that is an interface is processed as follows.
- * If the class is an interface and there exists a JNDI named object
- * with the fully qualified class name as the JNDI name then that named
- * object is added as a singleton root resource and the class is removed
- * from the set of root resource classes.
- * <p/>
- * An inheriting class may override this method to configure the
- * {@link ResourceConfig} to provide alternative or additional instances
- * that are resource or provider classes or instances, and may modify the
- * features and properties of the {@link ResourceConfig}. For an inheriting
- * class to extend configuration behaviour the overriding method MUST call
- * <code>super.configure(servletConfig, rc, wa)</code> as the first statement
- * of that method.
- * <p/>
- * This method will be called only once at initiation. Subsequent
- * reloads of the Web application will not result in subsequence calls to
- * this method.
- *
- * @param wc the Web configuration
- * @param rc the Resource configuration
- * @param wa the Web application
- */
- protected void configure(WebConfig wc, ResourceConfig rc, WebApplication wa) {
- configureJndiResources(rc);
-
- rc.getSingletons().add(new ContextInjectableProvider<HttpServletRequest>(
- HttpServletRequest.class,
- (HttpServletRequest) Proxy.newProxyInstance(
- this.getClass().getClassLoader(),
- new Class[]{HttpServletRequest.class},
- requestInvoker)));
-
- rc.getSingletons().add(new ContextInjectableProvider<HttpServletResponse>(
- HttpServletResponse.class,
- (HttpServletResponse) Proxy.newProxyInstance(
- this.getClass().getClassLoader(),
- new Class[]{HttpServletResponse.class},
- responseInvoker)));
-
- GenericEntity<ThreadLocal<HttpServletRequest>> requestThreadLocal =
- new GenericEntity<ThreadLocal<HttpServletRequest>>(requestInvoker.getImmutableThreadLocal()) {
- };
- rc.getSingletons().add(new ContextInjectableProvider<ThreadLocal<HttpServletRequest>>(
- requestThreadLocal.getType(), requestThreadLocal.getEntity()));
-
- GenericEntity<ThreadLocal<HttpServletResponse>> responseThreadLocal =
- new GenericEntity<ThreadLocal<HttpServletResponse>>(responseInvoker.getImmutableThreadLocal()) {
- };
- rc.getSingletons().add(new ContextInjectableProvider<ThreadLocal<HttpServletResponse>>(
- responseThreadLocal.getType(), responseThreadLocal.getEntity()));
-
- rc.getSingletons().add(new ContextInjectableProvider<ServletContext>(
- ServletContext.class,
- wc.getServletContext()));
-
- rc.getSingletons().add(new ContextInjectableProvider<WebConfig>(
- WebConfig.class,
- wc));
-
- rc.getClasses().add(JSPTemplateProcessor.class);
-
- // TODO
- // If CDI is enabled should EJB injection be disabled?
- EJBComponentProviderFactoryInitilizer.initialize(rc);
-
- CDIComponentProviderFactoryInitializer.initialize(rc, wa);
-
- // TODO
- // If CDI is enabled then no need to initialize managed beans
- ManagedBeanComponentProviderFactoryInitilizer.initialize(rc);
-
- GlassFishMonitoringInitializer.initialize();
- }
-
- /**
- * Initiate the {@link WebApplication}.
- * <p/>
- * This method will be called once at initiation and for
- * each reload of the Web application.
- * <p/>
- * An inheriting class may override this method to initiate the
- * Web application with different parameters.
- *
- * @param rc the Resource configuration
- * @param wa the Web application
- */
- protected void initiate(ResourceConfig rc, WebApplication wa) {
- wa.initiate(rc);
- }
-
-
- /**
- * Load the Web application. This will create, configure and initiate
- * the web application.
- */
- public void load() {
- WebApplication _application = create();
- configure(config, resourceConfig, _application);
- initiate(resourceConfig, _application);
- application = _application;
- }
-
- /**
- * Get the default resource configuration if one is not declared in the
- * web.xml.
- * <p/>
- * This implementation returns an instance of {@link WebAppResourceConfig}
- * that scans in files and directories as declared by the
- * {@link ClasspathResourceConfig#PROPERTY_CLASSPATH} if present, otherwise
- * in the "WEB-INF/lib" and "WEB-INF/classes" directories.
- * <p/>
- * An inheriting class may override this method to supply a different
- * default resource configuration implementation.
- *
- * @param props the properties to pass to the resource configuration.
- * @param wc the web configuration.
- * @return the default resource configuration.
- * @throws javax.servlet.ServletException in case of any issues with providing \
- * the default resource configuration
- */
- protected ResourceConfig getDefaultResourceConfig(Map<String, Object> props,
- WebConfig wc) throws ServletException {
- return getWebAppResourceConfig(props, wc);
- }
-
-
- // ContainerListener
-
- /**
- * Reload the Web application. This will create and initiate the web
- * application using the same {@link ResourceConfig} implementation
- * that was used to load the Web application.
- * <p/>
- * This method may be called at runtime, more than once, to reload the
- * Web application. For example, if a {@link ResourceConfig} implementation
- * is capable of detecting changes to resource classes (addition or removal)
- * or providers then this method may be invoked to reload the web
- * application for such changes to take effect.
- * <p/>
- * If this method is called when there are pending requests then such
- * requests will be processed using the previously loaded web application.
- */
- public void onReload() {
- WebApplication oldApplication = application;
- WebApplication newApplication = create();
- initiate(resourceConfig, newApplication);
- application = newApplication;
-
- if (resourceConfig instanceof ReloadListener)
- ((ReloadListener) resourceConfig).onReload();
-
- oldApplication.destroy();
-
- }
-
-
- //
-
- /* package */ ResourceConfig getWebAppResourceConfig(Map<String, Object> props,
- WebConfig webConfig) throws ServletException {
- // Default to using Web app resource config
- return new WebAppResourceConfig(props, webConfig.getServletContext());
- }
-
- private ResourceConfig createResourceConfig(WebConfig webConfig)
- throws ServletException {
- final Map<String, Object> props = getInitParams(webConfig);
- final ResourceConfig rc = createResourceConfig(webConfig, props);
- rc.setPropertiesAndFeatures(props);
- return rc;
- }
-
- private ResourceConfig createResourceConfig(WebConfig webConfig, Map<String, Object> props)
- throws ServletException {
- // Check if the resource config class property is present
- String resourceConfigClassName = webConfig.getInitParameter(RESOURCE_CONFIG_CLASS);
- // Otherwise check if the JAX-RS application config class property is
- // present
- if (resourceConfigClassName == null)
- resourceConfigClassName = webConfig.getInitParameter(APPLICATION_CONFIG_CLASS);
-
- // If no resource config class property is present
- if (resourceConfigClassName == null) {
- // If the packages property is present then
- // use the packages resource config
- String packages = webConfig.getInitParameter(
- PackagesResourceConfig.PROPERTY_PACKAGES);
- if (packages != null) {
- props.put(PackagesResourceConfig.PROPERTY_PACKAGES, packages);
- return new PackagesResourceConfig(props);
- }
-
- ResourceConfig defaultConfig = webConfig.getDefaultResourceConfig(props);
- if (defaultConfig != null)
- return defaultConfig;
-
- return getDefaultResourceConfig(props, webConfig);
- }
-
- try {
- Class<?> resourceConfigClass = ReflectionHelper.
- classForNameWithException(resourceConfigClassName);
-
- // TODO add support for WebAppResourceConfig
- if (resourceConfigClass == ClasspathResourceConfig.class) {
- String[] paths = getPaths(webConfig.getInitParameter(
- ClasspathResourceConfig.PROPERTY_CLASSPATH));
- props.put(ClasspathResourceConfig.PROPERTY_CLASSPATH, paths);
- return new ClasspathResourceConfig(props);
- } else if (ResourceConfig.class.isAssignableFrom(resourceConfigClass)) {
- try {
- Constructor constructor = resourceConfigClass.getConstructor(Map.class);
- if (ClasspathResourceConfig.class.isAssignableFrom(resourceConfigClass)) {
- String[] paths = getPaths(webConfig.getInitParameter(
- ClasspathResourceConfig.PROPERTY_CLASSPATH));
- props.put(ClasspathResourceConfig.PROPERTY_CLASSPATH, paths);
- }
- return (ResourceConfig) constructor.newInstance(props);
- } catch (NoSuchMethodException ex) {
- // Pass through and try the default constructor
- } catch (Exception e) {
- throw new ServletException(e);
- }
-
- return new DeferredResourceConfig(resourceConfigClass.asSubclass(ResourceConfig.class));
- } else if (Application.class.isAssignableFrom(resourceConfigClass)) {
- return new DeferredResourceConfig(resourceConfigClass.asSubclass(Application.class));
- } else {
- String message = "Resource configuration class, " + resourceConfigClassName +
- ", is not a super class of " + Application.class;
- throw new ServletException(message);
- }
- } catch (ClassNotFoundException e) {
- String message = "Resource configuration class, " + resourceConfigClassName +
- ", could not be loaded";
- throw new ServletException(message, e);
- }
- }
-
- private Map<String, Object> getInitParams(WebConfig webConfig) {
- Map<String, Object> props = new HashMap<String, Object>();
- Enumeration names = webConfig.getInitParameterNames();
- while (names.hasMoreElements()) {
- String name = (String) names.nextElement();
- props.put(name, webConfig.getInitParameter(name));
- }
- return props;
- }
-
- private String[] getPaths(String classpath) throws ServletException {
- final ServletContext context = config.getServletContext();
- if (classpath == null) {
- String[] paths = {
- context.getRealPath("/WEB-INF/lib"),
- context.getRealPath("/WEB-INF/classes")
- };
- if (paths[0] == null && paths[1] == null) {
- String message = "The default deployment configuration that scans for " +
- "classes in /WEB-INF/lib and /WEB-INF/classes is not supported " +
- "for the application server." +
- "Try using the package scanning configuration, see the JavaDoc for " +
- PackagesResourceConfig.class.getName() + " and the property " +
- PackagesResourceConfig.PROPERTY_PACKAGES + ".";
- throw new ServletException(message);
- }
- return paths;
- } else {
- String[] virtualPaths = classpath.split(";");
- List<String> resourcePaths = new ArrayList<String>();
- for (String virtualPath : virtualPaths) {
- virtualPath = virtualPath.trim();
- if (virtualPath.length() == 0) continue;
- String path = context.getRealPath(virtualPath);
- if (path != null) resourcePaths.add(path);
- }
- if (resourcePaths.isEmpty()) {
- String message = "None of the declared classpath locations, " +
- classpath +
- ", could be resolved. " +
- "This could be because the default deployment configuration that scans for " +
- "classes in classpath locations is not supported. " +
- "Try using the package scanning configuration, see the JavaDoc for " +
- PackagesResourceConfig.class.getName() + " and the property " +
- PackagesResourceConfig.PROPERTY_PACKAGES + ".";
- throw new ServletException(message);
- }
- return resourcePaths.toArray(new String[resourcePaths.size()]);
- }
- }
-
- private void configureJndiResources(ResourceConfig rc) {
- // Obtain any instances that are registered in JNDI
- // Assumes such instances are singletons
- // Registered classes have to be interfaces
- javax.naming.Context x = InitialContextHelper.getInitialContext();
- if (x != null) {
- Iterator<Class<?>> i = rc.getClasses().iterator();
- while (i.hasNext()) {
- Class<?> c = i.next();
- if (!c.isInterface()) continue;
-
- try {
- Object o = x.lookup(c.getName());
- if (o != null) {
- i.remove();
- rc.getSingletons().add(o);
- LOGGER.log(Level.INFO,
- "An instance of the class " + c.getName() +
- " is found by JNDI look up using the class name as the JNDI name. " +
- "The instance will be registered as a singleton.");
- }
- } catch (NamingException ex) {
- LOGGER.log(Level.CONFIG,
- "JNDI lookup failed for Jersey application resource " + c.getName(),
- ex);
- }
- }
- }
- }
-
- private void filterFormParameters(HttpServletRequest hsr, ContainerRequest cr) throws IOException {
- if (cr.getMethod().equals("POST")
- && MediaTypes.typeEquals(MediaType.APPLICATION_FORM_URLENCODED_TYPE, cr.getMediaType())
- && !isEntityPresent(cr)) {
- Form f = new Form();
-
- Enumeration e = hsr.getParameterNames();
- while (e.hasMoreElements()) {
- String name = (String) e.nextElement();
- String[] values = hsr.getParameterValues(name);
-
- f.put(name, Arrays.asList(values));
- }
-
- if (!f.isEmpty()) {
- cr.getProperties().put(FormDispatchProvider.FORM_PROPERTY, f);
- if (LOGGER.isLoggable(Level.WARNING)) {
- LOGGER.log(Level.WARNING,
- "A servlet POST request, to the URI " + cr.getRequestUri() + ", " +
- "contains form parameters in " +
- "the request body but the request body has been consumed " +
- "by the servlet or a servlet filter accessing the request " +
- "parameters. Only resource methods using @FormParam " +
- "will work as expected. Resource methods consuming the " +
- "request body by other means will not work as expected.");
- }
- }
- }
- }
-
- private boolean isEntityPresent(ContainerRequest cr) throws IOException {
- InputStream in = cr.getEntityInputStream();
- if (!in.markSupported()) {
- in = new BufferedInputStream(in, ReaderWriter.BUFFER_SIZE);
- cr.setEntityInputStream(in);
- }
-
- in.mark(1);
- if (in.read() == -1)
- return false;
- else {
- in.reset();
- return true;
- }
- }
-
- private InBoundHeaders getHeaders(HttpServletRequest request) {
- InBoundHeaders rh = new InBoundHeaders();
-
- for (Enumeration<String> names = request.getHeaderNames(); names.hasMoreElements();) {
- String name = names.nextElement();
- List<String> valueList = new LinkedList<String>();
- for (Enumeration<String> values = request.getHeaders(name); values.hasMoreElements();) {
- valueList.add(values.nextElement());
- }
- rh.put(name, valueList);
- }
-
- return rh;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebConfig.java
deleted file mode 100644
index 095ee61514c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebConfig.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.container.servlet;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import java.util.Enumeration;
-import java.util.Map;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-/**
- * The Web configuration for accessing initialization parameters of a Web
- * component and the {@link ServletContext}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface WebConfig {
-
- /**
- * The web configuration type.
- */
- public static enum ConfigType {
- /**
- * A configuration type of servlet configuration.
- */
- ServletConfig,
- /**
- * A configuration type of filter configuration.
- */
- FilterConfig
- };
-
- /**
- * Get the configuration type of this config.
- *
- * @return the configuration type.
- */
- ConfigType getConfigType();
-
- /**
- * Get the name of the Web component.
- *
- * @return the name of the Web component.
- */
- String getName();
-
- /**
- * Get an initialization parameter.
- *
- * @param name the parameter name.
- * @return the parameter value, or null if the parameter is not present.
- */
- String getInitParameter(String name);
-
- /**
- * Get the enumeration of initialization parameter names.
- *
- * @return the enumeration of initialization parameter names.
- */
- Enumeration getInitParameterNames();
-
- /**
- * Get the {@link ServletContext}.
- *
- * @return the {@link ServletContext}.
- */
- ServletContext getServletContext();
-
- /**
- * Get the default {@link ResourceConfig}.
- *
- * @param props the map of properties.
- *
- * @return the default {@link ResourceConfig}.
- * @throws javax.servlet.ServletException
- */
- ResourceConfig getDefaultResourceConfig(Map<String, Object> props) throws ServletException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebFilterConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebFilterConfig.java
deleted file mode 100644
index adc0318d2bd..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebFilterConfig.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container.servlet;
-
-import java.util.Enumeration;
-import java.util.Map;
-
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-import com.sun.jersey.api.core.ResourceConfig;
-
-/**
- * A filter based web config. Delegates all invocations to the filter
- * configuration from the servlet api.
- *
- * @author Paul Sandoz
- * @author guilherme silveira
- */
-public class WebFilterConfig implements WebConfig {
-
- private final FilterConfig filterConfig;
-
- public WebFilterConfig(FilterConfig filterConfig) {
- this.filterConfig = filterConfig;
- }
-
- public WebConfig.ConfigType getConfigType() {
- return WebConfig.ConfigType.FilterConfig;
- }
-
- public String getName() {
- return filterConfig.getFilterName();
- }
-
- public String getInitParameter(String name) {
- return filterConfig.getInitParameter(name);
- }
-
- public Enumeration getInitParameterNames() {
- return filterConfig.getInitParameterNames();
- }
-
- public ServletContext getServletContext() {
- return filterConfig.getServletContext();
- }
-
- public ResourceConfig getDefaultResourceConfig(Map<String, Object> props)
- throws ServletException {
- return null;
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebServletConfig.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebServletConfig.java
deleted file mode 100644
index b94202c02eb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/WebServletConfig.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.container.servlet;
-
-import java.util.Enumeration;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-import com.sun.jersey.api.core.ResourceConfig;
-
-/**
- * A servlet based web config. Delegates all invocations to the servlet
- * configuration from the servlet api.
- *
- * @author Paul Sandoz
- * @author guilherme silveira
- */
-public class WebServletConfig implements WebConfig {
-
- private final ServletContainer servlet;
-
- public WebServletConfig(ServletContainer servlet) {
- this.servlet = servlet;
- }
-
- public WebConfig.ConfigType getConfigType() {
- return WebConfig.ConfigType.ServletConfig;
- }
-
- public String getName() {
- return servlet.getServletName();
- }
-
- public String getInitParameter(String name) {
- return servlet.getInitParameter(name);
- }
-
- public Enumeration getInitParameterNames() {
- return servlet.getInitParameterNames();
- }
-
- public ServletContext getServletContext() {
- return servlet.getServletContext();
- }
-
- public ResourceConfig getDefaultResourceConfig(Map<String, Object> props)
- throws ServletException {
- return servlet.getDefaultResourceConfig(props, servlet.getServletConfig());
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/package-info.java
deleted file mode 100644
index 9c6c7306d8b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/container/servlet/package-info.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for servlet-based and filter-based Web applications.
- * <p>
- * Web application support is enabled by referencing the servlet
- * {@link com.sun.jersey.spi.container.servlet.ServletContainer} in the
- * web.xml.
- * <p>
- * For example, the following will deploy Jersey and automatically
- * register any root resource or provider classes present in the directory
- * "/WEB-INF/classes" or jar files present in the directory "/WEB-INF/lib":
- * <blockquote><pre>
- * &lt;web-app&gt;
- * &lt;servlet&gt;
- * &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
- * &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
- * &lt;/servlet&gt;
- * &lt;servlet-mapping&gt;
- * &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
- * &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
- * &lt;/servlet-mapping&gt;
- * &lt;/web-app&gt;
- * </blockquote></pre>
- * <p>
- * A deployment approach, that is more portable with respect to maven and
- * application servers, is to declare the package names where root resource and provider
- * classes reside. For example, the following will deploy Jersey and
- * automatically register any root resource or provider classes present
- * in the package "managed", or any sub-packages.
- * <blockquote><pre>
- * &lt;web-app&gt;
- * &lt;servlet&gt;
- * &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
- * &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
- * &lt;param-value&gt;managed&lt;/param-value&gt;
- * &lt;/init-param>
- * &lt;/servlet&gt;
- * &lt;servlet-mapping&gt;
- * &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
- * &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
- * &lt;/servlet-mapping&gt;
- * &lt;/web-app&gt;
- * </blockquote></pre>
- * The deployment approach that is portable accross JAX-RS implementations is to
- * register an implementation of {@link javax.ws.rs.core.Application}. For
- * example given an implementation as follows:
- * <blockquote><pre>
- * package com.foo;
- *
- * import ...
- *
- * public class MyApplicaton extends Application {
- * public Set&lt;Class&lt;?&gt;&gt; getClasses() {
- * Set&lt;Class&lt;?&gt;&gt; s = new HashSet&lt;Class&lt;?&gt;&gt;();
- * s.add(HelloWorldResource.class);
- * return s;
- * }
- * }
- * </blockquote></pre>
- * then that implementation can be registered as follows:
- * <blockquote><pre>
- * &lt;web-app&gt;
- * &lt;servlet&gt;
- * &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
- * &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
- * &lt;init-param&gt;
- * &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;
- * &lt;param-value&gt;com.foo.MyApplication&lt;/param-value&gt;
- * &lt;/init-param>
- * &lt;/servlet&gt;
- * &lt;servlet-mapping&gt;
- * &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
- * &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
- * &lt;/servlet-mapping&gt;
- * &lt;/web-app&gt;
- * </blockquote></pre>
- * It is possible to combine package-based registration and
- * {@link javax.ws.rs.core.Application}
- * registered by extending {@link com.sun.jersey.api.core.PackagesResourceConfig}
- * and registering the extended class, for example:
- * <blockquote><pre>
- * public class MyApplication extends PackagesResourceConfig {
- * public MyApplication() {
- * super("org.foo.rest;org.bar.rest");
- * }
- * }
- * </blockquote></pre>
- * The above examples apply to Servlet-based configurations but they equally
- * applicable to Filter-based configurations. For example, the following
- * presents the same package-based configuration as above but utilizing a filter:
- * <blockquote><pre>
- * &lt;web-app&gt;
- * &lt;filter&gt;
- * &lt;filter-name&gt;Jersey Web Application&lt;/filter-name&gt;
- * &lt;filter-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/filter-class&gt;
- * &lt;init-param&gt;
- * &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
- * &lt;param-value&gt;managed&lt;/param-value&gt;
- * &lt;/init-param>
- * &lt;/filter&gt;
- * &lt;filter-mapping&gt;
- * &lt;filter-name&gt;Jersey Web Application&lt;/filter-name&gt;
- * &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
- * &lt;/filter-mapping&gt;
- * &lt;/web-app&gt;
- * </blockquote></pre>
- *
- */
-package com.sun.jersey.spi.container.servlet;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/RequestDispatcher.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/RequestDispatcher.java
deleted file mode 100644
index a9338a03013..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/RequestDispatcher.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.dispatch;
-
-import com.sun.jersey.api.core.HttpContext;
-
-/**
- * A resource method dispatcher.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface RequestDispatcher {
- /**
- * Dispatch to the resource method of the resource class instance.
- *
- * @param resource the resource class instance.
- * @param context the HTTP context.
- */
- public void dispatch(Object resource, HttpContext context);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/package-info.java
deleted file mode 100644
index fded9caaaf5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/dispatch/package-info.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for dispatching the HTTP request to a resource method
- * of a resource class instance.
- */
-package com.sun.jersey.spi.dispatch;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ClientSide.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ClientSide.java
deleted file mode 100644
index 609a3f315f3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ClientSide.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.inject;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ClientSide extends ConstrainedToType { } \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedTo.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedTo.java
deleted file mode 100644
index 7665fe09ef0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedTo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.inject;
-
-
-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(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface ConstrainedTo {
- Class<? extends ConstrainedToType> value();
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedToType.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedToType.java
deleted file mode 100644
index 4bc39fbefe6..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ConstrainedToType.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.inject;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class ConstrainedToType { } \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Errors.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Errors.java
deleted file mode 100644
index cb4437ad0eb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Errors.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.inject;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-/**
- * TODO do not use static thread local?
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class Errors {
-
- public static class ErrorMessagesException extends RuntimeException {
- public final List<ErrorMessage> messages;
-
- private ErrorMessagesException(List<ErrorMessage> messages) {
- this.messages = messages;
- }
- }
-
- public static class ErrorMessage {
-
- final String message;
-
- final boolean isFatal;
-
- private ErrorMessage(String message, boolean isFatal) {
- this.message = message;
- this.isFatal = isFatal;
- }
-
- @Override
- public int hashCode() {
- int hash = 3;
- hash = 37 * hash + (this.message != null ? this.message.hashCode() : 0);
- hash = 37 * hash + (this.isFatal ? 1 : 0);
- return hash;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final ErrorMessage other = (ErrorMessage) obj;
- if ((this.message == null) ? (other.message != null) : !this.message.equals(other.message)) {
- return false;
- }
- if (this.isFatal != other.isFatal) {
- return false;
- }
- return true;
- }
- }
-
- private final ArrayList<ErrorMessage> messages = new ArrayList<ErrorMessage>(0);
-
- private int mark = -1;
-
- private int stack = 0;
-
- private boolean fieldReporting = true;
-
- private void _mark() {
- mark = messages.size();
- }
-
- private void _unmark() {
- mark = -1;
- }
-
- private void _reset() {
- if (mark >= 0 && mark < messages.size()) {
- messages.subList(mark, messages.size()).clear();
- _unmark();
- }
- }
-
- private void preProcess() {
- stack++;
- }
-
- private void postProcess(boolean throwException) {
- stack--;
- fieldReporting = true;
-
- if (stack == 0) {
- try {
- if (!messages.isEmpty()) {
- processErrorMessages(throwException, messages);
- }
- } finally {
- errors.remove();
- }
- }
- }
-
- private static final Logger LOGGER = Logger.getLogger(Errors.class.getName());
-
- private static void processErrorMessages(boolean throwException, List<ErrorMessage> messages) {
- final StringBuilder sb = new StringBuilder();
- boolean isFatal = false;
- for (ErrorMessage em : messages) {
- if (sb.length() > 0) {
- sb.append("\n");
- }
-
- sb.append(" ");
-
- if (em.isFatal) {
- sb.append("SEVERE: ");
- } else {
- sb.append("WARNING: ");
- }
- isFatal |= em.isFatal;
-
- sb.append(em.message);
- }
-
- final String message = sb.toString();
- if (isFatal) {
- LOGGER.severe("The following errors and warnings have been detected with resource and/or provider classes:\n" + message);
- if (throwException) {
- throw new ErrorMessagesException(new ArrayList<ErrorMessage>(messages));
- }
- } else {
- LOGGER.warning("The following warnings have been detected with resource and/or provider classes:\n" + message);
- }
- }
-
- private static ThreadLocal<Errors> errors = new ThreadLocal<Errors>();
-
- public static interface Closure<T> {
- public T f();
- }
-
- public static <T> T processWithErrors(Closure<T> c) {
- Errors e = errors.get();
- if (e == null) {
- e = new Errors();
- errors.set(e);
- }
- e.preProcess();
-
- RuntimeException caught = null;
- try {
- return c.f();
- } catch (RuntimeException re) {
- // If a runtime exception is caught then report errors and
- // rethrow
- caught = re;
- } finally {
- e.postProcess(caught == null);
- }
-
- throw caught;
- }
-
- private static Errors getInstance() {
- Errors e = errors.get();
- // No error processing in scope
- if (e == null) {
- throw new IllegalStateException("There is no error processing in scope");
- }
- // The following should not be necessary but given the fragile nature of
- // static thread local probably best to add it in case some internals of
- // this class change
- if (e.stack == 0) {
- errors.remove();
- throw new IllegalStateException("There is no error processing in scope");
- }
- return e;
- }
-
- public static void mark() {
- getInstance()._mark();
- }
-
- public static void unmark() {
- getInstance()._unmark();
- }
-
- public static void reset() {
- getInstance()._reset();
- }
-
- public static void error(String message) {
- error(message, true);
- }
-
- public static void error(String message, boolean isFatal) {
- final ErrorMessage em = new ErrorMessage(message, isFatal);
- getInstance().messages.add(em);
- }
-
- public int numberOfErrors() {
- return getInstance().messages.size();
- }
-
- public static void innerClass(Class c) {
- error("The inner class " + c.getName() + " is not a static inner class and cannot be instantiated.");
- }
-
- public static void nonPublicClass(Class c) {
- error("The class " + c.getName() + " is a not a public class and cannot be instantiated.");
- }
-
- public static void nonPublicConstructor(Class c) {
- error("The class " + c.getName() + " does not have a public constructor and cannot be instantiated.");
- }
-
- public static void abstractClass(Class c) {
- error("The class " + c.getName() + " is an abstract class and cannot be instantiated.");
- }
-
- public static void interfaceClass(Class c) {
- error("The class " + c.getName() + " is an interface and cannot be instantiated.");
- }
-
- public static void missingDependency(Constructor ctor, int i) {
- error("Missing dependency for constructor " + ctor + " at parameter index " + i);
- }
-
- public static void setReportMissingDependentFieldOrMethod(boolean fieldReporting) {
- getInstance().fieldReporting = fieldReporting;
- }
-
- public static boolean getReportMissingDependentFieldOrMethod() {
- return getInstance().fieldReporting;
- }
-
- public static void missingDependency(Field f) {
- if (getReportMissingDependentFieldOrMethod()) {
- error("Missing dependency for field: " + f.toGenericString());
- }
- }
-
- public static void missingDependency(Method m, int i) {
- if (getReportMissingDependentFieldOrMethod()) {
- error("Missing dependency for method " + m + " at parameter at index " + i);
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Inject.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Inject.java
deleted file mode 100644
index 09a18162c78..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Inject.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.inject;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Used to annotate fields or parameters that shall be injected with
- * resource class instances or instances obtained from registered
- * IoC component provider factories (if any).
- * <p>
- * If the name of instance to inject is not recognized or there is no IoC
- * component provider factory registered then no injection will occur.
- *
- * @deprecated see {@link com.sun.jersey.api.core.InjectParam}
- *
- * @author <a href="mailto:martin.grotzke@freiheit.com">Martin Grotzke</a>
- */
-@Target({PARAMETER, METHOD, FIELD})
-@Retention(RUNTIME)
-@Documented
-@Deprecated
-public @interface Inject {
- /**
- * @return the name of the object to inject, by default the name
- * is the class name of the type that is injected.
- */
- String value() default "";
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Injectable.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Injectable.java
deleted file mode 100644
index 07637eb9ce4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/Injectable.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.inject;
-
-/**
- * The type of something that is injectable.
- *
- * @param <T> the type of the value to be injected
- * @author Paul.Sandoz@Sun.Com
- */
-public interface Injectable<T> {
- /**
- * Get the injectable value.
- *
- * @return the injectable value
- */
- T getValue();
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProvider.java
deleted file mode 100644
index 1ef7ad746ce..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.inject;
-
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.annotation.Annotation;
-
-/**
- * An injectable provider provides an injectable which in turn may be used
- * to obtain the instance to inject onto a field, bean setter method, parameter
- * of a constructor, or parameter of a method.
- *
- * @param <A> the annotation type
- * @param <C> the context type. Types of the {@link java.lang.reflect.Type} and
- * {@link com.sun.jersey.api.model.Parameter} are the only types that
- * are supported.
- * @author Paul.Sandoz@Sun.Com
- */
-public interface InjectableProvider<A extends Annotation, C> {
-
- /**
- * Get the scope of the injectable provider.
- *
- * @return the scope.
- */
- ComponentScope getScope();
-
- /**
- * Get an injectable.
- *
- * @param ic the injectable context
- * @param a the annotation instance
- * @param c the context instance
- * @return an Injectable instance, otherwise null if an instance cannot
- * be created.
- */
- Injectable getInjectable(ComponentContext ic, A a, C c);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProviderContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProviderContext.java
deleted file mode 100644
index 0ff4376d483..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/InjectableProviderContext.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.inject;
-
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.annotation.Annotation;
-import java.util.List;
-
-/**
- * The context to obtain {@link Injectable} instances.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface InjectableProviderContext {
-
- /**
- * Check if an annotation and context type is registered for injection.
- *
- * @param ac the annotation class.
- * @param cc the context type.
- * @return true if registered, otherwise false
- */
- public boolean isAnnotationRegistered(Class<? extends Annotation> ac,
- Class<?> cc);
-
- /*
- * Check if one or more injectable provider is registered to process an
- * annotation and a context type for a given scope.
- *
- * @param ac the annotation class.
- * @param cc the context type.
- * @param s the scope.
- * @return true if one or more injectable provider is registered,
- * otherwise false.
- */
- boolean isInjectableProviderRegistered(Class<? extends Annotation> ac,
- Class<?> cc,
- ComponentScope s);
-
- /**
- * Get an injectable.
- *
- * @param <A> the type of the annotation.
- * @param <C> the context type. Types of the {@link java.lang.reflect.Type} and
- * {@link com.sun.jersey.api.model.Parameter} are the only types that
- * are supported.
- * @param ac the annotation class.
- * @param ic the injectable context.
- * @param a the annotation instance.
- * @param c the context type.
- * @param s the scope.
- * @return the injectable, otherwise null if an injectable could
- * not be found.
- */
- <A extends Annotation, C> Injectable getInjectable(
- Class<? extends Annotation> ac,
- ComponentContext ic,
- A a,
- C c,
- ComponentScope s);
-
- /**
- * Get an injectable.
- *
- * @param <A> the type of the annotation.
- * @param <C> the context type. Types of the {@link java.lang.reflect.Type} and
- * {@link com.sun.jersey.api.model.Parameter} are the only types that
- * are supported.
- * @param ac the annotation class.
- * @param ic the injectable context.
- * @param a the annotation instance.
- * @param c the context type.
- * @param ls the list of scope, ordered by preference.
- * @return the injectable, otherwise null if an injectable could
- * not be found.
- */
- <A extends Annotation, C> Injectable getInjectable(
- Class<? extends Annotation> ac,
- ComponentContext ic,
- A a,
- C c,
- List<ComponentScope> ls);
-
- public static final class InjectableScopePair {
- public final Injectable i;
- public final ComponentScope cs;
-
- public InjectableScopePair(Injectable i, ComponentScope cs) {
- this.i = i;
- this.cs = cs;
- }
- }
-
- /**
- * Get an injectable.
- *
- * @param <A> the type of the annotation.
- * @param <C> the context type. Types of the {@link java.lang.reflect.Type} and
- * {@link com.sun.jersey.api.model.Parameter} are the only types that
- * are supported.
- * @param ac the annotation class.
- * @param ic the injectable context.
- * @param a the annotation instance.
- * @param c the context type.
- * @param ls the list of scope, ordered by preference.
- * @return the injectable and scope, otherwise null if an injectable could
- * not be found.
- */
- <A extends Annotation, C> InjectableScopePair getInjectableWithScope(
- Class<? extends Annotation> ac,
- ComponentContext ic,
- A a,
- C c,
- List<ComponentScope> ls);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.java
deleted file mode 100644
index aa83e533bca..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.sun.jersey.spi.inject;
-
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * A utility class that may implemented to support a per-request injectable
- * provider for a specific type T.
- *
- * @param <A> the annotation type
- * @param <T> the type returned by {@link Injectable#getValue}
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class PerRequestTypeInjectableProvider <A extends Annotation, T>
- implements InjectableProvider<A, Type> {
-
- private final Type t;
-
- /**
- * Construct a new instance with the Type
- *
- * @param t the type of T.
- */
- public PerRequestTypeInjectableProvider(Type t) {
- this.t = t;
- }
-
- public final ComponentScope getScope() {
- return ComponentScope.PerRequest;
- }
-
- public final Injectable getInjectable(ComponentContext ic, A a, Type c) {
- if (c.equals(t)) {
- return getInjectable(ic, a);
- } else
- return null;
- }
-
- /**
- * Get an injectable for type T.
- *
- * @param ic the injectable context
- * @param a the annotation instance
- * @return an Injectable instance, otherwise null if an instance cannot
- * be created.
- */
- public abstract Injectable<T> getInjectable(ComponentContext ic, A a);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ServerSide.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ServerSide.java
deleted file mode 100644
index 8b306f9af01..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/ServerSide.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.inject;
-
-/**
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class ServerSide extends ConstrainedToType { } \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.java
deleted file mode 100644
index 34bd7474519..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.inject;
-
-import com.sun.jersey.core.spi.component.ComponentContext;
-import com.sun.jersey.core.spi.component.ComponentScope;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-
-/**
- * A utility class that may implemented to support a singleton injectable
- * provider for a specific type T, and an instance of type T, that is to be
- * injected.
- *
- * @param <A> the annotation type
- * @param <T> the type returned by {@link Injectable#getValue}
- * @author Paul.Sandoz@Sun.Com
- */
-public abstract class SingletonTypeInjectableProvider<A extends Annotation, T>
- implements InjectableProvider<A, Type>, Injectable<T> {
-
- private final Type t;
- private final T instance;
-
- /**
- * Construct a new instance with the Type and the instance.
- *
- * @param t the type of T.
- * @param instance the instance.
- */
- public SingletonTypeInjectableProvider(Type t, T instance) {
- this.t = t;
- this.instance = instance;
- }
-
- public final ComponentScope getScope() {
- return ComponentScope.Singleton;
- }
-
- public final Injectable<T> getInjectable(ComponentContext ic, A a, Type c) {
- if (c.equals(t)) {
- return this;
- } else
- return null;
- }
-
- public final T getValue() {
- return instance;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/package-info.java
deleted file mode 100644
index 4f61a7a0b45..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/inject/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for injection onto resource and provider classes.
- */
-package com.sun.jersey.spi.inject;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListener.java
deleted file mode 100644
index 0eee2443917..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListener.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.monitoring;
-
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.model.AbstractSubResourceLocator;
-
-/**
- * @author @author Marek Potociar (marek.potociar at oracle.com)
- */
-public interface DispatchingListener {
-
- /**
- * Called when Jersey finds suitable sub resource which will
- * be used during request processing.
- *
- * @param id Context ID.
- * @param subResource class representing matched sub resource.
- */
- void onSubResource(long id, Class subResource);
-
- /**
- * Called right before sub resource locator method is invoked.
- *
- * @param id Context ID.
- * @param locator locator used for locating sub-resource.
- */
- void onSubResourceLocator(long id, AbstractSubResourceLocator locator);
-
- /**
- * Called right before resource method invocation.
- *
- * @param id Context ID.
- * @param method method used for dispatching. It MUST NOT be modified.
- */
- void onResourceMethod(long id, AbstractResourceMethod method);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.java
deleted file mode 100644
index e7cb877d358..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.monitoring;
-
-/**
- * @author Jakub.Podlesak@Oracle.Com
- * @author Marek Potociar (marek.potociar at oracle.com)
- */
-public interface DispatchingListenerAdapter {
-
- /**
- * Adapt a {@link DispatchingListener}. Returned {@link DispatchingListener} is
- * responsible and MUST call corresponding methods from the other provided in
- * method parameter.
- *
- * @param dispatchingListener the listener to adapt.
- * @return the adapted listener.
- */
- public DispatchingListener adapt(DispatchingListener dispatchingListener);
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.java
deleted file mode 100644
index 1a27b752683..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.monitoring;
-
-/**
- * A GlassFish monitoring provider to register Jersey-based monitoring.
- *
- * @author pavel.bucek@sun.com
- */
-public interface GlassfishMonitoringProvider {
- /**
- * Register Jersey-based monitoring with the GlassFish monitoring
- * framework.
- */
- public void register();
-}
-
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListener.java
deleted file mode 100644
index 0c057223b32..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.monitoring;
-
-import com.sun.jersey.spi.container.ContainerRequest;
-
-/**
- * @author Marek Potociar (marek.potociar at oracle.com)
- */
-public interface RequestListener {
-
- /**
- * Called when Jersey receives request from lower layer.
- *
- * @param id Context ID.
- * @param request request instance. It MUST NOT be modified.
- */
- void onRequest(long id, ContainerRequest request);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListenerAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListenerAdapter.java
deleted file mode 100644
index 29f6761e89e..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/RequestListenerAdapter.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.monitoring;
-
-/**
- * @author Jakub.Podlesak@Oracle.Com
- * @author Marek Potociar (marek.potociar at oracle.com)
- */
-public interface RequestListenerAdapter {
-
- /**
- * Adapt a {@link RequestListener}. Returned {@link RequestListener} is
- * responsible and MUST call corresponding methods from the other provided in
- * method parameter.
- *
- * @param requestListener the listener to adapt.
- * @return the adapted listener.
- */
- public RequestListener adapt(RequestListener requestListener);
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListener.java
deleted file mode 100644
index b08456319c2..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListener.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.monitoring;
-
-import com.sun.jersey.spi.container.ContainerResponse;
-
-import javax.ws.rs.ext.ExceptionMapper;
-
-/**
- * @author Marek Potociar (marek.potociar at oracle.com)
- */
-public interface ResponseListener {
-
- /**
- * Called when exception is thrown during dispatching and not mapped via ExceptionMapper.
- *
- * @param id Context ID.
- * @param ex thrown exception.
- */
- void onError(long id, Throwable ex);
-
- /**
- * Called when Jersey has finalized response and handles it back to container.
- *
- * @param id Context ID.
- * @param response response instance. It MUST NOT be modified.
- */
- void onResponse(long id, ContainerResponse response);
-
- /**
- * Called when Jersey has finalized response and handles it back to container.
- *
- * @param id Context ID.
- * @param exception thrown exception.
- * @param mapper {@link ExceptionMapper} used for processing that particular exception.
- */
- void onMappedException(long id, Throwable exception, ExceptionMapper mapper);
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.java
deleted file mode 100644
index 9cd4816eb39..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.monitoring;
-
-/**
- * @author Jakub.Podlesak@Oracle.Com
- * @author Marek Potociar (marek.potociar at oracle.com)
- */
-
-public interface ResponseListenerAdapter {
-
- /**
- * Adapt a {@link ResponseListener}. Returned {@link ResponseListener} is
- * responsible and MUST call corresponding methods from the other provided in
- * method parameter.
- *
- * @param responseListener the listener to adapt.
- * @return the adapted listener.
- */
- public ResponseListener adapt(ResponseListener responseListener);
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/package-info.java
deleted file mode 100644
index 22957d95ceb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for service providers.
- */
-package com.sun.jersey.spi;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/PerRequest.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/PerRequest.java
deleted file mode 100644
index 6ffa9018ec1..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/PerRequest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.resource;
-
-import com.sun.jersey.server.impl.resource.PerRequestFactory;
-import com.sun.jersey.server.spi.component.ResourceComponentProviderFactoryClass;
-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;
-
-/**
- * Used to annotate resource classes that require a new instance
- * for each request.
- */
-@Target({ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@ResourceComponentProviderFactoryClass(PerRequestFactory.class)
-public @interface PerRequest {}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/Singleton.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/Singleton.java
deleted file mode 100644
index d98eb050340..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/Singleton.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.resource;
-
-import com.sun.jersey.server.impl.resource.SingletonFactory;
-import com.sun.jersey.server.spi.component.ResourceComponentProviderFactoryClass;
-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;
-
-/**
- * Used to annotate resources that require one instance per web application.
- */
-@Target({ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@ResourceComponentProviderFactoryClass(SingletonFactory.class)
-public @interface Singleton {} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/package-info.java
deleted file mode 100644
index 709008978c3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/resource/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for plugable life-cycle declaration and implementation.
- */
-package com.sun.jersey.spi.resource; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/AnnotationScannerListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/AnnotationScannerListener.java
deleted file mode 100644
index 381ff516966..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/AnnotationScannerListener.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.scanning;
-
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.core.spi.scanning.ScannerListener;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.annotation.Annotation;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import org.objectweb.asm.AnnotationVisitor;
-import org.objectweb.asm.Attribute;
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.FieldVisitor;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-
-/**
- * A scanner listener that processes Java class files (resource names
- * ending in ".class") annotated with one or more of a set of declared
- * annotations.
- * <p>
- * Java classes of a Java class file are processed, using ASM, to ascertain
- * if those classes are annotated with one or more of the set of declared
- * annotations.
- * <p>
- * Such an annotated Java class of a Java class file is loaded if the class
- * is public or is an inner class that is static and public.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class AnnotationScannerListener implements ScannerListener {
- private final ClassLoader classloader;
-
- private final Set<Class<?>> classes;
-
- private final Set<String> annotations;
-
- private final AnnotatedClassVisitor classVisitor;
-
- /**
- * Create a scanner listener to check for annotated Java classes in Java
- * class files.
- *
- * @param annotations the set of annotation classes to check on Java class
- * files.
- */
- public AnnotationScannerListener(Class<? extends Annotation>... annotations) {
- this(ReflectionHelper.getContextClassLoader(), annotations);
- }
-
- /**
- * Create a scanner listener to check for annotated Java classes in Java
- * class files.
- *
- * @param classloader the class loader to use to load Java classes that
- * are annotated with any one of the annotations.
- * @param annotations the set of annotation classes to check on Java class
- * files.
- */
- public AnnotationScannerListener(ClassLoader classloader,
- Class<? extends Annotation>... annotations) {
- this.classloader = classloader;
- this.classes = new LinkedHashSet<Class<?>>();
- this.annotations = getAnnotationSet(annotations);
- this.classVisitor = new AnnotatedClassVisitor();
- }
-
- /**
- * Get the set of annotated classes.
- *
- * @return the set of annotated classes.
- */
- public Set<Class<?>> getAnnotatedClasses() {
- return classes;
- }
-
- private Set<String> getAnnotationSet(Class<? extends Annotation>... annotations) {
- Set<String> a = new HashSet<String>();
- for (Class c : annotations) {
- a.add("L" + c.getName().replaceAll("\\.", "/") + ";");
- }
- return a;
- }
-
- // ScannerListener
-
- public boolean onAccept(String name) {
- return name.endsWith(".class");
- }
-
- public void onProcess(String name, InputStream in) throws IOException {
- new ClassReader(in).accept(classVisitor, 0);
- }
-
- //
-
- private final class AnnotatedClassVisitor implements ClassVisitor {
-
- /**
- * The name of the visited class.
- */
- private String className;
- /**
- * True if the class has the correct scope
- */
- private boolean isScoped;
- /**
- * True if the class has the correct declared annotations
- */
- private boolean isAnnotated;
-
- public void visit(int version, int access, String name,
- String signature, String superName, String[] interfaces) {
- className = name;
- isScoped = (access & Opcodes.ACC_PUBLIC) != 0;
- isAnnotated = false;
- }
-
- public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
- isAnnotated |= annotations.contains(desc);
- return null;
- }
-
- public void visitInnerClass(String name, String outerName,
- String innerName, int access) {
- // If the name of the class that was visited is equal
- // to the name of this visited inner class then
- // this access field needs to be used for checking the scope
- // of the inner class
- if (className.equals(name)) {
- isScoped = (access & Opcodes.ACC_PUBLIC) != 0;
-
- // Inner classes need to be statically scoped
- isScoped &= (access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC;
- }
- }
-
- public void visitEnd() {
- if (isScoped && isAnnotated) {
- // Correctly scoped and annotated
- // add to the set of matching classes.
- classes.add(getClassForName(className.replaceAll("/", ".")));
- }
- }
-
- public void visitOuterClass(String string, String string0,
- String string1) {
- // Do nothing
- }
-
- public FieldVisitor visitField(int i, String string,
- String string0, String string1, Object object) {
- // Do nothing
- return null;
- }
-
- public void visitSource(String string, String string0) {
- // Do nothing
- }
-
- public void visitAttribute(Attribute attribute) {
- // Do nothing
- }
-
- public MethodVisitor visitMethod(int i, String string,
- String string0, String string1, String[] string2) {
- // Do nothing
- return null;
- }
-
- private Class getClassForName(String className) {
- try {
- return ReflectionHelper.classForNameWithException(className, classloader);
- } catch (ClassNotFoundException ex) {
- String s = "A class file of the class name, " +
- className +
- "is identified but the class could not be found";
- throw new RuntimeException(s, ex);
- }
- }
-
- };
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/PathProviderScannerListener.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/PathProviderScannerListener.java
deleted file mode 100644
index 9a86f345a63..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/PathProviderScannerListener.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.scanning;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.ext.Provider;
-
-/**
- * An annotation-based scanning listener for classes annotated with
- * {@link Path} or {@link Provider}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public final class PathProviderScannerListener extends AnnotationScannerListener {
-
- /**
- * Create a scanning listener to check for Java classes in Java
- * class files annotated with {@link Path} or {@link Provider}.
- *
- */
- public PathProviderScannerListener() {
- super(Path.class, Provider.class);
- }
-
- /**
- * Create a scanning listener to check for Java classes in Java
- * class files annotated with {@link Path} or {@link Provider}.
- *
- * @param classloader the class loader to use to load Java classes that
- * are annotated with any one of the annotations.
- */
- public PathProviderScannerListener(ClassLoader classloader) {
- super(classloader, Path.class, Provider.class);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/WebAppResourcesScanner.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/WebAppResourcesScanner.java
deleted file mode 100644
index 195de8f70cc..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/WebAppResourcesScanner.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.scanning;
-
-import com.sun.jersey.core.spi.scanning.JarFileScanner;
-import com.sun.jersey.core.spi.scanning.Scanner;
-import com.sun.jersey.core.spi.scanning.ScannerException;
-import com.sun.jersey.core.spi.scanning.ScannerListener;
-import com.sun.jersey.core.util.Closing;
-
-import javax.servlet.ServletContext;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Set;
-
-/**
- * A scanner that recursively scans resources within a Web application.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WebAppResourcesScanner implements Scanner {
-
- private final String[] paths;
- private final ServletContext sc;
-
- /**
- * Scan from a set of web resource paths.
- * <p>
- *
- * @param paths an array of web resource paths.
- * @param sc
- */
- public WebAppResourcesScanner(final String[] paths, final ServletContext sc) {
- this.paths = paths;
- this.sc = sc;
- }
-
- // Scanner
-
- public void scan(final ScannerListener cfl) {
- for (final String path : paths) {
- scan(path, cfl);
- }
- }
-
- private void scan(final String root, final ScannerListener cfl) {
- final Set<String> resourcePaths = sc.getResourcePaths(root);
- if(resourcePaths == null)
- return;
- for (final String resourcePath : resourcePaths) {
- if (resourcePath.endsWith("/")) {
- scan(resourcePath, cfl);
- } else if (resourcePath.endsWith(".jar")) {
- try {
- new Closing(sc.getResourceAsStream(resourcePath)).f(new Closing.Closure() {
- public void f(final InputStream in) throws IOException {
- JarFileScanner.scan(in, "", cfl);
- }
- });
- } catch (IOException ex) {
- throw new ScannerException("IO error scanning jar " + resourcePath, ex);
- }
- } else if (cfl.onAccept(resourcePath)) {
- try {
- new Closing(sc.getResourceAsStream(resourcePath)).f(new Closing.Closure() {
- public void f(final InputStream in) throws IOException {
- cfl.onProcess(resourcePath, in);
- }
- });
- } catch (IOException ex) {
- throw new ScannerException("IO error scanning resource " + resourcePath, ex);
- }
- }
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/package-info.java
deleted file mode 100644
index 76bb65c1865..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/scanning/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for server-side class scanning.
- */
-package com.sun.jersey.spi.scanning;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceConfigurationError.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceConfigurationError.java
deleted file mode 100644
index 9aad330a863..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceConfigurationError.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.service;
-
-/**
- * Error thrown when something goes wrong while looking up service providers.
- * In particular, this error will be thrown in the following situations:
- *
- * <ul>
- * <li> A concrete provider class cannot be found,
- * <li> A concrete provider class cannot be instantiated,
- * <li> The format of a provider-configuration file is illegal, or
- * <li> An IOException occurs while reading a provider-configuration file.
- * </ul>
- *
- * @author Mark Reinhold
- * @version 1.7, 03/12/19
- * @since 1.3
- */
-public class ServiceConfigurationError extends Error {
-
- /**
- * Constructs a new instance with the specified detail string.
- * @param msg the detail string
- */
- public ServiceConfigurationError(String msg) {
- super(msg);
- }
-
- /**
- * Constructs a new instance that wraps the specified throwable.
- * @param x the throwable to be wrapped
- */
- public ServiceConfigurationError(Throwable x) {
- super(x);
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceFinder.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceFinder.java
deleted file mode 100644
index 0e3fbbb6e17..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/ServiceFinder.java
+++ /dev/null
@@ -1,1005 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.service;
-
-import com.sun.jersey.core.reflection.ReflectionHelper;
-import com.sun.jersey.impl.SpiMessages;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.Array;
-import java.lang.reflect.ReflectPermission;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-/**
- * A simple service-provider lookup mechanism. A <i>service</i> is a
- * well-known set of interfaces and (usually abstract) classes. A <i>service
- * provider</i> is a specific implementation of a service. The classes in a
- * provider typically implement the interfaces and subclass the classes defined
- * in the service itself. Service providers may be installed in an
- * implementation of the Java platform in the form of extensions, that is, jar
- * files placed into any of the usual extension directories. Providers may
- * also be made available by adding them to the applet or application class
- * path or by some other platform-specific means.
- * <p/>
- * <p> In this lookup mechanism a service is represented by an interface or an
- * abstract class. (A concrete class may be used, but this is not
- * recommended.) A provider of a given service contains one or more concrete
- * classes that extend this <i>service class</i> with data and code specific to
- * the provider. This <i>provider class</i> will typically not be the entire
- * provider itself but rather a proxy that contains enough information to
- * decide whether the provider is able to satisfy a particular request together
- * with code that can create the actual provider on demand. The details of
- * provider classes tend to be highly service-specific; no single class or
- * interface could possibly unify them, so no such class has been defined. The
- * only requirement enforced here is that provider classes must have a
- * zero-argument constructor so that they may be instantiated during lookup.
- * <p/>
- * <p>The default service provider registration/lookup mechanism based
- * on <tt>META-INF/services</tt> files is described below.
- * For environments, where the basic mechanism is not suitable, clients
- * can enforce a different approach by setting their custom <tt>ServiceIteratorProvider</tt>
- * by calling <tt>setIteratorProvider</tt>. The call must be made prior to any lookup attempts.
- * </p>
- * <p> A service provider identifies itself by placing a provider-configuration
- * file in the resource directory <tt>META-INF/services</tt>. The file's name
- * should consist of the fully-qualified name of the abstract service class.
- * The file should contain a list of fully-qualified concrete provider-class
- * names, one per line. Space and tab characters surrounding each name, as
- * well as blank lines, are ignored. The comment character is <tt>'#'</tt>
- * (<tt>0x23</tt>); on each line all characters following the first comment
- * character are ignored. The file must be encoded in UTF-8.
- * <p/>
- * <p> If a particular concrete provider class is named in more than one
- * configuration file, or is named in the same configuration file more than
- * once, then the duplicates will be ignored. The configuration file naming a
- * particular provider need not be in the same jar file or other distribution
- * unit as the provider itself. The provider must be accessible from the same
- * class loader that was initially queried to locate the configuration file;
- * note that this is not necessarily the class loader that found the file.
- * <p/>
- * <p> <b>Example:</b> Suppose we have a service class named
- * <tt>java.io.spi.CharCodec</tt>. It has two abstract methods:
- * <p/>
- * <pre>
- * public abstract CharEncoder getEncoder(String encodingName);
- * public abstract CharDecoder getDecoder(String encodingName);
- * </pre>
- * <p/>
- * Each method returns an appropriate object or <tt>null</tt> if it cannot
- * translate the given encoding. Typical <tt>CharCodec</tt> providers will
- * support more than one encoding.
- * <p/>
- * <p> If <tt>sun.io.StandardCodec</tt> is a provider of the <tt>CharCodec</tt>
- * service then its jar file would contain the file
- * <tt>META-INF/services/java.io.spi.CharCodec</tt>. This file would contain
- * the single line:
- * <p/>
- * <pre>
- * sun.io.StandardCodec # Standard codecs for the platform
- * </pre>
- * <p/>
- * To locate an codec for a given encoding name, the internal I/O code would
- * do something like this:
- * <p/>
- * <pre>
- * CharEncoder getEncoder(String encodingName) {
- * for( CharCodec cc : ServiceFinder.find(CharCodec.class) ) {
- * CharEncoder ce = cc.getEncoder(encodingName);
- * if (ce != null)
- * return ce;
- * }
- * return null;
- * }
- * </pre>
- * <p/>
- * The provider-lookup mechanism always executes in the security context of the
- * caller. Trusted system code should typically invoke the methods in this
- * class from within a privileged security context.
- *
- * @param <T> the type of the service instance.
- * @author Mark Reinhold, Jakub Podlesak
- */
-public final class ServiceFinder<T> implements Iterable<T> {
- private static final Logger LOGGER = Logger.getLogger(ServiceFinder.class.getName());
-
- private static final String MANIFEST = "META-INF/MANIFEST.MF";
-
- private static final String MODULE_VERSION = "META-INF/jersey-module-version";
-
- private static final String PREFIX = "META-INF/services/";
-
- private static final String BUNDLE_VERSION_ATTRIBUTE = "Bundle-Version";
-
- private static final String BUNDLE_SYMBOLIC_NAME_ATTRIBUTE = "Bundle-SymbolicName";
-
- private static final String BUNDLE_VERSION = getBundleAttribute(BUNDLE_VERSION_ATTRIBUTE);
-
- private static final String BUNDLE_SYMBOLIC_NAME = getBundleAttribute(BUNDLE_SYMBOLIC_NAME_ATTRIBUTE);
-
- private static final String MODULE_VERSION_VALUE = getModuleVersion();
-
- private final Class<T> serviceClass;
- private final String serviceName;
- private final ClassLoader classLoader;
- private final boolean ignoreOnClassNotFound;
-
- private static String getBundleAttribute(String attributeName) {
- try {
- final String version = getManifest(ServiceFinder.class).
- getMainAttributes().
- getValue(attributeName);
- if (LOGGER.isLoggable(Level.FINE)) {
- LOGGER.fine("ServiceFinder " + attributeName + ": " + version);
- }
- return version;
- } catch (IOException ex) {
- LOGGER.log(Level.FINE, "Error loading META-INF/MANIFEST.MF associated with " + ServiceFinder.class.getName(), ex);
- return null;
- }
- }
-
- private static String getModuleVersion() {
- try {
- String resource = ServiceFinder.class.getName().replace(".", "/") + ".class";
- URL url = getResource(ServiceFinder.class.getClassLoader(), resource);
- if (url == null) {
- LOGGER.log(Level.FINE, "Error getting " + ServiceFinder.class.getName() + " class as a resource");
- return null;
- }
-
- return getJerseyModuleVersion(getManifestURL(resource, url));
- } catch(IOException ioe) {
- LOGGER.log(Level.FINE, "Error loading META-INF/jersey-module-version associated with " + ServiceFinder.class.getName(), ioe);
- return null;
- }
- }
-
- private static final Map<URL, Boolean> manifestURLs = new HashMap<URL, Boolean>();
-
- private static Enumeration<URL> filterServiceURLsWithVersion(String serviceName, Enumeration<URL> serviceUrls) {
- if (BUNDLE_VERSION == null || !serviceUrls.hasMoreElements())
- return serviceUrls;
-
- final List<URL> urls = Collections.list(serviceUrls);
- final ListIterator<URL> li = urls.listIterator();
- while (li.hasNext()) {
- final URL url = li.next();
- try {
- final URL manifestURL = getManifestURL(serviceName, url);
-
- synchronized(manifestURLs) {
- Boolean keep = manifestURLs.get(manifestURL);
- if (keep != null) {
- if (!keep) {
- if (LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.config("Ignoring service URL: " + url);
- }
- li.remove();
- } else {
- if (LOGGER.isLoggable(Level.FINE)) {
- LOGGER.fine("Including service URL: " + url);
- }
- }
- } else {
- if (!compatibleManifest(manifestURL)) {
- if (LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.config("Ignoring service URL: " + url);
- }
- li.remove();
- manifestURLs.put(manifestURL, false);
- } else {
- if (LOGGER.isLoggable(Level.FINE)) {
- LOGGER.fine("Including service URL: " + url);
- }
- manifestURLs.put(manifestURL, true);
- }
- }
- }
- } catch (IOException ex) {
- LOGGER.log(Level.FINE, "Error loading META-INF/MANIFEST.MF associated with " + url, ex);
- }
- }
- return Collections.enumeration(urls);
- }
-
- private static boolean compatibleManifest(URL manifestURL) throws IOException {
- final Attributes as = getManifest(manifestURL).getMainAttributes();
- final String symbolicName = as.getValue(BUNDLE_SYMBOLIC_NAME_ATTRIBUTE);
- final String version = as.getValue(BUNDLE_VERSION_ATTRIBUTE);
-
- if (LOGGER.isLoggable(Level.FINE)) {
- LOGGER.fine("Checking META-INF/MANIFEST.MF URL: " + manifestURL +
- "\n " + BUNDLE_SYMBOLIC_NAME_ATTRIBUTE + ": " + symbolicName +
- "\n " + BUNDLE_VERSION_ATTRIBUTE + ": " + version);
- }
-
- if (symbolicName != null &&
- symbolicName.startsWith("com.sun.jersey") &&
- !BUNDLE_VERSION.equals(version)) {
- return false;
- } else {
- String moduleVersion = getJerseyModuleVersion(manifestURL);
-
- if(moduleVersion != null &&
- (!moduleVersion.equals(MODULE_VERSION_VALUE) ||
- (symbolicName != null &&
- (BUNDLE_SYMBOLIC_NAME.startsWith("com.sun.jersey") ^ symbolicName.startsWith("com.sun.jersey"))))) {
- return false;
- }
-
- return true;
- }
- }
-
- private static String getJerseyModuleVersion(URL manifestURL) {
- try {
- URL moduleVersionURL = new URL(manifestURL.toString().replace(MANIFEST, MODULE_VERSION));
-
- return new BufferedReader(new InputStreamReader(moduleVersionURL.openStream())).readLine();
- } catch (IOException ioe) {
- LOGGER.log(Level.FINE, "Error loading META-INF/jersey-module-version associated with " + ServiceFinder.class.getName(), ioe);
- return null;
- }
- }
-
- private static Manifest getManifest(Class c) throws IOException {
- String resource = c.getName().replace(".", "/") + ".class";
- URL url = getResource(c.getClassLoader(), resource);
- if (url == null)
- throw new IOException("Resource not found: " + url);
-
- return getManifest(resource, url);
- }
-
- private static Manifest getManifest(String name, URL serviceURL) throws IOException {
- return getManifest(getManifestURL(name, serviceURL));
- }
-
- private static URL getManifestURL(String name, URL serviceURL) throws IOException {
- return new URL(serviceURL.toString().replace(name, MANIFEST));
- }
-
- private static Manifest getManifest(URL url) throws IOException {
- final InputStream in = url.openStream();
- try {
- return new Manifest(in);
- } finally {
- in.close();
- }
- }
-
- private static URL getResource(ClassLoader loader, String name) throws IOException {
- if (loader == null)
- return getResource(name);
- else {
- final URL resource = loader.getResource(name);
- if (resource != null) {
- return resource;
- } else {
- return getResource(name);
- }
- }
- }
-
- private static URL getResource(String name) throws IOException {
- if (ServiceFinder.class.getClassLoader() != null)
- return ServiceFinder.class.getClassLoader().getResource(name);
- else
- return ClassLoader.getSystemResource(name);
- }
-
- private static Enumeration<URL> getResources(ClassLoader loader, String name) throws IOException {
- if (loader == null) {
- return getResources(name);
- } else {
- final Enumeration<URL> resources = loader.getResources(name);
- if (resources.hasMoreElements()) {
- return resources;
- } else {
- return getResources(name);
- }
- }
- }
-
- private static Enumeration<URL> getResources(String name) throws IOException {
- if (ServiceFinder.class.getClassLoader() != null)
- return ServiceFinder.class.getClassLoader().getResources(name);
- else
- return ClassLoader.getSystemResources(name);
- }
-
- /**
- * Locates and incrementally instantiates the available providers of a
- * given service using the given class loader.
- * <p/>
- * <p> This method transforms the name of the given service class into a
- * provider-configuration filename as described above and then uses the
- * <tt>getResources</tt> method of the given class loader to find all
- * available files with that name. These files are then read and parsed to
- * produce a list of provider-class names. The iterator that is returned
- * uses the given class loader to lookup and then instantiate each element
- * of the list.
- * <p/>
- * <p> Because it is possible for extensions to be installed into a running
- * Java virtual machine, this method may return different results each time
- * it is invoked. <p>
- * @param service The service's abstract service class
- * @param loader The class loader to be used to load provider-configuration files
- * and instantiate provider classes, or <tt>null</tt> if the system
- * class loader (or, failing that the bootstrap class loader) is to
- * be used
- * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
- * or names a provider class that cannot be found and instantiated
- * @see #find(Class)
- * @param <T> the type of the service instance.
- * @return the service finder
- */
- public static <T> ServiceFinder<T> find(Class<T> service, ClassLoader loader)
- throws ServiceConfigurationError {
- return find(service,
- loader,
- false);
- }
-
- /**
- * Locates and incrementally instantiates the available providers of a
- * given service using the given class loader.
- * <p/>
- * <p> This method transforms the name of the given service class into a
- * provider-configuration filename as described above and then uses the
- * <tt>getResources</tt> method of the given class loader to find all
- * available files with that name. These files are then read and parsed to
- * produce a list of provider-class names. The iterator that is returned
- * uses the given class loader to lookup and then instantiate each element
- * of the list.
- * <p/>
- * <p> Because it is possible for extensions to be installed into a running
- * Java virtual machine, this method may return different results each time
- * it is invoked. <p>
- * @param service The service's abstract service class
- * @param loader The class loader to be used to load provider-configuration files
- * and instantiate provider classes, or <tt>null</tt> if the system
- * class loader (or, failing that the bootstrap class loader) is to
- * be used
- * @param ignoreOnClassNotFound If a provider cannot be loaded by the class loader
- * then move on to the next available provider.
- * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
- * or names a provider class that cannot be found and instantiated
- * @see #find(Class)
- * @param <T> the type of the service instance.
- * @return the service finder
- */
- public static <T> ServiceFinder<T> find(Class<T> service,
- ClassLoader loader,
- boolean ignoreOnClassNotFound) throws ServiceConfigurationError {
- return new ServiceFinder<T>(service,
- loader,
- ignoreOnClassNotFound);
- }
-
- /**
- * Locates and incrementally instantiates the available providers of a
- * given service using the context class loader. This convenience method
- * is equivalent to
- * <p/>
- * <pre>
- * ClassLoader cl = Thread.currentThread().getContextClassLoader();
- * return Service.providers(service, cl, false);
- * </pre>
- * @param service The service's abstract service class
- * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
- * or names a provider class that cannot be found and instantiated
- * @see #find(Class, ClassLoader)
- * @param <T> the type of the service instance.
- * @return the service finder
- */
- public static <T> ServiceFinder<T> find(Class<T> service)
- throws ServiceConfigurationError {
- return find(service,
- Thread.currentThread().getContextClassLoader(),
- false);
- }
-
- /**
- * Locates and incrementally instantiates the available providers of a
- * given service using the context class loader. This convenience method
- * is equivalent to
- * <p/>
- * <pre>
- * ClassLoader cl = Thread.currentThread().getContextClassLoader();
- * boolean ingore = ...
- * return Service.providers(service, cl, ignore);
- * </pre>
- * @param service The service's abstract service class
- * @param ignoreOnClassNotFound If a provider cannot be loaded by the class loader
- * then move on to the next available provider.
- * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
- * or names a provider class that cannot be found and instantiated
- * @see #find(Class, ClassLoader)
- * @param <T> the type of the service instance.
- * @return the service finder
- */
- public static <T> ServiceFinder<T> find(Class<T> service,
- boolean ignoreOnClassNotFound) throws ServiceConfigurationError {
- return find(service,
- Thread.currentThread().getContextClassLoader(),
- ignoreOnClassNotFound);
- }
-
- /**
- * Locates and incrementally instantiates the available classes of a given
- * service file using the context class loader.
- *
- * @param serviceName the service name correspond to a file in
- * META-INF/services that contains a list of fully qualified class
- * names
- * @throws ServiceConfigurationError If a service file violates the specified format
- * or names a provider class that cannot be found and instantiated
- * @return the service finder
- */
- public static ServiceFinder<?> find(String serviceName) throws ServiceConfigurationError {
- return new ServiceFinder(Object.class, serviceName, Thread.currentThread().getContextClassLoader(), false);
- }
-
- /**
- * Register the service iterator provider to iterate on provider instances
- * or classes.
- * <p>
- * The default implementation registered, {@link DefaultServiceIteratorProvider},
- * looks up provider classes in META-INF/service files.
- * <p>
- * This method must be called prior to any attempts to obtain provider
- * instances or classes.
- *
- * @param sip the service iterator provider.
- * @throws SecurityException if the provider cannot be registered.
- */
- public static void setIteratorProvider(ServiceIteratorProvider sip) throws SecurityException {
- ServiceIteratorProvider.setInstance(sip);
- }
-
-
- private ServiceFinder(
- Class<T> service,
- ClassLoader loader,
- boolean ignoreOnClassNotFound) {
- this(service, service.getName(), loader, ignoreOnClassNotFound);
- }
-
- private ServiceFinder(
- Class<T> service,
- String serviceName,
- ClassLoader loader,
- boolean ignoreOnClassNotFound) {
- this.serviceClass = service;
- this.serviceName = serviceName;
- this.classLoader = loader;
- this.ignoreOnClassNotFound = ignoreOnClassNotFound;
- }
-
- /**
- * Returns discovered objects incrementally.
- *
- * @return An <tt>Iterator</tt> that yields provider objects for the given
- * service, in some arbitrary order. The iterator will throw a
- * <tt>ServiceConfigurationError</tt> if a provider-configuration
- * file violates the specified format or if a provider class cannot
- * be found and instantiated.
- */
- public Iterator<T> iterator() {
- return ServiceIteratorProvider.getInstance().createIterator(serviceClass, serviceName, classLoader, ignoreOnClassNotFound);
- }
-
- /**
- * Returns discovered classes incrementally.
- *
- * @return An <tt>Iterator</tt> that yields provider classes for the given
- * service, in some arbitrary order. The iterator will throw a
- * <tt>ServiceConfigurationError</tt> if a provider-configuration
- * file violates the specified format or if a provider class cannot
- * be found.
- */
- private Iterator<Class<T>> classIterator() {
- return ServiceIteratorProvider.getInstance().createClassIterator(serviceClass, serviceName, classLoader, ignoreOnClassNotFound);
- }
-
- /**
- * Returns discovered objects all at once.
- *
- * @return
- * can be empty but never null.
- *
- * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
- * or names a provider class that cannot be found and instantiated
- */
- @SuppressWarnings("unchecked")
- public T[] toArray() throws ServiceConfigurationError {
- List<T> result = new ArrayList<T>();
- for (T t : this) {
- result.add(t);
- }
- return result.toArray((T[])Array.newInstance(serviceClass,result.size()));
- }
-
- /**
- * Returns discovered classes all at once.
- *
- * @return
- * can be empty but never null.
- *
- * @throws ServiceConfigurationError If a provider-configuration file violates the specified format
- * or names a provider class that cannot be found
- */
- @SuppressWarnings("unchecked")
- public Class<T>[] toClassArray() throws ServiceConfigurationError {
- List<Class<T>> result = new ArrayList<Class<T>>();
-
- Iterator<Class<T>> i = classIterator();
- while (i.hasNext())
- result.add(i.next());
- return result.toArray((Class<T>[])Array.newInstance(Class.class,result.size()));
- }
-
- private static void fail(String serviceName, String msg, Throwable cause)
- throws ServiceConfigurationError {
- ServiceConfigurationError sce
- = new ServiceConfigurationError(serviceName + ": " + msg);
- sce.initCause(cause);
- throw sce;
- }
-
- private static void fail(String serviceName, String msg)
- throws ServiceConfigurationError {
- throw new ServiceConfigurationError(serviceName + ": " + msg);
- }
-
- private static void fail(String serviceName, URL u, int line, String msg)
- throws ServiceConfigurationError {
- fail(serviceName, u + ":" + line + ": " + msg);
- }
-
- /**
- * Parse a single line from the given configuration file, adding the name
- * on the line to both the names list and the returned set iff the name is
- * not already a member of the returned set.
- */
- private static int parseLine(String serviceName, URL u, BufferedReader r, int lc,
- List<String> names, Set<String> returned)
- throws IOException, ServiceConfigurationError {
- String ln = r.readLine();
- if (ln == null) {
- return -1;
- }
- int ci = ln.indexOf('#');
- if (ci >= 0) ln = ln.substring(0, ci);
- ln = ln.trim();
- int n = ln.length();
- if (n != 0) {
- if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0))
- fail(serviceName, u, lc, SpiMessages.ILLEGAL_CONFIG_SYNTAX());
- int cp = ln.codePointAt(0);
- if (!Character.isJavaIdentifierStart(cp))
- fail(serviceName, u, lc, SpiMessages.ILLEGAL_PROVIDER_CLASS_NAME(ln));
- for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
- cp = ln.codePointAt(i);
- if (!Character.isJavaIdentifierPart(cp) && (cp != '.'))
- fail(serviceName, u, lc, SpiMessages.ILLEGAL_PROVIDER_CLASS_NAME(ln));
- }
- if (!returned.contains(ln)) {
- names.add(ln);
- returned.add(ln);
- }
- }
- return lc + 1;
- }
-
- /**
- * Parse the content of the given URL as a provider-configuration file.
- *
- * @param serviceName The service class for which providers are being sought;
- * used to construct error detail strings
- * @param u The URL naming the configuration file to be parsed
- * @param returned A Set containing the names of provider classes that have already
- * been returned. This set will be updated to contain the names
- * that will be yielded from the returned <tt>Iterator</tt>.
- * @return A (possibly empty) <tt>Iterator</tt> that will yield the
- * provider-class names in the given configuration file that are
- * not yet members of the returned set
- * @throws ServiceConfigurationError If an I/O error occurs while reading from the given URL, or
- * if a configuration-file format error is detected
- */
- @SuppressWarnings({"StatementWithEmptyBody"})
- private static Iterator<String> parse(String serviceName, URL u, Set<String> returned)
- throws ServiceConfigurationError {
- InputStream in = null;
- BufferedReader r = null;
- ArrayList<String> names = new ArrayList<String>();
- try {
- URLConnection uConn = u.openConnection();
- uConn.setUseCaches(false);
- in = uConn.getInputStream();
- r = new BufferedReader(new InputStreamReader(in, "utf-8"));
- int lc = 1;
- while ((lc = parseLine(serviceName, u, r, lc, names, returned)) >= 0) ;
- } catch (IOException x) {
- fail(serviceName, ": " + x);
- } finally {
- try {
- if (r != null) r.close();
- if (in != null) in.close();
- } catch (IOException y) {
- fail(serviceName, ": " + y);
- }
- }
- return names.iterator();
- }
-
- private static class AbstractLazyIterator<T> {
- final Class<T> service;
- final String serviceName;
- final ClassLoader loader;
- final boolean ignoreOnClassNotFound;
-
- Enumeration<URL> configs = null;
- Iterator<String> pending = null;
- Set<String> returned = new TreeSet<String>();
- String nextName = null;
-
- private AbstractLazyIterator(
- Class<T> service,
- String serviceName,
- ClassLoader loader,
- boolean ignoreOnClassNotFound) {
- this.service = service;
- this.serviceName = serviceName;
- this.loader = loader;
- this.ignoreOnClassNotFound = ignoreOnClassNotFound;
- }
-
- protected final void setConfigs() {
- if (configs == null) {
- try {
- final String fullName = PREFIX + serviceName;
- configs = filterServiceURLsWithVersion(fullName,
- getResources(loader, fullName));
- } catch (IOException x) {
- fail(serviceName, ": " + x);
- }
- }
- }
-
- public boolean hasNext() throws ServiceConfigurationError {
- if (nextName != null) {
- return true;
- }
- setConfigs();
-
- while (nextName == null) {
- while ((pending == null) || !pending.hasNext()) {
- if (!configs.hasMoreElements()) {
- return false;
- }
- pending = parse(serviceName, configs.nextElement(), returned);
- }
- nextName = pending.next();
- if (ignoreOnClassNotFound) {
- try {
- ReflectionHelper.classForNameWithException(nextName, loader);
- } catch (ClassNotFoundException ex) {
- // Provider implementation not found
- if(LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.log(Level.CONFIG,
- SpiMessages.PROVIDER_NOT_FOUND(nextName, service));
- }
- nextName = null;
- } catch (NoClassDefFoundError ex) {
- // Dependent class of provider not found
- if(LOGGER.isLoggable(Level.CONFIG)) {
- // This assumes that ex.getLocalizedMessage() returns
- // the name of a dependent class that is not found
- LOGGER.log(Level.CONFIG ,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_NOT_FOUND(
- ex.getLocalizedMessage(), nextName, service));
- }
- nextName = null;
- } catch(ClassFormatError ex) {
- // Dependent class of provider not found
- if(LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.log(Level.CONFIG ,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_FORMAT_ERROR(
- ex.getLocalizedMessage(), nextName, service));
- }
- nextName = null;
- }
- }
- }
- return true;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-
- private static final class LazyClassIterator<T> extends AbstractLazyIterator<T>
- implements Iterator<Class<T>> {
-
- private LazyClassIterator(
- Class<T> service,
- String serviceName,
- ClassLoader loader,
- boolean ignoreOnClassNotFound) {
- super(service, serviceName, loader, ignoreOnClassNotFound);
- }
-
- @SuppressWarnings("unchecked")
- public Class<T> next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- String cn = nextName;
- nextName = null;
- try {
- return (Class<T>)ReflectionHelper.classForNameWithException(cn, loader);
- } catch (ClassNotFoundException ex) {
- fail(serviceName,
- SpiMessages.PROVIDER_NOT_FOUND(cn, service));
- } catch (NoClassDefFoundError ex) {
- fail(serviceName,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_NOT_FOUND(
- ex.getLocalizedMessage(), cn, service));
- } catch (ClassFormatError ex) {
- fail(serviceName,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_FORMAT_ERROR(
- ex.getLocalizedMessage(), cn, service));
- } catch (Exception x) {
- fail(serviceName,
- SpiMessages.PROVIDER_CLASS_COULD_NOT_BE_LOADED(cn, service, x.getLocalizedMessage()),
- x);
- }
-
- return null; /* This cannot happen */
- }
- }
-
- private static final class LazyObjectIterator<T> extends AbstractLazyIterator<T>
- implements Iterator<T> {
-
- private T t;
-
- private LazyObjectIterator(
- Class<T> service,
- String serviceName,
- ClassLoader loader,
- boolean ignoreOnClassNotFound) {
- super(service, serviceName, loader, ignoreOnClassNotFound);
- }
-
- @Override
- public boolean hasNext() throws ServiceConfigurationError {
- if (nextName != null) {
- return true;
- }
- setConfigs();
-
- while (nextName == null) {
- while ((pending == null) || !pending.hasNext()) {
- if (!configs.hasMoreElements()) {
- return false;
- }
- pending = parse(serviceName, configs.nextElement(), returned);
- }
- nextName = pending.next();
- try {
- t = service.cast(ReflectionHelper.classForNameWithException(nextName, loader).newInstance());
- } catch (ClassNotFoundException ex) {
- if (ignoreOnClassNotFound) {
- // Provider implementation not found
- if(LOGGER.isLoggable(Level.WARNING)) {
- LOGGER.log(Level.WARNING,
- SpiMessages.PROVIDER_NOT_FOUND(nextName, service));
- }
- nextName = null;
- } else
- fail(serviceName,
- SpiMessages.PROVIDER_NOT_FOUND(nextName, service));
- } catch (NoClassDefFoundError ex) {
- // Dependent class of provider not found
- if (ignoreOnClassNotFound) {
- if(LOGGER.isLoggable(Level.CONFIG)) {
- // This assumes that ex.getLocalizedMessage() returns
- // the name of a dependent class that is not found
- LOGGER.log(Level.CONFIG ,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_NOT_FOUND(
- ex.getLocalizedMessage(), nextName, service));
- }
- nextName = null;
- } else
- fail(serviceName,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_NOT_FOUND(ex.getLocalizedMessage(), nextName, service),
- ex);
- } catch (ClassFormatError ex) {
- // Dependent class of provider not found
- if (ignoreOnClassNotFound) {
- if(LOGGER.isLoggable(Level.CONFIG)) {
- LOGGER.log(Level.CONFIG ,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_FORMAT_ERROR(
- ex.getLocalizedMessage(), nextName, service));
- }
- nextName = null;
- } else
- fail(serviceName,
- SpiMessages.DEPENDENT_CLASS_OF_PROVIDER_FORMAT_ERROR(ex.getLocalizedMessage(), nextName, service),
- ex);
- } catch(Exception ex) {
- fail(serviceName,
- SpiMessages.PROVIDER_COULD_NOT_BE_CREATED(nextName, service, ex.getLocalizedMessage()),
- ex);
- }
- }
- return true;
- }
-
- public T next() {
- if (!hasNext()) {
- throw new NoSuchElementException();
- }
- String cn = nextName;
- nextName = null;
- return t;
- }
- }
-
- /**
- * Supports iteration of provider instances or classes.
- * <p>
- * The default implementation looks up provider classes from META-INF/services
- * files, see {@link DefaultServiceIteratorProvider}.
- * This implementation may be overridden by invoking
- * {@link ServiceFinder#setIteratorProvider(com.sun.jersey.spi.service.ServiceFinder.ServiceIteratorProvider)}.
- *
- * @param <T> the type of service.
- */
- public static abstract class ServiceIteratorProvider<T> {
-
- private static volatile ServiceIteratorProvider sip;
-
- private static ServiceIteratorProvider getInstance() {
- // Double-check idiom for lazy initialization of fields.
- ServiceIteratorProvider result = sip;
- if (result == null) { // First check (no locking)
- synchronized (ServiceIteratorProvider.class) {
- result = sip;
- if (result == null) { // Second check (with locking)
- sip = result = new DefaultServiceIteratorProvider();
- }
- }
- }
- return result;
- }
-
- private static void setInstance(ServiceIteratorProvider sip) throws SecurityException {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- ReflectPermission rp = new ReflectPermission("suppressAccessChecks");
- security.checkPermission(rp);
- }
- synchronized (ServiceIteratorProvider.class) {
- ServiceIteratorProvider.sip = sip;
- }
- }
-
- /**
- * Iterate over provider instances of a service.
- *
- * @param service the service class.
- * @param serviceName the service name.
- * @param loader the class loader to utilize when loading provider
- * classes.
- * @param ignoreOnClassNotFound, if true ignore an instance if the
- * corresponding provider class if cannot be found,
- * otherwise throw a {@link ClassNotFoundException}.
- * @return the provider instance iterator.
- */
- public abstract Iterator<T> createIterator(Class<T> service,
- String serviceName, ClassLoader loader, boolean ignoreOnClassNotFound);
-
- /**
- * Iterate over provider classes of a service.
- *
- * @param service the service class.
- * @param serviceName the service name.
- * @param loader the class loader to utilize when loading provider
- * classes.
- * @param ignoreOnClassNotFound, if true ignore the provider class if
- * cannot be found,
- * otherwise throw a {@link ClassNotFoundException}.
- * @return the provider class iterator.
- */
- public abstract Iterator<Class<T>> createClassIterator(Class<T> service,
- String serviceName, ClassLoader loader, boolean ignoreOnClassNotFound);
- }
-
-
- /**
- * The default service iterator provider that looks up provider classes in
- * META-INF/services files.
- * <p>
- * This class may utilized if a {@link ServiceIteratorProvider} needs to
- * reuse the default implementation.
- *
- * @param <T> the type of service.
- */
- public static final class DefaultServiceIteratorProvider<T> extends ServiceIteratorProvider<T> {
-
- @Override
- public Iterator<T> createIterator(Class<T> service, String serviceName,
- ClassLoader loader, boolean ignoreOnClassNotFound) {
- return new LazyObjectIterator(service, serviceName, loader, ignoreOnClassNotFound);
- }
-
- @Override
- public Iterator<Class<T>> createClassIterator(Class<T> service, String serviceName,
- ClassLoader loader, boolean ignoreOnClassNotFound) {
- return new LazyClassIterator(service, serviceName, loader, ignoreOnClassNotFound);
- }
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/package-info.java
deleted file mode 100644
index c0fbbd85a91..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/service/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for services obtained using META-INF/services.
- */
-package com.sun.jersey.spi.service; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ResolvedViewable.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ResolvedViewable.java
deleted file mode 100644
index 35856b6b031..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ResolvedViewable.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.template;
-
-import com.sun.jersey.api.view.Viewable;
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A resolved {@link Viewable}.
- * <p>
- * A resolved viewable is obtained from the resolving methods on
- * {@link TemplateContext} and has associated with it a {@link ViewProcessor}
- * that is capable of processing a template identified by a template reference.
- *
- * @param <T> the type of the resolved template object.
- * @author Paul.Sandoz@Sun.Com
- */
-public class ResolvedViewable<T> extends Viewable {
-
- private final ViewProcessor<T> vp;
-
- private final T templateObject;
-
- /**
- * Create a resolved viewable.
- *
- * @param vp the view processor that resolved a template name to a template
- * reference.
- * @param t the template reference.
- * @param v the viewable that is resolved.
- */
- public ResolvedViewable(ViewProcessor<T> vp, T t, Viewable v) {
- this(vp, t, v, null);
- }
-
- /**
- * Create a resolved viewable.
- *
- * @param vp the view processor that resolved a template name to a template
- * reference.
- * @param t the template reference.
- * @param v the viewable that is resolved.
- * @param resolvingClass the resolving class that was used to resolve a
- * relative template name into an absolute template name.
- */
- public ResolvedViewable(ViewProcessor<T> vp, T t, Viewable v, Class<?> resolvingClass) {
- super(v.getTemplateName(), v.getModel(), resolvingClass);
-
- this.vp = vp;
- this.templateObject = t;
- }
-
- /**
- * Write the resolved viewable.
- * <p>
- * This method defers to {@link ViewProcessor#writeTo(java.lang.Object, com.sun.jersey.api.view.Viewable, java.io.OutputStream) }
- * to write the viewable utilizing the template reference.
- *
- * @param out the output stream that the view processor writes to.
- *
- * @throws java.io.IOException
- */
- public void writeTo(OutputStream out) throws IOException {
- vp.writeTo(templateObject, this, out);
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContext.java
deleted file mode 100644
index 2aaebba8da0..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContext.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.template;
-
-import com.sun.jersey.api.view.Viewable;
-import javax.ws.rs.core.UriInfo;
-
-/**
- * The context for resolving an instance of {@link Viewable} to
- * an instance of {@link ResolvedViewable}.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface TemplateContext {
-
- /**
- * Resolve a {@link Viewable}.
- * <p>
- * If the template name of the viewable is not absolute then the resolving
- * class of the viewable is utilized to resolve the relative template name
- * into an absolute template name.
- *
- * If the resolving class is not set (a null value) then the class of the
- * model is utilized as the resolving class.
- *
- * If the model is not set (a null value) then a {@link TemplateContextException}
- * is thrown.
- *
- * @param v the viewable
- * @return the resolved viewable
- * @throws TemplateContextException if the viewable cannot be resolved.
- */
- ResolvedViewable resolveViewable(Viewable v) throws TemplateContextException;
-
- /**
- * Resolve a {@link Viewable}.
- * <p>
- * If the template name of the viewable is not absolute then the resolving
- * class of the viewable is utilized to resolve the relative template name
- * into an absolute template name.
- *
- * If the resolving class is not set (a null value) then the class of the
- * last matching resource obtained from
- * {@link javax.ws.rs.core.UriInfo#getMatchedResources() }, namely
- * the class obtained from the expression
- * <code>uriInfo.getMatchedResources().get(0).getClass()</code>, is utilized
- * as the resolving class.
- *
- * If there are no matching resoruces then a {@link TemplateContextException}
- * is thrown.
- *
- * @param v the viewable
- * @param ui
- * @return the resolved viewable
- * @throws TemplateContextException if the viewable cannot be resolved.
- */
- ResolvedViewable resolveViewable(Viewable v, UriInfo ui) throws TemplateContextException;
-
- /**
- * Resolve a {@link Viewable} given a resolving class.
- * <p>
- * If the template name of the viewable is not absolute then the resolving
- * class of the viewable is utilized to resolve the relative template name
- * into an absolute template name.
- *
- * If the resolving class is not set (a null value) then the class of the
- * <code>resolvingClass</code> parameter is utilized as the resolving class.
- *
- * If the <code>resolvingClass</code> parameter is null then a
- * {@link TemplateContextException} is thrown.
- *
- * @param v the viewable.
- * @param resolvingClass the resolving class to use if the resolving
- * class of the viewable is not set.
- * @return the resolved viewable.
- * @throws TemplateContextException if the viewable cannot be resolved.
- */
- ResolvedViewable resolveViewable(Viewable v, Class<?> resolvingClass) throws TemplateContextException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContextException.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContextException.java
deleted file mode 100644
index 2f448cb4ee7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateContextException.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.template;
-
-import com.sun.jersey.api.container.ContainerException;
-import com.sun.jersey.api.view.Viewable;
-
-/**
- * A rutime expception associated with errors when resolving a
- * {@link Viewable} to a {@link ResolvedViewable} by methods on
- * {@link TemplateContext}.
- *
- * @author Paul.Sandoz.@Sun.Com
- */
-public class TemplateContextException extends ContainerException {
-
- /**
- * Construct a new instance with the supplied message
- */
- public TemplateContextException() {
- super();
- }
-
- /**
- * Construct a new instance with the supplied message
- * @param message the message
- */
- public TemplateContextException(String message) {
- super(message);
- }
-
- /**
- * Construct a new instance with the supplied message and cause
- * @param message the message
- * @param cause the Throwable that caused the exception to be thrown
- */
- public TemplateContextException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Construct a new instance with the supplied cause
- * @param cause the Throwable that caused the exception to be thrown
- */
- public TemplateContextException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateProcessor.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateProcessor.java
deleted file mode 100644
index 72ded866f21..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/TemplateProcessor.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.template;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import java.io.IOException;
-import java.io.OutputStream;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.Provider;
-
-/**
- * A template processor.
- * <p>
- * NOTE that this interface has been deprecated, instead use the
- * {@link ViewProcessor} interface.
- * <p>
- * Implementations of this interface shall be capable of resolving a
- * template name into a fully qualified template name that identifies
- * a template supported by the implementation. And, processing the
- * template, identified by the fully qualified template name, the results
- * of which are written to an output stream.
- * <p>
- * Implementations can register a template processor as a provider, for
- * example, annotating the implementation class with {@link Provider}
- * or registering an instance as a singleton with {@link ResourceConfig}
- * or {@link Application}.
- * <p>
- * Such template processors could be JSP template processors (supported by the
- * Jersey servlet and filter implementations) or say Freemarker or Velocity
- * template processors (not implemented).
- *
- * @author Paul.Sandoz@Sun.Com
- * @deprecated see {@link ViewProcessor}
- */
-public interface TemplateProcessor {
-
- /**
- * Resolve a template name into a fully qualified template name that
- * identifies a template.
- *
- * @deprecated see {@link ViewProcessor}
- * @param name the template name
- * @return the fully qualified template name, otherwise null
- * if the template name cannot be resolved.
- */
- String resolve(String name);
-
- /**
- * Process a template and write the result to an output stream.
- *
- * @deprecated see {@link ViewProcessor}
- * @param fullyQualifedName the fully qualified template name identifying a
- * template. This is obtained by calling the resolve method with a
- * template name.
- * @param model the model to be passed to the template.
- * @param out the output stream to write the result of processing the
- * template.
- * @throws java.io.IOException if there was an error processing the
- * template.
- */
- void writeTo(String fullyQualifedName, Object model, OutputStream out) throws IOException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ViewProcessor.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ViewProcessor.java
deleted file mode 100644
index f1d5a2bf3d4..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/ViewProcessor.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.template;
-
-import com.sun.jersey.api.core.ResourceConfig;
-import com.sun.jersey.api.view.Viewable;
-import java.io.IOException;
-import java.io.OutputStream;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.Provider;
-
-/**
- * A view processor.
- * <p>
- * Implementations of this interface shall be capable of resolving a
- * template name to a template reference that identifies a template supported
- * by the implementation. And, processing the template, identified by template
- * reference, the results of which are written to an output stream.
- * <p>
- * Implementations can register a view processor as a provider, for
- * example, annotating the implementation class with {@link Provider}
- * or registering an implementing class or instance as a singleton with
- * {@link ResourceConfig} or {@link Application}.
- * <p>
- * Such view processors could be JSP view processors (supported by the
- * Jersey servlet and filter implementations) or say Freemarker or Velocity
- * view processors (not implemented).
- *
- * @param <T> the type of the template object.
- * @author Paul.Sandoz@Sun.Com
- */
-public interface ViewProcessor<T> {
-
- /**
- * Resolve a template name to a template reference.
- *
- * @param name the template name
- * @return the template reference, otherwise null
- * if the template name cannot be resolved.
- */
- T resolve(String name);
-
- /**
- * Process a template and write the result to an output stream.
- *
- * @param t the template reference. This is obtained by calling the
- * {@link #resolve(java.lang.String)} method with a template name.
- * @param viewable the viewable that contains the model to be passed to the
- * template.
- * @param out the output stream to write the result of processing the
- * template.
- * @throws java.io.IOException if there was an error processing the
- * template.
- */
- void writeTo(T t, Viewable viewable, OutputStream out) throws IOException;
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/package-info.java
deleted file mode 100644
index c640a72d3af..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/template/package-info.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for view aspect of model view controller and templates that
- * produce views.
- */
-package com.sun.jersey.spi.template;
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriMatchResultContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriMatchResultContext.java
deleted file mode 100644
index 95d4ac07dbf..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriMatchResultContext.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.jersey.spi.uri.rules;
-
-import com.sun.jersey.api.core.Traceable;
-import java.util.regex.MatchResult;
-
-/**
- * The context for matching URI rules.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface UriMatchResultContext extends Traceable {
- /**
- * Get the match result
- *
- * @return the match result.
- */
- MatchResult getMatchResult();
-
- /**
- * Set the match result
- *
- * @param mr the match result.
- */
- void setMatchResult(MatchResult mr);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRule.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRule.java
deleted file mode 100644
index f46440dcf59..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRule.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.uri.rules;
-
-/**
- * A URI rule that can accept a URI path.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface UriRule {
- /**
- * Accept the rule.
- *
- * @param path the URI path
- * @param resource the current resource instance
- * @param context the rule context
- * @return if true then the rule was accepted, if false then the rule was
- * not accepted.
- */
- boolean accept(CharSequence path, Object resource, UriRuleContext context);
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRuleContext.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRuleContext.java
deleted file mode 100644
index 72ff88894fb..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRuleContext.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.uri.rules;
-
-import com.sun.jersey.api.core.HttpContext;
-import com.sun.jersey.api.model.AbstractResourceMethod;
-import com.sun.jersey.api.uri.UriTemplate;
-import com.sun.jersey.spi.container.ContainerRequest;
-import com.sun.jersey.spi.container.ContainerResponse;
-import com.sun.jersey.spi.container.ContainerResponseFilter;
-import java.util.List;
-
-/**
- * The context for processing URI rules.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public interface UriRuleContext extends HttpContext, UriMatchResultContext {
-
- /**
- * Get the container request.
- *
- * @return the container request.
- */
- ContainerRequest getContainerRequest();
-
- /**
- * Set the container request.
- *
- * @param request the container request.
- */
- void setContainerRequest(ContainerRequest request);
-
- /**
- * Get the container response.
- *
- * @return the container response.
- */
- ContainerResponse getContainerResponse();
-
- /**
- * Set the container response.
- *
- * @param response the container response.
- */
- void setContainerResponse(ContainerResponse response);
-
- /**
- * Push a list of container response filters to apply after the
- * container response has been produced.
- * <p>
- * The list of response filters is processed in reverse order of last
- * to first.
- *
- * @param filters the list container response filters
- */
- void pushContainerResponseFilters(List<ContainerResponseFilter> filters);
-
- /**
- * Get the resource instance from a resource class.
- *
- * @param resourceClass the resource class
- * @return the resource instance
- */
- Object getResource(Class resourceClass);
-
- /**
- * Get the rules for a resource class.
- *
- * @param resourceClass the resource class that has rules
- * @return the rules
- */
- UriRules<UriRule> getRules(Class resourceClass);
-
- /**
- * Push a match.
- *
- * @param template the matching URI template.
- * @param names the parameter names associated with the capturing group
- * values.
- */
- void pushMatch(UriTemplate template, List<String> names);
-
- /**
- * Push a matching resource.
- *
- * @param resource the matching resource
- */
- void pushResource(Object resource);
-
- /**
- * Push the matching resource method.
- *
- * @param arm the matching resource method.
- */
- void pushMethod(AbstractResourceMethod arm);
-
- /**
- * Push the right hand path length to calculate the entry for
- * the list of matching (ancestor) URI paths.
- *
- * @param rhpathlen the right hand length
- */
- void pushRightHandPathLength(int rhpathlen);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRules.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRules.java
deleted file mode 100644
index 1033d1ba83b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/UriRules.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.jersey.spi.uri.rules;
-
-import java.util.Iterator;
-
-/**
- * A collection of URI rules that can be matched against a path using
- * associated patterns.
- * <p>
- * The precedence of the rules and the type of patterns is specified by an
- * implementation of this interface.
- *
- * @param <R> the type of rule.
- * @author Paul.Sandoz@Sun.Com
- */
-public interface UriRules<R> {
- /**
- * Match a URI path to the collection of rules and iterate over
- * the matching rules.
- *
- * @param path the URI path to be matched
- * @param resultContext the context to store the match result.
- * The result will be set each time {@link Iterator#next} is called
- * according to the pattern associated with the returned rule.
- * The matching groups in the result are stored in the same order as
- * the pattern's capturing groups.
- * @return an iterator of matching rules
- */
- Iterator<R> match(CharSequence path, UriMatchResultContext resultContext);
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/package-info.java b/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/package-info.java
deleted file mode 100644
index db0609ebaac..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/jersey/spi/uri/rules/package-info.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-/**
- * Provides support for hierarchical matching and accepting of URIs.
- */
-package com.sun.jersey.spi.uri.rules;
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Application.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Application.java
deleted file mode 100644
index 908cc20df1c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Application.java
+++ /dev/null
@@ -1,215 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlElementRefs;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}grammars" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}resources" minOccurs="0"/>
- * &lt;choice maxOccurs="unbounded" minOccurs="0">
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}resource_type"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}method"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}representation"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}fault"/>
- * &lt;/choice>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "grammars",
- "resources",
- "resourceTypeOrMethodOrRepresentation",
- "any"
-})
-@XmlRootElement(name = "application")
-public class Application {
-
- protected List<Doc> doc;
- protected Grammars grammars;
- protected Resources resources;
- @XmlElementRefs({
- @XmlElementRef(name = "resource_type", namespace = "http://research.sun.com/wadl/2006/10", type = ResourceType.class),
- @XmlElementRef(name = "representation", namespace = "http://research.sun.com/wadl/2006/10", type = JAXBElement.class),
- @XmlElementRef(name = "fault", namespace = "http://research.sun.com/wadl/2006/10", type = JAXBElement.class),
- @XmlElementRef(name = "method", namespace = "http://research.sun.com/wadl/2006/10", type = Method.class)
- })
- protected List<Object> resourceTypeOrMethodOrRepresentation;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the grammars property.
- *
- * @return
- * possible object is
- * {@link Grammars }
- *
- */
- public Grammars getGrammars() {
- return grammars;
- }
-
- /**
- * Sets the value of the grammars property.
- *
- * @param value
- * allowed object is
- * {@link Grammars }
- *
- */
- public void setGrammars(Grammars value) {
- this.grammars = value;
- }
-
- /**
- * Gets the value of the resources property.
- *
- * @return
- * possible object is
- * {@link Resources }
- *
- */
- public Resources getResources() {
- return resources;
- }
-
- /**
- * Sets the value of the resources property.
- *
- * @param value
- * allowed object is
- * {@link Resources }
- *
- */
- public void setResources(Resources value) {
- this.resources = value;
- }
-
- /**
- * Gets the value of the resourceTypeOrMethodOrRepresentation property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the resourceTypeOrMethodOrRepresentation property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getResourceTypeOrMethodOrRepresentation().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link JAXBElement }{@code <}{@link RepresentationType }{@code >}
- * {@link JAXBElement }{@code <}{@link RepresentationType }{@code >}
- * {@link ResourceType }
- * {@link Method }
- *
- *
- */
- public List<Object> getResourceTypeOrMethodOrRepresentation() {
- if (resourceTypeOrMethodOrRepresentation == null) {
- resourceTypeOrMethodOrRepresentation = new ArrayList<Object>();
- }
- return this.resourceTypeOrMethodOrRepresentation;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Doc.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Doc.java
deleted file mode 100644
index 878706d61ca..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Doc.java
+++ /dev/null
@@ -1,168 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlMixed;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "content"
-})
-@XmlRootElement(name = "doc")
-public class Doc {
-
- @XmlMixed
- @XmlAnyElement(lax = true)
- protected List<Object> content;
- @XmlAttribute
- protected String title;
- @XmlAttribute(namespace = "http://www.w3.org/XML/1998/namespace")
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlSchemaType(name = "language")
- protected String lang;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the content property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the content property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getContent().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link String }
- * {@link Object }
- *
- *
- */
- public List<Object> getContent() {
- if (content == null) {
- content = new ArrayList<Object>();
- }
- return this.content;
- }
-
- /**
- * Gets the value of the title property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * Sets the value of the title property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setTitle(String value) {
- this.title = value;
- }
-
- /**
- * Gets the value of the lang property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getLang() {
- return lang;
- }
-
- /**
- * Sets the value of the lang property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setLang(String value) {
- this.lang = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Grammars.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Grammars.java
deleted file mode 100644
index fb6f41b4f95..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Grammars.java
+++ /dev/null
@@ -1,144 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}include" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "include",
- "any"
-})
-@XmlRootElement(name = "grammars")
-public class Grammars {
-
- protected List<Doc> doc;
- protected List<Include> include;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the include property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the include property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getInclude().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Include }
- *
- *
- */
- public List<Include> getInclude() {
- if (include == null) {
- include = new ArrayList<Include>();
- }
- return this.include;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/HTTPMethods.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/HTTPMethods.java
deleted file mode 100644
index b7e02342cd3..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/HTTPMethods.java
+++ /dev/null
@@ -1,51 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import javax.xml.bind.annotation.XmlEnum;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for HTTPMethods.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- * <p>
- * <pre>
- * &lt;simpleType name="HTTPMethods">
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- * &lt;enumeration value="GET"/>
- * &lt;enumeration value="POST"/>
- * &lt;enumeration value="PUT"/>
- * &lt;enumeration value="HEAD"/>
- * &lt;enumeration value="DELETE"/>
- * &lt;/restriction>
- * &lt;/simpleType>
- * </pre>
- *
- */
-@XmlType(name = "HTTPMethods")
-@XmlEnum
-public enum HTTPMethods {
-
- GET,
- POST,
- PUT,
- HEAD,
- DELETE;
-
- public String value() {
- return name();
- }
-
- public static HTTPMethods fromValue(String v) {
- return valueOf(v);
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Include.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Include.java
deleted file mode 100644
index 8548cf4ea8b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Include.java
+++ /dev/null
@@ -1,131 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc"
-})
-@XmlRootElement(name = "include")
-public class Include {
-
- protected List<Doc> doc;
- @XmlAttribute
- @XmlSchemaType(name = "anyURI")
- protected String href;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the href property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getHref() {
- return href;
- }
-
- /**
- * Sets the value of the href property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setHref(String value) {
- this.href = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Link.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Link.java
deleted file mode 100644
index cd63bbf0caa..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Link.java
+++ /dev/null
@@ -1,227 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="resource_type" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- * &lt;attribute name="rel" type="{http://www.w3.org/2001/XMLSchema}token" />
- * &lt;attribute name="rev" type="{http://www.w3.org/2001/XMLSchema}token" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "any"
-})
-@XmlRootElement(name = "link")
-public class Link {
-
- protected List<Doc> doc;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute(name = "resource_type")
- @XmlSchemaType(name = "anyURI")
- protected String resourceType;
- @XmlAttribute
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlSchemaType(name = "token")
- protected String rel;
- @XmlAttribute
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlSchemaType(name = "token")
- protected String rev;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the resourceType property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getResourceType() {
- return resourceType;
- }
-
- /**
- * Sets the value of the resourceType property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setResourceType(String value) {
- this.resourceType = value;
- }
-
- /**
- * Gets the value of the rel property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getRel() {
- return rel;
- }
-
- /**
- * Sets the value of the rel property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setRel(String value) {
- this.rel = value;
- }
-
- /**
- * Gets the value of the rev property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getRev() {
- return rev;
- }
-
- /**
- * Sets the value of the rev property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setRev(String value) {
- this.rev = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Method.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Method.java
deleted file mode 100644
index b2ea0d8cccf..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Method.java
+++ /dev/null
@@ -1,281 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlID;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}request" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}response" minOccurs="0"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
- * &lt;attribute name="name" type="{http://research.sun.com/wadl/2006/10}Method" />
- * &lt;attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "request",
- "response",
- "any"
-})
-@XmlRootElement(name = "method")
-public class Method {
-
- protected List<Doc> doc;
- protected Request request;
- protected Response response;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
- @XmlAttribute
- protected String name;
- @XmlAttribute
- @XmlSchemaType(name = "anyURI")
- protected String href;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the request property.
- *
- * @return
- * possible object is
- * {@link Request }
- *
- */
- public Request getRequest() {
- return request;
- }
-
- /**
- * Sets the value of the request property.
- *
- * @param value
- * allowed object is
- * {@link Request }
- *
- */
- public void setRequest(Request value) {
- this.request = value;
- }
-
- /**
- * Gets the value of the response property.
- *
- * @return
- * possible object is
- * {@link Response }
- *
- */
- public Response getResponse() {
- return response;
- }
-
- /**
- * Sets the value of the response property.
- *
- * @param value
- * allowed object is
- * {@link Response }
- *
- */
- public void setResponse(Response value) {
- this.response = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setId(String value) {
- this.id = value;
- }
-
- /**
- * Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) {
- this.name = value;
- }
-
- /**
- * Gets the value of the href property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getHref() {
- return href;
- }
-
- /**
- * Sets the value of the href property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setHref(String value) {
- this.href = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ObjectFactory.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ObjectFactory.java
deleted file mode 100644
index 843d53093c9..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ObjectFactory.java
+++ /dev/null
@@ -1,174 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the com.sun.research.ws.wadl package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private final static QName _Representation_QNAME = new QName("http://research.sun.com/wadl/2006/10", "representation");
- private final static QName _Fault_QNAME = new QName("http://research.sun.com/wadl/2006/10", "fault");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.sun.research.ws.wadl
- *
- */
- public ObjectFactory() {
- }
-
- /**
- * Create an instance of {@link Resource }
- *
- */
- public Resource createResource() {
- return new Resource();
- }
-
- /**
- * Create an instance of {@link Param }
- *
- */
- public Param createParam() {
- return new Param();
- }
-
- /**
- * Create an instance of {@link Request }
- *
- */
- public Request createRequest() {
- return new Request();
- }
-
- /**
- * Create an instance of {@link Application }
- *
- */
- public Application createApplication() {
- return new Application();
- }
-
- /**
- * Create an instance of {@link Method }
- *
- */
- public Method createMethod() {
- return new Method();
- }
-
- /**
- * Create an instance of {@link Grammars }
- *
- */
- public Grammars createGrammars() {
- return new Grammars();
- }
-
- /**
- * Create an instance of {@link Resources }
- *
- */
- public Resources createResources() {
- return new Resources();
- }
-
- /**
- * Create an instance of {@link Doc }
- *
- */
- public Doc createDoc() {
- return new Doc();
- }
-
- /**
- * Create an instance of {@link Option }
- *
- */
- public Option createOption() {
- return new Option();
- }
-
- /**
- * Create an instance of {@link ResourceType }
- *
- */
- public ResourceType createResourceType() {
- return new ResourceType();
- }
-
- /**
- * Create an instance of {@link Link }
- *
- */
- public Link createLink() {
- return new Link();
- }
-
- /**
- * Create an instance of {@link RepresentationType }
- *
- */
- public RepresentationType createRepresentationType() {
- return new RepresentationType();
- }
-
- /**
- * Create an instance of {@link Response }
- *
- */
- public Response createResponse() {
- return new Response();
- }
-
- /**
- * Create an instance of {@link Include }
- *
- */
- public Include createInclude() {
- return new Include();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link RepresentationType }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://research.sun.com/wadl/2006/10", name = "representation")
- public JAXBElement<RepresentationType> createRepresentation(RepresentationType value) {
- return new JAXBElement<RepresentationType>(_Representation_QNAME, RepresentationType.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link RepresentationType }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://research.sun.com/wadl/2006/10", name = "fault")
- public JAXBElement<RepresentationType> createFault(RepresentationType value) {
- return new JAXBElement<RepresentationType>(_Fault_QNAME, RepresentationType.class, null, value);
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Option.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Option.java
deleted file mode 100644
index 407afc2b6e5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Option.java
+++ /dev/null
@@ -1,165 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "any"
-})
-@XmlRootElement(name = "option")
-public class Option {
-
- protected List<Doc> doc;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute(required = true)
- protected String value;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the value property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Param.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Param.java
deleted file mode 100644
index 559ef85a733..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Param.java
+++ /dev/null
@@ -1,461 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlID;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}option" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}link" minOccurs="0"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
- * &lt;attribute name="style" use="required" type="{http://research.sun.com/wadl/2006/10}ParamStyle" />
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
- * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}QName" default="xs:string" />
- * &lt;attribute name="default" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;attribute name="required" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- * &lt;attribute name="repeating" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- * &lt;attribute name="fixed" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;attribute name="path" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "option",
- "link",
- "any"
-})
-@XmlRootElement(name = "param")
-public class Param {
-
- protected List<Doc> doc;
- protected List<Option> option;
- protected Link link;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute(required = true)
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlSchemaType(name = "NMTOKEN")
- protected String name;
- @XmlAttribute(required = true)
- protected ParamStyle style;
- @XmlAttribute
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
- @XmlAttribute
- protected QName type;
- @XmlAttribute(name = "default")
- protected String _default;
- @XmlAttribute
- protected Boolean required;
- @XmlAttribute
- protected Boolean repeating;
- @XmlAttribute
- protected String fixed;
- @XmlAttribute
- protected String path;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the option property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the option property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getOption().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Option }
- *
- *
- */
- public List<Option> getOption() {
- if (option == null) {
- option = new ArrayList<Option>();
- }
- return this.option;
- }
-
- /**
- * Gets the value of the link property.
- *
- * @return
- * possible object is
- * {@link Link }
- *
- */
- public Link getLink() {
- return link;
- }
-
- /**
- * Sets the value of the link property.
- *
- * @param value
- * allowed object is
- * {@link Link }
- *
- */
- public void setLink(Link value) {
- this.link = value;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the name property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) {
- this.name = value;
- }
-
- /**
- * Gets the value of the style property.
- *
- * @return
- * possible object is
- * {@link ParamStyle }
- *
- */
- public ParamStyle getStyle() {
- return style;
- }
-
- /**
- * Sets the value of the style property.
- *
- * @param value
- * allowed object is
- * {@link ParamStyle }
- *
- */
- public void setStyle(ParamStyle value) {
- this.style = value;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setId(String value) {
- this.id = value;
- }
-
- /**
- * Gets the value of the type property.
- *
- * @return
- * possible object is
- * {@link QName }
- *
- */
- public QName getType() {
- if (type == null) {
- return new QName("http://www.w3.org/2001/XMLSchema", "string", "xs");
- } else {
- return type;
- }
- }
-
- /**
- * Sets the value of the type property.
- *
- * @param value
- * allowed object is
- * {@link QName }
- *
- */
- public void setType(QName value) {
- this.type = value;
- }
-
- /**
- * Gets the value of the default property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getDefault() {
- return _default;
- }
-
- /**
- * Sets the value of the default property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setDefault(String value) {
- this._default = value;
- }
-
- /**
- * Gets the value of the required property.
- *
- * @return
- * possible object is
- * {@link Boolean }
- *
- */
- public boolean isRequired() {
- if (required == null) {
- return false;
- } else {
- return required;
- }
- }
-
- /**
- * Sets the value of the required property.
- *
- * @param value
- * allowed object is
- * {@link Boolean }
- *
- */
- public void setRequired(Boolean value) {
- this.required = value;
- }
-
- /**
- * Gets the value of the repeating property.
- *
- * @return
- * possible object is
- * {@link Boolean }
- *
- */
- public boolean isRepeating() {
- if (repeating == null) {
- return false;
- } else {
- return repeating;
- }
- }
-
- /**
- * Sets the value of the repeating property.
- *
- * @param value
- * allowed object is
- * {@link Boolean }
- *
- */
- public void setRepeating(Boolean value) {
- this.repeating = value;
- }
-
- /**
- * Gets the value of the fixed property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getFixed() {
- return fixed;
- }
-
- /**
- * Sets the value of the fixed property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setFixed(String value) {
- this.fixed = value;
- }
-
- /**
- * Gets the value of the path property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getPath() {
- return path;
- }
-
- /**
- * Sets the value of the path property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setPath(String value) {
- this.path = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ParamStyle.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ParamStyle.java
deleted file mode 100644
index 12261bf722c..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ParamStyle.java
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import javax.xml.bind.annotation.XmlEnum;
-import javax.xml.bind.annotation.XmlEnumValue;
-import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for ParamStyle.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- * <p>
- * <pre>
- * &lt;simpleType name="ParamStyle">
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
- * &lt;enumeration value="plain"/>
- * &lt;enumeration value="query"/>
- * &lt;enumeration value="matrix"/>
- * &lt;enumeration value="header"/>
- * &lt;enumeration value="template"/>
- * &lt;/restriction>
- * &lt;/simpleType>
- * </pre>
- *
- */
-@XmlType(name = "ParamStyle")
-@XmlEnum
-public enum ParamStyle {
-
- @XmlEnumValue("plain")
- PLAIN("plain"),
- @XmlEnumValue("query")
- QUERY("query"),
- @XmlEnumValue("matrix")
- MATRIX("matrix"),
- @XmlEnumValue("header")
- HEADER("header"),
- @XmlEnumValue("template")
- TEMPLATE("template");
- private final String value;
-
- ParamStyle(String v) {
- value = v;
- }
-
- public String value() {
- return value;
- }
-
- public static ParamStyle fromValue(String v) {
- for (ParamStyle c: ParamStyle.values()) {
- if (c.value.equals(v)) {
- return c;
- }
- }
- throw new IllegalArgumentException(v);
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/RepresentationType.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/RepresentationType.java
deleted file mode 100644
index 22920e7bd98..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/RepresentationType.java
+++ /dev/null
@@ -1,348 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlID;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for representation_type complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType name="representation_type">
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}param" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
- * &lt;attribute name="element" type="{http://www.w3.org/2001/XMLSchema}QName" />
- * &lt;attribute name="status" type="{http://research.sun.com/wadl/2006/10}statusCodeList" />
- * &lt;attribute name="mediaType" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;attribute name="href" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- * &lt;attribute name="profile" type="{http://research.sun.com/wadl/2006/10}uriList" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "representation_type", propOrder = {
- "doc",
- "param",
- "any"
-})
-public class RepresentationType {
-
- protected List<Doc> doc;
- protected List<Param> param;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
- @XmlAttribute
- protected QName element;
- @XmlAttribute
- protected List<Long> status;
- @XmlAttribute
- protected String mediaType;
- @XmlAttribute
- @XmlSchemaType(name = "anyURI")
- protected String href;
- @XmlAttribute
- protected List<String> profile;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the param property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the param property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getParam().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Param }
- *
- *
- */
- public List<Param> getParam() {
- if (param == null) {
- param = new ArrayList<Param>();
- }
- return this.param;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setId(String value) {
- this.id = value;
- }
-
- /**
- * Gets the value of the element property.
- *
- * @return
- * possible object is
- * {@link QName }
- *
- */
- public QName getElement() {
- return element;
- }
-
- /**
- * Sets the value of the element property.
- *
- * @param value
- * allowed object is
- * {@link QName }
- *
- */
- public void setElement(QName value) {
- this.element = value;
- }
-
- /**
- * Gets the value of the status property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the status property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getStatus().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Long }
- *
- *
- */
- public List<Long> getStatus() {
- if (status == null) {
- status = new ArrayList<Long>();
- }
- return this.status;
- }
-
- /**
- * Gets the value of the mediaType property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getMediaType() {
- return mediaType;
- }
-
- /**
- * Sets the value of the mediaType property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setMediaType(String value) {
- this.mediaType = value;
- }
-
- /**
- * Gets the value of the href property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getHref() {
- return href;
- }
-
- /**
- * Sets the value of the href property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setHref(String value) {
- this.href = value;
- }
-
- /**
- * Gets the value of the profile property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the profile property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getProfile().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link String }
- *
- *
- */
- public List<String> getProfile() {
- if (profile == null) {
- profile = new ArrayList<String>();
- }
- return this.profile;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Request.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Request.java
deleted file mode 100644
index 03d26674ed5..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Request.java
+++ /dev/null
@@ -1,201 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}param" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}representation" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "param",
- "representation",
- "any"
-})
-@XmlRootElement(name = "request")
-public class Request {
-
- protected List<Doc> doc;
- protected List<Param> param;
- protected List<RepresentationType> representation;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the param property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the param property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getParam().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Param }
- *
- *
- */
- public List<Param> getParam() {
- if (param == null) {
- param = new ArrayList<Param>();
- }
- return this.param;
- }
-
- /**
- * Gets the value of the representation property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the representation property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getRepresentation().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link RepresentationType }
- *
- *
- */
- public List<RepresentationType> getRepresentation() {
- if (representation == null) {
- representation = new ArrayList<RepresentationType>();
- }
- return this.representation;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resource.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resource.java
deleted file mode 100644
index 92cf451c541..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resource.java
+++ /dev/null
@@ -1,336 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElements;
-import javax.xml.bind.annotation.XmlID;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}param" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;choice maxOccurs="unbounded" minOccurs="0">
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}method"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}resource"/>
- * &lt;/choice>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
- * &lt;attribute name="type" type="{http://research.sun.com/wadl/2006/10}resource_type_list" />
- * &lt;attribute name="queryType" type="{http://www.w3.org/2001/XMLSchema}string" default="application/x-www-form-urlencoded" />
- * &lt;attribute name="path" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "param",
- "methodOrResource",
- "any"
-})
-@XmlRootElement(name = "resource")
-public class Resource {
-
- protected List<Doc> doc;
- protected List<Param> param;
- @XmlElements({
- @XmlElement(name = "resource", type = Resource.class),
- @XmlElement(name = "method", type = Method.class)
- })
- protected List<Object> methodOrResource;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
- @XmlAttribute
- protected List<String> type;
- @XmlAttribute
- protected String queryType;
- @XmlAttribute
- protected String path;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the param property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the param property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getParam().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Param }
- *
- *
- */
- public List<Param> getParam() {
- if (param == null) {
- param = new ArrayList<Param>();
- }
- return this.param;
- }
-
- /**
- * Gets the value of the methodOrResource property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the methodOrResource property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getMethodOrResource().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Resource }
- * {@link Method }
- *
- *
- */
- public List<Object> getMethodOrResource() {
- if (methodOrResource == null) {
- methodOrResource = new ArrayList<Object>();
- }
- return this.methodOrResource;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setId(String value) {
- this.id = value;
- }
-
- /**
- * Gets the value of the type property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the type property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getType().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link String }
- *
- *
- */
- public List<String> getType() {
- if (type == null) {
- type = new ArrayList<String>();
- }
- return this.type;
- }
-
- /**
- * Gets the value of the queryType property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getQueryType() {
- if (queryType == null) {
- return "application/x-www-form-urlencoded";
- } else {
- return queryType;
- }
- }
-
- /**
- * Sets the value of the queryType property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setQueryType(String value) {
- this.queryType = value;
- }
-
- /**
- * Gets the value of the path property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getPath() {
- return path;
- }
-
- /**
- * Sets the value of the path property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setPath(String value) {
- this.path = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ResourceType.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ResourceType.java
deleted file mode 100644
index dec4d3157b8..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/ResourceType.java
+++ /dev/null
@@ -1,238 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlID;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}param" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}method" maxOccurs="unbounded"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "param",
- "method",
- "any"
-})
-@XmlRootElement(name = "resource_type")
-public class ResourceType {
-
- protected List<Doc> doc;
- protected List<Param> param;
- @XmlElement(required = true)
- protected List<Method> method;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the param property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the param property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getParam().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Param }
- *
- *
- */
- public List<Param> getParam() {
- if (param == null) {
- param = new ArrayList<Param>();
- }
- return this.param;
- }
-
- /**
- * Gets the value of the method property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the method property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getMethod().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Method }
- *
- *
- */
- public List<Method> getMethod() {
- if (method == null) {
- method = new ArrayList<Method>();
- }
- return this.method;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getId() {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setId(String value) {
- this.id = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resources.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resources.java
deleted file mode 100644
index a879cb5f36b..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Resources.java
+++ /dev/null
@@ -1,201 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}resource" maxOccurs="unbounded"/>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;attribute name="base" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "resource",
- "any"
-})
-@XmlRootElement(name = "resources")
-public class Resources {
-
- protected List<Doc> doc;
- @XmlElement(required = true)
- protected List<Resource> resource;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAttribute
- @XmlSchemaType(name = "anyURI")
- protected String base;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the resource property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the resource property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getResource().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Resource }
- *
- *
- */
- public List<Resource> getResource() {
- if (resource == null) {
- resource = new ArrayList<Resource>();
- }
- return this.resource;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets the value of the base property.
- *
- * @return
- * possible object is
- * {@link String }
- *
- */
- public String getBase() {
- return base;
- }
-
- /**
- * Sets the value of the base property.
- *
- * @param value
- * allowed object is
- * {@link String }
- *
- */
- public void setBase(String value) {
- this.base = value;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Response.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Response.java
deleted file mode 100644
index 3a1cad39549..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/Response.java
+++ /dev/null
@@ -1,212 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-
-package com.sun.research.ws.wadl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAnyAttribute;
-import javax.xml.bind.annotation.XmlAnyElement;
-import javax.xml.bind.annotation.XmlElementRef;
-import javax.xml.bind.annotation.XmlElementRefs;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-import org.w3c.dom.Element;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
- * &lt;complexContent>
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * &lt;sequence>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}doc" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}param" maxOccurs="unbounded" minOccurs="0"/>
- * &lt;choice maxOccurs="unbounded" minOccurs="0">
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}representation"/>
- * &lt;element ref="{http://research.sun.com/wadl/2006/10}fault"/>
- * &lt;/choice>
- * &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * &lt;/sequence>
- * &lt;anyAttribute processContents='lax' namespace='##other'/>
- * &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "", propOrder = {
- "doc",
- "param",
- "representationOrFault",
- "any"
-})
-@XmlRootElement(name = "response")
-public class Response {
-
- protected List<Doc> doc;
- protected List<Param> param;
- @XmlElementRefs({
- @XmlElementRef(name = "representation", namespace = "http://research.sun.com/wadl/2006/10", type = JAXBElement.class),
- @XmlElementRef(name = "fault", namespace = "http://research.sun.com/wadl/2006/10", type = JAXBElement.class)
- })
- protected List<JAXBElement<RepresentationType>> representationOrFault;
- @XmlAnyElement(lax = true)
- protected List<Object> any;
- @XmlAnyAttribute
- private Map<QName, String> otherAttributes = new HashMap<QName, String>();
-
- /**
- * Gets the value of the doc property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the doc property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getDoc().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Doc }
- *
- *
- */
- public List<Doc> getDoc() {
- if (doc == null) {
- doc = new ArrayList<Doc>();
- }
- return this.doc;
- }
-
- /**
- * Gets the value of the param property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the param property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getParam().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Param }
- *
- *
- */
- public List<Param> getParam() {
- if (param == null) {
- param = new ArrayList<Param>();
- }
- return this.param;
- }
-
- /**
- * Gets the value of the representationOrFault property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the representationOrFault property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getRepresentationOrFault().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link JAXBElement }{@code <}{@link RepresentationType }{@code >}
- * {@link JAXBElement }{@code <}{@link RepresentationType }{@code >}
- *
- *
- */
- public List<JAXBElement<RepresentationType>> getRepresentationOrFault() {
- if (representationOrFault == null) {
- representationOrFault = new ArrayList<JAXBElement<RepresentationType>>();
- }
- return this.representationOrFault;
- }
-
- /**
- * Gets the value of the any property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- * <pre>
- * getAny().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link Element }
- * {@link Object }
- *
- *
- */
- public List<Object> getAny() {
- if (any == null) {
- any = new ArrayList<Object>();
- }
- return this.any;
- }
-
- /**
- * Gets a map that contains attributes that aren't bound to any typed property on this class.
- *
- * <p>
- * the map is keyed by the name of the attribute and
- * the value is the string value of the attribute.
- *
- * the map returned by this method is live, and you can add new attribute
- * by updating the map directly. Because of this design, there's no setter.
- *
- *
- * @return
- * always non-null
- */
- public Map<QName, String> getOtherAttributes() {
- return otherAttributes;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/package-info.java b/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/package-info.java
deleted file mode 100644
index 46a428ae88f..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/research/ws/wadl/package-info.java
+++ /dev/null
@@ -1,9 +0,0 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2011.06.24 at 12:17:19 PM CEST
-//
-
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://research.sun.com/wadl/2006/10", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package com.sun.research.ws.wadl;
diff --git a/plugins/com.sun.jersey.source/com/sun/ws/rs/ext/RuntimeDelegateImpl.java b/plugins/com.sun.jersey.source/com/sun/ws/rs/ext/RuntimeDelegateImpl.java
deleted file mode 100644
index 565e02b5cf7..00000000000
--- a/plugins/com.sun.jersey.source/com/sun/ws/rs/ext/RuntimeDelegateImpl.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * http://glassfish.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-package com.sun.ws.rs.ext;
-
-import com.sun.jersey.core.spi.factory.AbstractRuntimeDelegate;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-/**
- * A default client-based and hardcoded implementation of
- * {@link RuntimeDelegate} that will be instantiated if all look up mechanisms
- * fail to find an instance.
- * <p>
- * A hardcoded reference to this class name occurs in the {@link RuntimeDelegate}
- * class present in the JAX-RS api jar.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class RuntimeDelegateImpl extends AbstractRuntimeDelegate {
-
- @Override
- public <T> T createEndpoint(Application application, Class<T> endpointType)
- throws IllegalArgumentException, UnsupportedOperationException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ApplicationPath.java b/plugins/com.sun.jersey.source/javax/ws/rs/ApplicationPath.java
deleted file mode 100644
index 76c82bfd4d6..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ApplicationPath.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * ApplicationPath.java
- *
- * Created on August 21, 2009
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Identifies the application path that serves as the base URI
- * for all resource URIs provided by {@link javax.ws.rs.Path}. May only be
- * applied to a subclass of {@link javax.ws.rs.core.Application}.
- *
- * <p>When published in a Servlet container, the value of the application path
- * may be overridden using a servlet-mapping element in the web.xml.</p>
- *
- * @see javax.ws.rs.core.Application
- * @see Path
- * @since 1.1
- */
-@Target({ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ApplicationPath {
- /**
- * Defines the base URI for all resource URIs. A trailing '/' character will
- * be automatically appended if one is not present.
- *
- * <p>The supplied value is automatically percent
- * encoded to conform to the {@code path} production of
- * {@link <a href="http://tools.ietf.org/html/rfc3986#section-3.3">RFC 3986 section 3.3</a>}.
- * Note that percent encoded values are allowed in the value, an
- * implementation will recognize such values and will not double
- * encode the '%' character.</p>
- */
- String value();
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/Consumes.java b/plugins/com.sun.jersey.source/javax/ws/rs/Consumes.java
deleted file mode 100644
index f8472fddbbf..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/Consumes.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Consumes.java
- *
- * Created on September 15, 2006, 2:40 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines the media types that the methods of a resource class or
- * {@link javax.ws.rs.ext.MessageBodyReader} can accept. If
- * not specified, a container will assume that any media type is acceptable.
- * Method level annotations override a class level annotation. A container
- * is responsible for ensuring that the method invoked is capable of consuming
- * the media type of the HTTP request entity body. If no such method is
- * available the container must respond with a HTTP "415 Unsupported Media Type"
- * as specified by RFC 2616.
- *
- * @see javax.ws.rs.ext.MessageBodyReader
- */
-@Inherited
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Consumes {
- /**
- * A list of media types. Each entry may specify a single type or consist
- * of a comma separated list of types. E.g. {"image/jpeg,image/gif",
- * "image/png"}. Use of the comma-separated form allows definition of a
- * common string constant for use on multiple targets.
- */
- String[] value() default "*/*";
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/CookieParam.java b/plugins/com.sun.jersey.source/javax/ws/rs/CookieParam.java
deleted file mode 100644
index e8beda90b10..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/CookieParam.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * CookieParam.java
- *
- * Created on November 16, 2006, 2:04 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Binds the value of a HTTP cookie to a resource method parameter,
- * resource class field, or resource class bean property.
- * A default value can be specified using the {@link DefaultValue}
- * annotation.
- *
- * The type <code>T</code> of the annotated parameter, field or property must
- * either:
- * <ol>
- * <li>Be a primitive type</li>
- * <li>Be {@link javax.ws.rs.core.Cookie}</li>
- * <li>Have a constructor that accepts a single String argument</li>
- * <li>Have a static method named <code>valueOf</code> or <code>fromString</code>
- * that accepts a single
- * String argument (see, for example, {@link Integer#valueOf(String)})
- * <li>Be <code>List&lt;T&gt;</code>, <code>Set&lt;T&gt;</code> or
- * <code>SortedSet&lt;T&gt;</code>, where <code>T</code> satisfies 2, 3 or 4 above.
- * The resulting collection is read-only.</li>
- * </ol>
- *
- * <p>Because injection occurs at object creation time, use of this annotation
- * on resource class fields and bean properties is only supported for the
- * default per-request resource class lifecycle. Resource classes using
- * other lifecycles should only use this annotation on resource method
- * parameters.</p>
- *
- * @see DefaultValue
- * @see javax.ws.rs.core.Cookie
- * @see javax.ws.rs.core.HttpHeaders#getCookies
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface CookieParam {
- /**
- * Defines the name of the HTTP cookie whose value will be used
- * to initialize the value of the annotated method argument, class field or
- * bean property.
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/DELETE.java b/plugins/com.sun.jersey.source/javax/ws/rs/DELETE.java
deleted file mode 100644
index c93bb39f844..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/DELETE.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * DELETE.java
- *
- * Created on October 24, 2007, 5:12 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that the annotated method responds to HTTP DELETE requests
- * @see HttpMethod
- */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod(HttpMethod.DELETE)
-public @interface DELETE {
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/DefaultValue.java b/plugins/com.sun.jersey.source/javax/ws/rs/DefaultValue.java
deleted file mode 100644
index ef552c67a1f..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/DefaultValue.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * DefaultValue.java
- *
- * Created on November 16, 2006, 2:04 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines the default value of request metadata that is bound using one of the
- * following annotations:
- * {@link javax.ws.rs.PathParam},
- * {@link javax.ws.rs.QueryParam},
- * {@link javax.ws.rs.MatrixParam},
- * {@link javax.ws.rs.CookieParam},
- * {@link javax.ws.rs.FormParam},
- * or {@link javax.ws.rs.HeaderParam}.
- * The default value is used if the corresponding metadata is not present in the
- * request.
- *
- * <p>If the type of the annotated parameter is
- * <code>List</code>, <code>Set</code> or <code>SortedSet</code> then the
- * resulting collection will have a single entry mapped from the supplied
- * default value.</p>
- *
- * <p>If this annotation is not used and the corresponding metadata is not
- * present in the request, the value will be an empty collection for
- * <code>List</code>, <code>Set</code> or <code>SortedSet</code>, null for
- * other object types, and the Java-defined default for primitive types.</p>
- *
- * @see PathParam
- * @see QueryParam
- * @see FormParam
- * @see HeaderParam
- * @see MatrixParam
- * @see CookieParam
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface DefaultValue {
- /**
- * The default value.
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/Encoded.java b/plugins/com.sun.jersey.source/javax/ws/rs/Encoded.java
deleted file mode 100644
index 965c019e58d..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/Encoded.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Encoded.java
- *
- * Created on June 29, 2007, 11:40 AM
- *
- */
-
-package javax.ws.rs;
-
-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;
-
-/**
- * Disables automatic decoding of parameter values bound using {@link QueryParam},
- * {@link PathParam}, {@link FormParam} or {@link MatrixParam}.
- * Using this annotation on a method will disable decoding for all parameters.
- * Using this annotation on a class will disable decoding for all parameters of
- * all methods.
- *
- * @see QueryParam
- * @see MatrixParam
- * @see PathParam
- * @see FormParam
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Encoded {
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/FormParam.java b/plugins/com.sun.jersey.source/javax/ws/rs/FormParam.java
deleted file mode 100644
index 96b4d338828..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/FormParam.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * FormParam.java
- *
- * Created on November 16, 2006, 2:04 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Binds the value(s) of a form parameter contained within a request entity body
- * to a resource method parameter. Values are URL decoded unless this is
- * disabled using the {@link Encoded} annotation. A default value can be
- * specified using the {@link DefaultValue} annotation.
- * If the request entity body is absent or is an unsupported media type, the
- * default value is used.
- *
- * The type <code>T</code> of the annotated parameter must either:
- * <ol>
- * <li>Be a primitive type</li>
- * <li>Have a constructor that accepts a single <code>String</code> argument</li>
- * <li>Have a static method named <code>valueOf</code> or <code>fromString</code>
- * that accepts a single
- * <code>String</code> argument (see, for example, {@link Integer#valueOf(String)})</li>
- * <li>Be <code>List&lt;T&gt;</code>, <code>Set&lt;T&gt;</code> or
- * <code>SortedSet&lt;T&gt;</code>, where <code>T</code> satisfies 2 or 3 above.
- * The resulting collection is read-only.</li>
- * </ol>
- *
- * <p>If the type is not one of those listed in 4 above then the first value
- * (lexically) of the parameter is used.</p>
- *
- * <p>Note that, whilst the annotation target permits use on fields and methods,
- * this annotation is only required to be supported on resource method
- * parameters.</p>
- *
- * @see DefaultValue
- * @see Encoded
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface FormParam {
- /**
- * Defines the name of the form parameter whose value will be used
- * to initialize the value of the annotated method argument. The name is
- * specified in decoded form, any percent encoded literals within the value
- * will not be decoded and will instead be treated as literal text. E.g. if
- * the parameter name is "a b" then the value of the annotation is "a b",
- * <i>not</i> "a+b" or "a%20b".
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/GET.java b/plugins/com.sun.jersey.source/javax/ws/rs/GET.java
deleted file mode 100644
index db8f0be9ae2..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/GET.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * GET.java
- *
- * Created on October 24, 2007, 5:12 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that the annotated method responds to HTTP GET requests
- * @see HttpMethod
- */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod(HttpMethod.GET)
-public @interface GET {
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/HEAD.java b/plugins/com.sun.jersey.source/javax/ws/rs/HEAD.java
deleted file mode 100644
index 07a9d1fad6b..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/HEAD.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * HEAD.java
- *
- * Created on October 24, 2007, 5:12 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that the annotated method responds to HTTP HEAD requests
- * @see HttpMethod
- */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod(HttpMethod.HEAD)
-public @interface HEAD {
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/HeaderParam.java b/plugins/com.sun.jersey.source/javax/ws/rs/HeaderParam.java
deleted file mode 100644
index 67c5a5f1bb5..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/HeaderParam.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * HeaderParam.java
- *
- * Created on January 24, 2007, 2:33 PM
- *
- */
-
-package javax.ws.rs;
-
-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;
-
-/**
- * Binds the value(s) of a HTTP header to a resource method parameter,
- * resource class field, or resource class bean property. A default value
- * can be specified using the {@link DefaultValue} annotation.
- *
- * The type <code>T</code> of the annotated parameter, field or property
- * must either:
- * <ol>
- * <li>Be a primitive type</li>
- * <li>Have a constructor that accepts a single <code>String</code> argument</li>
- * <li>Have a static method named <code>valueOf</code> or <code>fromString</code>
- * that accepts a single
- * <code>String</code> argument (see, for example, {@link Integer#valueOf(String)})</li>
- * <li>Be <code>List&lt;T&gt;</code>, <code>Set&lt;T&gt;</code> or
- * <code>SortedSet&lt;T&gt;</code>, where <code>T</code> satisfies 2 or 3 above.
- * The resulting collection is read-only.</li>
- * </ol>
- *
- * <p>If the type is not one of those listed in 4 above then the first value
- * (lexically) of the header is used.</p>
- *
- * <p>Because injection occurs at object creation time, use of this annotation
- * on resource class fields and bean properties is only supported for the
- * default per-request resource class lifecycle. Resource classes using
- * other lifecycles should only use this annotation on resource method
- * parameters.</p>
- *
- * @see DefaultValue
- * @see javax.ws.rs.core.HttpHeaders
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface HeaderParam {
- /**
- * Defines the name of the HTTP header whose value will be used
- * to initialize the value of the annotated method argument, class field or
- * bean property. Case insensitive.
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/HttpMethod.java b/plugins/com.sun.jersey.source/javax/ws/rs/HttpMethod.java
deleted file mode 100644
index 2054233edf3..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/HttpMethod.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * HttpMethod.java
- *
- * Created on October 25, 2006, 2:02 PM
- *
- */
-
-package javax.ws.rs;
-
-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;
-
-/**
- * Associates the name of a HTTP method with an annotation. A Java method annotated
- * with a runtime annotation that is itself annotated with this annotation will
- * be used to handle HTTP requests of the indicated HTTP method. It is an error
- * for a method to be annotated with more than one annotation that is annotated
- * with {@code HttpMethod}.
- *
- * @see GET
- * @see POST
- * @see PUT
- * @see DELETE
- * @see HEAD
- */
-@Target({ElementType.ANNOTATION_TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface HttpMethod {
-
- /**
- * HTTP GET method
- */
- public static final String GET="GET";
- /**
- * HTTP POST method
- */
- public static final String POST="POST";
- /**
- * HTTP PUT method
- */
- public static final String PUT="PUT";
- /**
- * HTTP DELETE method
- */
- public static final String DELETE="DELETE";
- /**
- * HTTP HEAD method
- */
- public static final String HEAD="HEAD";
- /**
- * HTTP OPTIONS method
- */
- public static final String OPTIONS="OPTIONS";
-
- /**
- * Specifies the name of a HTTP method. E.g. "GET".
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/MatrixParam.java b/plugins/com.sun.jersey.source/javax/ws/rs/MatrixParam.java
deleted file mode 100644
index 9acb87ba275..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/MatrixParam.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * MatrixParam.java
- *
- * Created on January 24, 2007, 2:40 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Binds the value(s) of a URI matrix parameter to a resource method parameter,
- * resource class field, or resource class bean property.
- * Values are URL decoded unless this is disabled using the {@link Encoded}
- * annotation. A default value can be specified using the {@link DefaultValue}
- * annotation.
- *
- * The type <code>T</code> of the annotated parameter, field or property must
- * either:
- * <ol>
- * <li>Be a primitive type</li>
- * <li>Have a constructor that accepts a single <code>String</code> argument</li>
- * <li>Have a static method named <code>valueOf</code> or <code>fromString</code>
- * that accepts a single
- * <code>String</code> argument (see, for example, {@link Integer#valueOf(String)})</li>
- * <li>Be <code>List&lt;T&gt;</code>, <code>Set&lt;T&gt;</code> or
- * <code>SortedSet&lt;T&gt;</code>, where <code>T</code> satisfies 2 or 3 above.
- * The resulting collection is read-only.</li>
- * </ol>
- *
- * <p>If the type is not one of those listed in 4 above then the first value
- * (lexically) of the parameter is used.</p>
- *
- * <p>Because injection occurs at object creation time, use of this annotation
- * on resource class fields and bean properties is only supported for the
- * default per-request resource class lifecycle. Resource classes using
- * other lifecycles should only use this annotation on resource method
- * parameters.</p>
- *
- * @see DefaultValue
- * @see Encoded
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface MatrixParam {
- /**
- * Defines the name of the URI matrix parameter whose value will be used
- * to initialize the value of the annotated method argument, class field or
- * bean property. The name is specified in decoded form, any percent encoded
- * literals within the value will not be decoded and will instead be
- * treated as literal text. E.g. if the parameter name is "a b" then the
- * value of the annotation is "a b", <i>not</i> "a+b" or "a%20b".
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/OPTIONS.java b/plugins/com.sun.jersey.source/javax/ws/rs/OPTIONS.java
deleted file mode 100644
index cae832c211e..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/OPTIONS.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * OPTIONS.java
- *
- * Created on March 10, 2009
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that the annotated method responds to HTTP OPTIONS requests
- * @see HttpMethod
- */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod(HttpMethod.OPTIONS)
-public @interface OPTIONS {
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/POST.java b/plugins/com.sun.jersey.source/javax/ws/rs/POST.java
deleted file mode 100644
index e04136ef502..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/POST.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * POST.java
- *
- * Created on October 24, 2007, 5:12 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that the annotated method responds to HTTP POST requests
- * @see HttpMethod
- */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod(HttpMethod.POST)
-public @interface POST {
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/PUT.java b/plugins/com.sun.jersey.source/javax/ws/rs/PUT.java
deleted file mode 100644
index 4315a1e67db..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/PUT.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * PUT.java
- *
- * Created on October 24, 2007, 5:12 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that the annotated method responds to HTTP PUT requests
- * @see HttpMethod
- */
-@Target({ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-@HttpMethod(HttpMethod.PUT)
-public @interface PUT {
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/Path.java b/plugins/com.sun.jersey.source/javax/ws/rs/Path.java
deleted file mode 100644
index a8a8b096466..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/Path.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Path.java
- *
- * Created on September 15, 2006, 2:33 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Identifies the URI path that a resource class or class method will serve
- * requests for.
- *
- * <p>Paths are relative. For an annotated class the base URI is the
- * application path, see {@link javax.ws.rs.ApplicationPath}. For an annotated
- * method the base URI is the
- * effective URI of the containing class. For the purposes of absolutizing a
- * path against the base URI , a leading '/' in a path is
- * ignored and base URIs are treated as if they ended in '/'. E.g.:</p>
- *
- * <pre>&#64;Path("widgets")
- *public class WidgetsResource {
- * &#64;GET
- * String getList() {...}
- *
- * &#64;GET &#64;Path("{id}")
- * String getWidget(&#64;PathParam("id") String id) {...}
- *}</pre>
- *
- * <p>In the above, if the application path is
- * <code>catalogue</code> and the application is deployed at
- * <code>http://example.com/</code>, then <code>GET</code> requests for
- * <code>http://example.com/catalogue/widgets</code> will be handled by the
- * <code>getList</code> method while requests for
- * <code>http://example.com/catalogue/widgets/<i>nnn</i></code> (where
- * <code><i>nnn</i></code> is some value) will be handled by the
- * <code>getWidget</code> method. The same would apply if the value of either
- * <code>&#64;Path</code> annotation started with '/'.
- *
- * <p>Classes and methods may also be annotated with {@link Consumes} and
- * {@link Produces} to filter the requests they will receive.</p>
- *
- * @see Consumes
- * @see Produces
- * @see PathParam
- */
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Path {
- /**
- * Defines a URI template for the resource class or method, must not
- * include matrix parameters.
- *
- * <p>Embedded template parameters are allowed and are of the form:</p>
- *
- * <pre> param = "{" *WSP name *WSP [ ":" *WSP regex *WSP ] "}"
- * name = (ALPHA / DIGIT / "_")*(ALPHA / DIGIT / "." / "_" / "-" ) ; \w[\w\.-]*
- * regex = *( nonbrace / "{" *nonbrace "}" ) ; where nonbrace is any char other than "{" and "}"</pre>
- *
- * <p>See {@link <a href="http://tools.ietf.org/html/rfc5234">RFC 5234</a>}
- * for a description of the syntax used above and the expansions of
- * {@code WSP}, {@code ALPHA} and {@code DIGIT}. In the above {@code name}
- * is the template parameter name and the optional {@code regex} specifies
- * the contents of the capturing group for the parameter. If {@code regex}
- * is not supplied then a default value of {@code [^/]+} which terminates at
- * a path segment boundary, is used. Matching of request URIs to URI
- * templates is performed against encoded path values and implementations
- * will not escape literal characters in regex automatically, therefore any
- * literals in {@code regex} should be escaped by the author according to
- * the rules of
- * {@link <a href="http://tools.ietf.org/html/rfc3986#section-3.3">RFC 3986 section 3.3</a>}.
- * Caution is recommended in the use of {@code regex}, incorrect use can
- * lead to a template parameter matching unexpected URI paths. See
- * {@link <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html">Pattern</a>}
- * for further information on the syntax of regular expressions.
- * Values of template parameters may be extracted using {@link PathParam}.
- *
- * <p>The literal part of the supplied value (those characters
- * that are not part of a template parameter) is automatically percent
- * encoded to conform to the {@code path} production of
- * {@link <a href="http://tools.ietf.org/html/rfc3986#section-3.3">RFC 3986 section 3.3</a>}.
- * Note that percent encoded values are allowed in the literal part of the
- * value, an implementation will recognize such values and will not double
- * encode the '%' character.</p>
- */
- String value();
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/PathParam.java b/plugins/com.sun.jersey.source/javax/ws/rs/PathParam.java
deleted file mode 100644
index ff3bd0f9c49..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/PathParam.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * PathParam.java
- *
- * Created on November 16, 2006, 2:04 PM
- *
- */
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Binds the value of a URI template parameter or a path segment
- * containing the template parameter to a resource method parameter, resource
- * class field, or resource class
- * bean property. The value is URL decoded unless this
- * is disabled using the {@link Encoded} annotation.
- * A default value can be specified using the {@link DefaultValue}
- * annotation.
- *
- * The type of the annotated parameter, field or property must either:
- * <ul>
- * <li>Be {@link javax.ws.rs.core.PathSegment}, the value will be the final
- * segment of the matching part of the path.
- * See {@link javax.ws.rs.core.UriInfo} for a means of retrieving all request
- * path segments.</li>
- * <li>Be {@code List<}{@link javax.ws.rs.core.PathSegment}{@code >}, the
- * value will be a list of {@code PathSegment} corresponding to the path
- * segment(s) that matched the named template parameter.
- * See {@link javax.ws.rs.core.UriInfo} for a means of retrieving all request
- * path segments.</li>
- * <li>Be a primitive type.</li>
- * <li>Have a constructor that accepts a single String argument.</li>
- * <li>Have a static method named <code>valueOf</code> or <code>fromString</code>
- * that accepts a single
- * String argument (see, for example, {@link Integer#valueOf(String)}).
- * </ul>
- *
- * <p>The injected value corresponds to the latest use (in terms of scope) of
- * the path parameter. E.g. if a class and a sub-resource method are both
- * annotated with a {@link Path} containing the same URI template parameter, use
- * of {@code PathParam} on a subresource method parameter will bind the value
- * matching URI template parameter in the method's {@link Path} annotation.</p>
- *
- * <p>Because injection occurs at object creation time, use of this annotation
- * on resource class fields and bean properties is only supported for the
- * default per-request resource class lifecycle. Resource classes using
- * other lifecycles should only use this annotation on resource method
- * parameters.</p>
- *
- * @see Encoded
- * @see DefaultValue
- * @see javax.ws.rs.core.PathSegment
- * @see javax.ws.rs.core.UriInfo
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface PathParam {
- /**
- * Defines the name of the URI template parameter whose value will be used
- * to initialize the value of the annotated method parameter, class field or
- * property. See {@link Path#value()} for a description of the syntax of
- * template parameters.
- *
- * <p>E.g. a class annotated with: <code>&#64;Path("widgets/{id}")</code>
- * can have methods annotated whose arguments are annotated
- * with <code>&#64;PathParam("id")</code>.
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/Produces.java b/plugins/com.sun.jersey.source/javax/ws/rs/Produces.java
deleted file mode 100644
index e9f9153f77c..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/Produces.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Produces.java
- *
- * Created on September 15, 2006, 2:40 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines the media type(s) that the methods of a resource class or
- * {@link javax.ws.rs.ext.MessageBodyWriter} can produce.
- * If not specified then a container will assume that any type can be produced.
- * Method level annotations override a class level annotation. A container
- * is responsible for ensuring that the method invoked is capable of producing
- * one of the media types requested in the HTTP request. If no such method is
- * available the container must respond with a HTTP "406 Not Acceptable" as
- * specified by RFC 2616.
- *
- * <p>A method for which there is a single-valued <code>Produces</code>
- * is not required to set the media type of representations that it produces:
- * the container will use the value of the <code>Produces</code> when
- * sending a response.</p>
- *
- * @see javax.ws.rs.ext.MessageBodyWriter
- */
-@Inherited
-@Target({ElementType.TYPE, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Produces {
- /**
- * A list of media types. Each entry may specify a single type or consist
- * of a comma separated list of types. E.g. {"image/jpeg,image/gif",
- * "image/png"}. Use of the comma-separated form allows definition of a
- * common string constant for use on multiple targets.
- */
- String[] value() default "*/*";
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/QueryParam.java b/plugins/com.sun.jersey.source/javax/ws/rs/QueryParam.java
deleted file mode 100644
index cbedbb97e3a..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/QueryParam.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * QueryParam.java
- *
- * Created on November 16, 2006, 2:04 PM
- *
- */
-
-package javax.ws.rs;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Binds the value(s) of a HTTP query parameter to a resource method parameter,
- * resource class field, or resource class bean property.
- * Values are URL decoded unless this is disabled using the {@link Encoded}
- * annotation. A default value can be specified using the {@link DefaultValue}
- * annotation.
- *
- * The type <code>T</code> of the annotated parameter, field or property must
- * either:
- * <ol>
- * <li>Be a primitive type</li>
- * <li>Have a constructor that accepts a single <code>String</code> argument</li>
- * <li>Have a static method named <code>valueOf</code> or <code>fromString</code>
- * that accepts a single
- * <code>String</code> argument (see, for example, {@link Integer#valueOf(String)})</li>
- * <li>Be <code>List&lt;T&gt;</code>, <code>Set&lt;T&gt;</code> or
- * <code>SortedSet&lt;T&gt;</code>, where <code>T</code> satisfies 2 or 3 above.
- * The resulting collection is read-only.</li>
- * </ol>
- *
- * <p>If the type is not one of those listed in 4 above then the first value
- * (lexically) of the parameter is used.</p>
- *
- * <p>Because injection occurs at object creation time, use of this annotation
- * on resource class fields and bean properties is only supported for the
- * default per-request resource class lifecycle. Resource classes using
- * other lifecycles should only use this annotation on resource method
- * parameters.</p>
- *
- * @see DefaultValue
- * @see Encoded
- * @see javax.ws.rs.core.UriInfo#getQueryParameters
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface QueryParam {
- /**
- * Defines the name of the HTTP query parameter whose value will be used
- * to initialize the value of the annotated method argument, class field or
- * bean property. The name is specified in decoded form, any percent encoded
- * literals within the value will not be decoded and will instead be
- * treated as literal text. E.g. if the parameter name is "a b" then the
- * value of the annotation is "a b", <i>not</i> "a+b" or "a%20b".
- */
- String value();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/WebApplicationException.java b/plugins/com.sun.jersey.source/javax/ws/rs/WebApplicationException.java
deleted file mode 100644
index bbff086a466..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/WebApplicationException.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package javax.ws.rs;
-
-import javax.ws.rs.core.Response;
-
-/**
- * Runtime exception for applications.
- * <p>
- * This exception may be thrown by a resource method, provider or
- * {@link javax.ws.rs.core.StreamingOutput} implementation if a specific
- * HTTP error response needs to be produced. Only effective if thrown prior to
- * the response being committed.
- *
- * @author Paul.Sandoz@Sun.Com
- */
-public class WebApplicationException extends RuntimeException {
-
- private static final long serialVersionUID = 11660101L;
-
- private Response response;
-
- /**
- * Construct a new instance with a blank message and default HTTP status code of 500
- */
- public WebApplicationException() {
- this(null, Response.Status.INTERNAL_SERVER_ERROR);
- }
-
- /**
- * Construct a new instance using the supplied response
- * @param response the response that will be returned to the client, a value
- * of null will be replaced with an internal server error response (status
- * code 500)
- */
- public WebApplicationException(Response response) {
- this(null,response);
- }
-
- /**
- * Construct a new instance with a blank message and specified HTTP status code
- * @param status the HTTP status code that will be returned to the client
- */
- public WebApplicationException(int status) {
- this(null, status);
- }
-
- /**
- * Construct a new instance with a blank message and specified HTTP status code
- * @param status the HTTP status code that will be returned to the client
- * @throws IllegalArgumentException if status is null
- */
- public WebApplicationException(Response.Status status) {
- this(null, status);
- }
-
- /**
- * Construct a new instance with a blank message and default HTTP status code of 500
- * @param cause the underlying cause of the exception
- */
- public WebApplicationException(Throwable cause) {
- this(cause,Response.Status.INTERNAL_SERVER_ERROR);
- }
-
- /**
- * Construct a new instance using the supplied response
- * @param response the response that will be returned to the client, a value
- * of null will be replaced with an internal server error response (status
- * code 500)
- * @param cause the underlying cause of the exception
- */
- public WebApplicationException(Throwable cause, Response response) {
- super(cause);
- if (response==null)
- this.response = Response.serverError().build();
- else
- this.response = response;
- }
-
- /**
- * Construct a new instance with a blank message and specified HTTP status code
- * @param status the HTTP status code that will be returned to the client
- * @param cause the underlying cause of the exception
- */
- public WebApplicationException(Throwable cause, int status) {
- this(cause, Response.status(status).build());
- }
-
- /**
- * Construct a new instance with a blank message and specified HTTP status code
- * @param status the HTTP status code that will be returned to the client
- * @param cause the underlying cause of the exception
- * @throws IllegalArgumentException if status is null
- */
- public WebApplicationException(Throwable cause, Response.Status status) {
- this(cause, Response.status(status).build());
- }
-
- /**
- * Get the HTTP response.
- *
- * @return the HTTP response.
- */
- public Response getResponse() {
- return response;
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/Application.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/Application.java
deleted file mode 100644
index e5c33402cdc..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/Application.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * 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.Set;
-
-/**
- * Defines the components of a JAX-RS application and supplies additional
- * metadata. A JAX-RS application or implementation supplies a concrete
- * subclass of this abstract class.
- *
- * <p>The implementation-created instance of an Application subclass may be
- * injected into resource classes and providers using
- * {@link javax.ws.rs.core.Context}.<p>
- *
- */
-public class Application {
- private static final Set<Object> emptyObjectSet = Collections.emptySet();
- private static final Set<Class<?>> emptyClassSet = Collections.emptySet();
-
- /**
- * Get a set of root resource and provider classes. The default lifecycle
- * for resource class instances is per-request. The default lifecycle for
- * providers is singleton.
- *
- * <p>Implementations should warn about and ignore classes that do not
- * conform to the requirements of root resource or provider classes.
- * Implementations should warn about and ignore classes for which
- * {@link #getSingletons()} returns an instance. Implementations MUST
- * NOT modify the returned set.</p>
- *
- * <p>The default implementation returns an empty set.</p>
- *
- * @return a set of root resource and provider classes. Returning null
- * is equivalent to returning an empty set.
- */
- public Set<Class<?>> getClasses() {
- return emptyClassSet;
- }
-
- /**
- * Get a set of root resource and provider instances. Fields and properties
- * of returned instances are injected with their declared dependencies
- * (see {@link Context}) by the runtime prior to use.
- *
- * <p>Implementations should warn about and ignore classes that do not
- * conform to the requirements of root resource or provider classes.
- * Implementations should flag an error if the returned set includes
- * more than one instance of the same class. Implementations MUST
- * NOT modify the returned set.</p>
- *
- * <p>The default implementation returns an empty set.</p>
- *
- * @return a set of root resource and provider instances. Returning null
- * is equivalent to returning an empty set.
- */
- public Set<Object> getSingletons() {
- return emptyObjectSet;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/CacheControl.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/CacheControl.java
deleted file mode 100644
index 5eb46167cc3..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/CacheControl.java
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * CacheControl.java
- *
- * Created on March 5, 2007, 3:36 PM
- */
-
-package javax.ws.rs.core;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.ext.RuntimeDelegate;
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-
-/**
- * An abstraction for the value of a HTTP Cache-Control response header.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">HTTP/1.1 section 14.9</a>
- */
-public class CacheControl {
- private boolean _private;
- private List<String> privateFields;
- private boolean noCache;
- private List<String> noCacheFields;
- private boolean noStore;
- private boolean noTransform;
- private boolean mustRevalidate;
- private boolean proxyRevalidate;
- private int maxAge = -1;
- private int sMaxAge = -1;
- private Map<String, String> cacheExtension;
-
- private static final HeaderDelegate<CacheControl> delegate =
- RuntimeDelegate.getInstance().createHeaderDelegate(CacheControl.class);
-
-
- /**
- * Create a new instance of CacheControl. The new instance will have the
- * following default settings:
- *
- * <ul>
- * <li>private = false</li>
- * <li>noCache = false</li>
- * <li>noStore = false</li>
- * <li>noTransform = true</li>
- * <li>mustRevalidate = false</li>
- * <li>proxyRevalidate = false</li>
- * <li>An empty list of private fields</li>
- * <li>An empty list of no-cache fields</li>
- * <li>An empty map of cache extensions</li>
- * </ul>
- */
- public CacheControl() {
- _private = false;
- noCache = false;
- noStore = false;
- noTransform = true;
- mustRevalidate = false;
- proxyRevalidate = false;
- }
-
- /**
- * Creates a new instance of CacheControl by parsing the supplied string.
- * @param value the cache control string
- * @return the newly created CacheControl
- * @throws IllegalArgumentException if the supplied string cannot be parsed
- * or is null
- */
- public static CacheControl valueOf(String value) throws IllegalArgumentException {
- return delegate.fromString(value);
- }
-
- /**
- * Corresponds to the must-revalidate cache control directive.
- * @return true if the must-revalidate cache control directive will be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4">HTTP/1.1 section 14.9.4</a>
- */
- public boolean isMustRevalidate() {
- return mustRevalidate;
- }
-
- /**
- * Corresponds to the must-revalidate cache control directive.
- * @param mustRevalidate true if the must-revalidate cache control directive should be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4">HTTP/1.1 section 14.9.4</a>
- */
- public void setMustRevalidate(boolean mustRevalidate) {
- this.mustRevalidate = mustRevalidate;
- }
-
- /**
- * Corresponds to the proxy-revalidate cache control directive.
- * @return true if the proxy-revalidate cache control directive will be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4">HTTP/1.1 section 14.9.4</a>
- */
- public boolean isProxyRevalidate() {
- return proxyRevalidate;
- }
-
- /**
- * Corresponds to the must-revalidate cache control directive.
- * @param proxyRevalidate true if the proxy-revalidate cache control directive should be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.4">HTTP/1.1 section 14.9.4</a>
- */
- public void setProxyRevalidate(boolean proxyRevalidate) {
- this.proxyRevalidate = proxyRevalidate;
- }
-
- /**
- * Corresponds to the max-age cache control directive.
- * @return the value of the max-age cache control directive, -1 if the directive is disabled.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3">HTTP/1.1 section 14.9.3</a>
- */
- public int getMaxAge() {
- return maxAge;
- }
-
- /**
- * Corresponds to the max-age cache control directive.
- * @param maxAge the value of the max-age cache control directive, a value of -1 will disable the directive.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3">HTTP/1.1 section 14.9.3</a>
- */
- public void setMaxAge(int maxAge) {
- this.maxAge = maxAge;
- }
-
- /**
- * Corresponds to the s-maxage cache control directive.
- * @return the value of the s-maxage cache control directive, -1 if the directive is disabled.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3">HTTP/1.1 section 14.9.3</a>
- */
- public int getSMaxAge() {
- return sMaxAge;
- }
-
- /**
- * Corresponds to the s-maxage cache control directive.
- * @param sMaxAge the value of the s-maxage cache control directive, a value of -1 will disable the directive.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.3">HTTP/1.1 section 14.9.3</a>
- */
- public void setSMaxAge(int sMaxAge) {
- this.sMaxAge = sMaxAge;
- }
-
- /**
- * Corresponds to the value of the no-cache cache control directive.
- * @return a mutable list of field-names that will form the value of the no-cache cache control directive.
- * An empty list results in a bare no-cache directive.
- * @see #isNoCache
- * @see #setNoCache
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1">HTTP/1.1 section 14.9.1</a>
- */
- public List<String> getNoCacheFields() {
- if (noCacheFields == null)
- noCacheFields = new ArrayList<String>();
- return noCacheFields;
- }
-
- /**
- * Corresponds to the no-cache cache control directive.
- * @param noCache true if the no-cache cache control directive should be included in the
- * response, false otherwise.
- * @see #getNoCacheFields
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1">HTTP/1.1 section 14.9.1</a>
- */
- public void setNoCache(boolean noCache) {
- this.noCache = noCache;
- }
-
- /**
- * Corresponds to the no-cache cache control directive.
- * @return true if the no-cache cache control directive will be included in the
- * response, false otherwise.
- * @see #getNoCacheFields
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1">HTTP/1.1 section 14.9.1</a>
- */
- public boolean isNoCache() {
- return noCache;
- }
-
- /**
- * Corresponds to the private cache control directive.
- * @return true if the private cache control directive will be included in the
- * response, false otherwise.
- * @see #getPrivateFields
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1">HTTP/1.1 section 14.9.1</a>
- */
- public boolean isPrivate() {
- return _private;
- }
-
- /**
- * Corresponds to the value of the private cache control directive.
- * @return a mutable list of field-names that will form the value of the private cache control directive.
- * An empty list results in a bare no-cache directive.
- * @see #isPrivate
- * @see #setPrivate
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1">HTTP/1.1 section 14.9.1</a>
- */
- public List<String> getPrivateFields() {
- if (privateFields == null)
- privateFields = new ArrayList<String>();
- return privateFields;
- }
-
- /**
- * Corresponds to the private cache control directive.
- * @param _private true if the private cache control directive should be included in the
- * response, false otherwise.
- * @see #getPrivateFields
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1">HTTP/1.1 section 14.9.1</a>
- */
- public void setPrivate(boolean _private) {
- this._private = _private;
- }
-
- /**
- * Corresponds to the no-transform cache control directive.
- * @return true if the no-transform cache control directive will be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5">HTTP/1.1 section 14.9.5</a>
- */
- public boolean isNoTransform() {
- return noTransform;
- }
-
- /**
- * Corresponds to the no-transform cache control directive.
- * @param noTransform true if the no-transform cache control directive should be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5">HTTP/1.1 section 14.9.5</a>
- */
- public void setNoTransform(boolean noTransform) {
- this.noTransform = noTransform;
- }
-
- /**
- * Corresponds to the no-store cache control directive.
- * @return true if the no-store cache control directive will be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.2">HTTP/1.1 section 14.9.2</a>
- */
- public boolean isNoStore() {
- return noStore;
- }
-
- /**
- * Corresponds to the no-store cache control directive.
- * @param noStore true if the no-store cache control directive should be included in the
- * response, false otherwise.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.2">HTTP/1.1 section 14.9.2</a>
- */
- public void setNoStore(boolean noStore) {
- this.noStore = noStore;
- }
-
- /**
- * Corresponds to a set of extension cache control directives.
- * @return a mutable map of cache control extension names and their values.
- * If a key has a null value, it will appear as a bare directive. If a key has
- * a value that contains no whitespace then the directive will appear as
- * a simple name=value pair. If a key has a value that contains whitespace
- * then the directive will appear as a quoted name="value" pair.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.6">HTTP/1.1 section 14.9.6</a>
- */
- public Map<String, String> getCacheExtension() {
- if (cacheExtension == null)
- cacheExtension = new HashMap<String, String>();
- return cacheExtension;
- }
-
- /**
- * Convert the cache control to a string suitable for use as the value of the
- * corresponding HTTP header.
- * @return a stringified cache control
- */
- @Override
- public String toString() {
- return delegate.toString(this);
- }
-
- /**
- * Generate hash code from cache control properties.
- * @return the hashCode
- */
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 41 * hash + (this._private ? 1 : 0);
- hash = 41 * hash + (this.privateFields != null ? this.privateFields.hashCode() : 0);
- hash = 41 * hash + (this.noCache ? 1 : 0);
- hash = 41 * hash + (this.noCacheFields != null ? this.noCacheFields.hashCode() : 0);
- hash = 41 * hash + (this.noStore ? 1 : 0);
- hash = 41 * hash + (this.noTransform ? 1 : 0);
- hash = 41 * hash + (this.mustRevalidate ? 1 : 0);
- hash = 41 * hash + (this.proxyRevalidate ? 1 : 0);
- hash = 41 * hash + this.maxAge;
- hash = 41 * hash + this.sMaxAge;
- hash = 41 * hash + (this.cacheExtension != null ? this.cacheExtension.hashCode() : 0);
- return hash;
- }
-
- /**
- * Compares obj to this cache control to see if they are the same
- * considering all property values.
- * @param obj the object to compare to
- * @return true if the two cache controls are the same, false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final CacheControl other = (CacheControl) obj;
- if (this._private != other._private) {
- return false;
- }
- if (this.privateFields != other.privateFields && (this.privateFields == null || !this.privateFields.equals(other.privateFields))) {
- return false;
- }
- if (this.noCache != other.noCache) {
- return false;
- }
- if (this.noCacheFields != other.noCacheFields && (this.noCacheFields == null || !this.noCacheFields.equals(other.noCacheFields))) {
- return false;
- }
- if (this.noStore != other.noStore) {
- return false;
- }
- if (this.noTransform != other.noTransform) {
- return false;
- }
- if (this.mustRevalidate != other.mustRevalidate) {
- return false;
- }
- if (this.proxyRevalidate != other.proxyRevalidate) {
- return false;
- }
- if (this.maxAge != other.maxAge) {
- return false;
- }
- if (this.sMaxAge != other.sMaxAge) {
- return false;
- }
- if (this.cacheExtension != other.cacheExtension && (this.cacheExtension == null || !this.cacheExtension.equals(other.cacheExtension))) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/Context.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/Context.java
deleted file mode 100644
index 953823c998c..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/Context.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Context.java
- *
- * Created on November 16, 2006, 3:37 PM
- *
- */
-
-package javax.ws.rs.core;
-
-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;
-
-/**
- * This annotation is used to inject information into a class
- * field, bean property or method parameter.
- * @see Application
- * @see UriInfo
- * @see Request
- * @see HttpHeaders
- * @see SecurityContext
- * @see javax.ws.rs.ext.Providers
- */
-@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Context {
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/Cookie.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/Cookie.java
deleted file mode 100644
index 4b8742ec5d8..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/Cookie.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Cookie.java
- *
- * Created on March 12, 2007, 5:01 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import javax.ws.rs.ext.RuntimeDelegate;
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-
-/**
- * Represents the value of a HTTP cookie, transferred in a request.
- * RFC 2109 specifies the legal characters for name,
- * value, path and domain. The default version of 1 corresponds to RFC 2109.
- * @see <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109</a>
- */
-public class Cookie {
-
- /**
- * Cookies using the default version correspond to RFC 2109.
- */
- public static final int DEFAULT_VERSION = 1;
-
- private static final HeaderDelegate<Cookie> delegate =
- RuntimeDelegate.getInstance().createHeaderDelegate(Cookie.class);
-
- private String name;
- private String value;
- private int version;
- private String path;
- private String domain;
-
- /**
- * Create a new instance.
- * @param name the name of the cookie
- * @param value the value of the cookie
- * @param path the URI path for which the cookie is valid
- * @param domain the host domain for which the cookie is valid
- * @param version the version of the specification to which the cookie complies
- * @throws IllegalArgumentException if name is null
- */
- public Cookie(String name, String value, String path, String domain, int version) {
- if (name == null)
- throw new IllegalArgumentException("name==null");
- this.name = name;
- this.value = value;
- this.version = version;
- this.domain = domain;
- this.path = path;
- }
-
- /**
- * Create a new instance.
- * @param name the name of the cookie
- * @param value the value of the cookie
- * @param path the URI path for which the cookie is valid
- * @param domain the host domain for which the cookie is valid
- * @throws IllegalArgumentException if name is null
- */
- public Cookie(String name, String value, String path, String domain) {
- this(name, value, path, domain, DEFAULT_VERSION);
- }
-
- /**
- * Create a new instance.
- * @param name the name of the cookie
- * @param value the value of the cookie
- * @throws IllegalArgumentException if name is null
- */
- public Cookie(String name, String value) {
- this(name, value, null, null);
- }
-
- /**
- * Creates a new instance of Cookie by parsing the supplied string.
- * @param value the cookie string
- * @return the newly created Cookie
- * @throws IllegalArgumentException if the supplied string cannot be parsed
- * or is null
- */
- public static Cookie valueOf(String value) throws IllegalArgumentException {
- return delegate.fromString(value);
- }
-
- /**
- * Get the name of the cookie
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get the value of the cookie
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Get the version of the cookie
- * @return the version
- */
- public int getVersion() {
- return version;
- }
-
- /**
- * Get the domain of the cookie
- * @return the domain
- */
- public String getDomain() {
- return domain;
- }
-
- /**
- * Get the path of the cookie
- * @return the path
- */
- public String getPath() {
- return path;
- }
-
- /**
- * Convert the cookie to a string suitable for use as the value of the
- * corresponding HTTP header.
- * @return a stringified cookie
- */
- @Override
- public String toString() {
- return delegate.toString(this);
- }
-
- /**
- * Generate a hashcode by hashing all of the cookies properties
- * @return the hashcode
- */
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 97 * hash + (this.name != null ? this.name.hashCode() : 0);
- hash = 97 * hash + (this.value != null ? this.value.hashCode() : 0);
- hash = 97 * hash + this.version;
- hash = 97 * hash + (this.path != null ? this.path.hashCode() : 0);
- hash = 97 * hash + (this.domain != null ? this.domain.hashCode() : 0);
- return hash;
- }
-
- /**
- * Compare for equality
- * @param obj the object to compare to
- * @return true if the object is a {@code Cookie} with the same value for
- * all properties, false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Cookie other = (Cookie) obj;
- if (this.name != other.name && (this.name == null || !this.name.equals(other.name))) {
- return false;
- }
- if (this.value != other.value && (this.value == null || !this.value.equals(other.value))) {
- return false;
- }
- if (this.version != other.version) {
- return false;
- }
- if (this.path != other.path && (this.path == null || !this.path.equals(other.path))) {
- return false;
- }
- if (this.domain != other.domain && (this.domain == null || !this.domain.equals(other.domain))) {
- return false;
- }
- return true;
- }
-
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/EntityTag.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/EntityTag.java
deleted file mode 100644
index 4e7aafae966..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/EntityTag.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * EntityTag.java
- *
- * Created on March 21, 2007, 3:14 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import javax.ws.rs.ext.RuntimeDelegate;
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-
-/**
- * An abstraction for the value of a HTTP Entity Tag, used as the value
- * of an ETag response header.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.11">HTTP/1.1 section 3.11</a>
- */
-public class EntityTag {
-
- private String value;
- private boolean weak;
-
- private static final HeaderDelegate<EntityTag> delegate =
- RuntimeDelegate.getInstance().createHeaderDelegate(EntityTag.class);
-
- /**
- * Creates a new instance of a strong EntityTag.
- * @param value the value of the tag, quotes not included.
- * @throws IllegalArgumentException if value is null
- */
- public EntityTag(String value) {
- this(value, false);
- }
-
- /**
- * Creates a new instance of an EntityTag
- * @param value the value of the tag, quotes not included.
- * @param weak true if this represents a weak tag, false otherwise
- * @throws IllegalArgumentException if value is null
- */
- public EntityTag(String value, boolean weak) {
- if (value == null)
- throw new IllegalArgumentException("value==null");
- this.value = value;
- this.weak = weak;
- }
-
- /**
- * Creates a new instance of EntityTag by parsing the supplied string.
- * @param value the entity tag string
- * @return the newly created EntityTag
- * @throws IllegalArgumentException if the supplied string cannot be parsed
- * or is null
- */
- public static EntityTag valueOf(String value) throws IllegalArgumentException {
- return delegate.fromString(value);
- }
-
- /**
- * Check the strength of an EntityTag
- * @return true if this represents a weak tag, false otherwise
- */
- public boolean isWeak() {
- return weak;
- }
-
- /**
- * Get the value of an EntityTag
- * @return the value of the tag
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Compares obj to this tag to see if they are the same considering weakness and
- * value.
- * @param obj the object to compare to
- * @return true if the two tags are the same, false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null)
- return false;
- if (!(obj instanceof EntityTag))
- return super.equals(obj);
- EntityTag other = (EntityTag)obj;
- if (value.equals(other.getValue()) && weak==other.isWeak())
- return true;
- return false;
- }
-
- /**
- * Generate hashCode based on value and weakness.
- * @return the hashCode
- */
- @Override
- public int hashCode() {
- int hash = 3;
- hash = 17 * hash + (this.value != null ? this.value.hashCode() : 0);
- hash = 17 * hash + (this.weak ? 1 : 0);
- return hash;
- }
-
- /**
- * Convert the entity tag to a string suitable for use as the value of the
- * corresponding HTTP header.
- * @return a stringified entity tag
- */
- @Override
- public String toString() {
- return delegate.toString(this);
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/GenericEntity.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/GenericEntity.java
deleted file mode 100644
index 1f400c5a5a5..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/GenericEntity.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package javax.ws.rs.core;
-
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- *
- * This file incorporates work covered by the following copyright and
- * permission notice:
- *
- * Copyright (C) 2006 Google Inc.
- *
- * Licensed 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.
- */
-import java.lang.reflect.GenericArrayType;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import javax.ws.rs.ext.MessageBodyWriter;
-
-/**
- * Represents a response entity of a generic type {@code T}.
- *
- * <p>Normally type erasure removes generic type information such that a
- * {@link Response} instance that contains, e.g., an entity of type
- * {@code List<String>} appears to contain a raw {@code List<?>} at runtime.
- * When the generic type is required to select a suitable
- * {@link MessageBodyWriter}, this class may be used to wrap the entity and
- * capture its generic type.</p>
- *
- * <p>There are two ways to create an instance:</p>
- * <ol>
- * <li>Create a (typically anonymous) subclass of this
- * class which enables retrieval of the type information at runtime despite
- * type erasure. For example, the following code shows how to create a
- * {@link Response} containing an entity of type {@code List<String>} whose
- * generic type will be available at runtime for selection of a suitable
- * {@link MessageBodyWriter}:
- *
- * <pre>List&lt;String&gt; list = new ArrayList&lt;String&gt;();
- *GenericEntity&lt;List&lt;String&gt;&gt; entity = new GenericEntity&lt;List&lt;String&gt;&gt;(list) {};
- *Response response = Response.ok(entity).build();</pre>
- *
- * <p>where <code>list</code> is the instance of <code>List&lt;String&gt</code>
- * that will form the response body and entity is an instance of an anonymous
- * subclass of {@code GenericEntity}.</p></li>
- * <li>Create an instance directly by supplying the generic type information
- * with the entity. For example the following code shows how to create
- * a response containing the result of a method invoked via reflection:
- * <pre>Method method = ...;
- *GenericEntity&lt;Object&gt; entity = new GenericEntity&lt;Object&gt;(
- * method.invoke(...), method.getGenericReturnType());
- *Response response = Response.ok(entity).build();</pre></li>
- * <p>The above obtains the generic type from the return type of the method,
- * the raw type is the class of entity.</p>
- * </ol>
- */
-public class GenericEntity<T> {
-
- final Class<?> rawType;
- final Type type;
- final T entity;
-
- /**
- * Constructs a new generic entity. Derives represented class from type
- * parameter. Note that this constructor is protected, users should create
- * a (usually anonymous) subclass as shown above.
- *
- * @param entity the entity instance, must not be null
- * @throws IllegalArgumentException if entity is null
- */
- protected GenericEntity(T entity) {
- if (entity == null) {
- throw new IllegalArgumentException("The entity must not be null");
- }
- this.entity = entity;
- this.type = getSuperclassTypeParameter(getClass());
- this.rawType = entity.getClass();
- }
-
- /**
- * Create a new instance of GenericEntity, supplying the generic type
- * information. The entity must be assignable to a variable of the
- * supplied generic type, e.g. if {@code entity} is an instance of
- * {@code ArrayList<String>} then {@code genericType} could
- * be the same or a superclass of {@code ArrayList} with the same generic
- * type like {@code List<String>}.
- * @param entity the entity instance, must not be null
- * @param genericType the generic type, must not be null
- * @throws IllegalArgumentException if the entity is not assignable to
- * a variable of the supplied generic type or if entity or genericType
- * is null.
- */
- public GenericEntity(T entity, Type genericType) {
- if (entity == null || genericType==null) {
- throw new IllegalArgumentException("Arguments must not be null");
- }
- this.entity = entity;
- this.rawType = entity.getClass();
- checkTypeCompatibility(this.rawType, genericType);
- this.type = genericType;
- }
-
- private void checkTypeCompatibility(Class<?> c, Type t) {
- if (t instanceof Class) {
- Class<?> ct = (Class<?>)t;
- if (ct.isAssignableFrom(c))
- return;
- } else if (t instanceof ParameterizedType) {
- ParameterizedType pt = (ParameterizedType)t;
- Type rt = pt.getRawType();
- checkTypeCompatibility(c, rt);
- return;
- } else if (c.isArray() && (t instanceof GenericArrayType)) {
- GenericArrayType at = (GenericArrayType)t;
- Type rt = at.getGenericComponentType();
- checkTypeCompatibility(c.getComponentType(), rt);
- return;
- }
- throw new IllegalArgumentException("The type is incompatible with the class of the entity");
- }
-
- /**
- * Returns the type from super class's type parameter.
- */
- private static Type getSuperclassTypeParameter(Class<?> subclass) {
- Type superclass = subclass.getGenericSuperclass();
- if (!(superclass instanceof ParameterizedType)) {
- throw new RuntimeException("Missing type parameter.");
- }
- ParameterizedType parameterized = (ParameterizedType) superclass;
- return parameterized.getActualTypeArguments()[0];
- }
-
- /**
- * Gets the raw type of the enclosed entity. Note that this is the raw type of
- * the instance, not the raw type of the type parameter. I.e. in the example
- * in the introduction, the raw type is {@code ArrayList} not {@code List}.
- * @return the raw type
- */
- public final Class<?> getRawType() {
- return rawType;
- }
-
- /**
- * Gets underlying {@code Type} instance. Note that this is derived from the
- * type parameter, not the enclosed instance. I.e. in the example
- * in the introduction, the type is {@code List<String>} not
- * {@code ArrayList<String>}.
- * @return the type
- */
- public final Type getType() {
- return type;
- }
-
- /**
- * Get the enclosed entity
- * @return the enclosed entity
- */
- public final T getEntity() {
- return entity;
- }
-} \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/HttpHeaders.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/HttpHeaders.java
deleted file mode 100644
index f031b116eca..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/HttpHeaders.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-/*
- * HttpHeaders.java
- *
- * Created on April 13, 2007, 3:00 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * An injectable interface that provides access to HTTP header information.
- * All methods throw java.lang.IllegalStateException if called outside the scope of a request
- * (e.g. from a provider constructor).
- * @see Context
- */
-public interface HttpHeaders {
-
- /**
- * Get the values of a HTTP request header. The returned List is read-only.
- * This is a shortcut for <code>getRequestHeaders().get(name)</code>.
- * @param name the header name, case insensitive
- * @return a read-only list of header values.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public List<String> getRequestHeader(String name);
-
- /**
- * Get the values of HTTP request headers. The returned Map is case-insensitive
- * wrt keys and is read-only.
- * @return a read-only map of header names and values.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public MultivaluedMap<String, String> getRequestHeaders();
-
- /**
- * Get a list of media types that are acceptable for the response.
- * @return a read-only list of requested response media types sorted according
- * to their q-value, with highest preference first.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public List<MediaType> getAcceptableMediaTypes();
-
- /**
- * Get a list of languages that are acceptable for the response.
- * @return a read-only list of acceptable languages sorted according
- * to their q-value, with highest preference first.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public List<Locale> getAcceptableLanguages();
-
- /**
- * Get the media type of the request entity
- * @return the media type or null if there is no request entity.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public MediaType getMediaType();
-
- /**
- * Get the language of the request entity
- * @return the language of the entity or null if not specified
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public Locale getLanguage();
-
- /**
- * Get any cookies that accompanied the request.
- * @return a read-only map of cookie name (String) to Cookie.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public Map<String, Cookie> getCookies();
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1">HTTP/1.1 documentation</a>}.
- */
- public static final String ACCEPT = "Accept";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2">HTTP/1.1 documentation</a>}.
- */
- public static final String ACCEPT_CHARSET = "Accept-Charset";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3">HTTP/1.1 documentation</a>}.
- */
- public static final String ACCEPT_ENCODING = "Accept-Encoding";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4">HTTP/1.1 documentation</a>}.
- */
- public static final String ACCEPT_LANGUAGE = "Accept-Language";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.8">HTTP/1.1 documentation</a>}.
- */
- public static final String AUTHORIZATION = "Authorization";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9">HTTP/1.1 documentation</a>}.
- */
- public static final String CACHE_CONTROL = "Cache-Control";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11">HTTP/1.1 documentation</a>}.
- */
- public static final String CONTENT_ENCODING = "Content-Encoding";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.12">HTTP/1.1 documentation</a>}.
- */
- public static final String CONTENT_LANGUAGE = "Content-Language";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13">HTTP/1.1 documentation</a>}.
- */
- public static final String CONTENT_LENGTH = "Content-Length";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.14">HTTP/1.1 documentation</a>}.
- */
- public static final String CONTENT_LOCATION = "Content-Location";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17">HTTP/1.1 documentation</a>}.
- */
- public static final String CONTENT_TYPE = "Content-Type";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18">HTTP/1.1 documentation</a>}.
- */
- public static final String DATE = "Date";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19">HTTP/1.1 documentation</a>}.
- */
- public static final String ETAG = "ETag";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21">HTTP/1.1 documentation</a>}.
- */
- public static final String EXPIRES = "Expires";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23">HTTP/1.1 documentation</a>}.
- */
- public static final String HOST = "Host";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24">HTTP/1.1 documentation</a>}.
- */
- public static final String IF_MATCH = "If-Match";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25">HTTP/1.1 documentation</a>}.
- */
- public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26">HTTP/1.1 documentation</a>}.
- */
- public static final String IF_NONE_MATCH = "If-None-Match";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.28">HTTP/1.1 documentation</a>}.
- */
- public static final String IF_UNMODIFIED_SINCE = "If-Unmodified-Since";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29">HTTP/1.1 documentation</a>}.
- */
- public static final String LAST_MODIFIED = "Last-Modified";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30">HTTP/1.1 documentation</a>}.
- */
- public static final String LOCATION = "Location";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43">HTTP/1.1 documentation</a>}.
- */
- public static final String USER_AGENT = "User-Agent";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44">HTTP/1.1 documentation</a>}.
- */
- public static final String VARY = "Vary";
-
- /**
- * See {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.47">HTTP/1.1 documentation</a>}.
- */
- public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
-
- /**
- * See {@link <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109</a>}.
- */
- public static final String COOKIE = "Cookie";
-
- /**
- * See {@link <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109</a>}.
- */
- public static final String SET_COOKIE = "Set-Cookie";
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/MediaType.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/MediaType.java
deleted file mode 100644
index e25ef0ff46a..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/MediaType.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * MediaType.java
- *
- * Created on March 22, 2007, 2:35 PM
- *
- */
-
-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;
-
-/**
- * An abstraction for a media type. Instances are immutable.
- * @see <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7">HTTP/1.1 section 3.7</a>
- */
-public class MediaType {
-
- private String type;
- private String subtype;
- private Map<String, String> parameters;
-
- /**
- * Empty immutable map used for all instances without parameters
- */
- private static final Map<String, String> emptyMap = Collections.emptyMap();
-
- private static final HeaderDelegate<MediaType> delegate =
- RuntimeDelegate.getInstance().createHeaderDelegate(MediaType.class);
-
- /** The value of a type or subtype wildcard: "*" */
- public static final String MEDIA_TYPE_WILDCARD = "*";
-
- // Common media type constants
- /** "*&#47;*" */
- public final static String WILDCARD = "*/*";
- /** "*&#47;*" */
- public final static MediaType WILDCARD_TYPE = new MediaType();
-
- /** "application/xml" */
- public final static String APPLICATION_XML = "application/xml";
- /** "application/xml" */
- public final static MediaType APPLICATION_XML_TYPE = new MediaType("application","xml");
-
- /** "application/atom+xml" */
- public final static String APPLICATION_ATOM_XML = "application/atom+xml";
- /** "application/atom+xml" */
- public final static MediaType APPLICATION_ATOM_XML_TYPE = new MediaType("application","atom+xml");
-
- /** "application/xhtml+xml" */
- public final static String APPLICATION_XHTML_XML = "application/xhtml+xml";
- /** "application/xhtml+xml" */
- public final static MediaType APPLICATION_XHTML_XML_TYPE = new MediaType("application","xhtml+xml");
-
- /** "application/svg+xml" */
- public final static String APPLICATION_SVG_XML = "application/svg+xml";
- /** "application/svg+xml" */
- public final static MediaType APPLICATION_SVG_XML_TYPE = new MediaType("application","svg+xml");
-
- /** "application/json" */
- public final static String APPLICATION_JSON = "application/json";
- /** "application/json" */
- public final static MediaType APPLICATION_JSON_TYPE = new MediaType("application","json");
-
- /** "application/x-www-form-urlencoded" */
- public final static String APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded";
- /** "application/x-www-form-urlencoded" */
- public final static MediaType APPLICATION_FORM_URLENCODED_TYPE = new MediaType("application","x-www-form-urlencoded");
-
- /** "multipart/form-data" */
- public final static String MULTIPART_FORM_DATA = "multipart/form-data";
- /** "multipart/form-data" */
- public final static MediaType MULTIPART_FORM_DATA_TYPE = new MediaType("multipart","form-data");
-
- /** "application/octet-stream" */
- public final static String APPLICATION_OCTET_STREAM = "application/octet-stream";
- /** "application/octet-stream" */
- public final static MediaType APPLICATION_OCTET_STREAM_TYPE = new MediaType("application","octet-stream");
-
- /** "text/plain" */
- public final static String TEXT_PLAIN = "text/plain";
- /** "text/plain" */
- public final static MediaType TEXT_PLAIN_TYPE = new MediaType("text","plain");
-
- /** "text/xml" */
- public final static String TEXT_XML = "text/xml";
- /** "text/xml" */
- public final static MediaType TEXT_XML_TYPE = new MediaType("text","xml");
-
- /** "text/html" */
- public final static String TEXT_HTML = "text/html";
- /** "text/html" */
- public final static MediaType TEXT_HTML_TYPE = new MediaType("text","html");
-
- /**
- * Creates a new instance of MediaType by parsing the supplied string.
- * @param type the media type string
- * @return the newly created MediaType
- * @throws IllegalArgumentException if the supplied string cannot be parsed
- * or is null
- */
- public static MediaType valueOf(String type) throws IllegalArgumentException {
- return delegate.fromString(type);
- }
-
- /**
- * Creates a new instance of MediaType with the supplied type, subtype and
- * parameters.
- * @param type the primary type, null is equivalent to
- * {@link #MEDIA_TYPE_WILDCARD}.
- * @param subtype the subtype, null is equivalent to
- * {@link #MEDIA_TYPE_WILDCARD}.
- * @param parameters a map of media type parameters, null is the same as an
- * empty map.
- */
- public MediaType(String type, String subtype, Map<String, String> parameters) {
- this.type = type==null ? MEDIA_TYPE_WILDCARD : type;
- this.subtype = subtype==null ? MEDIA_TYPE_WILDCARD : subtype;
- if (parameters==null) {
- this.parameters = emptyMap;
- } else {
- Map<String, String> map = new TreeMap<String, String>(new Comparator<String>() {
- public int compare(String o1, String o2) {
- return o1.compareToIgnoreCase(o2);
- }
- });
- for (Map.Entry<String, String> e: parameters.entrySet()) {
- map.put(e.getKey().toLowerCase(), e.getValue());
- }
- this.parameters = Collections.unmodifiableMap(map);
- }
- }
-
- /**
- * Creates a new instance of MediaType with the supplied type and subtype.
- * @param type the primary type, null is equivalent to
- * {@link #MEDIA_TYPE_WILDCARD}
- * @param subtype the subtype, null is equivalent to
- * {@link #MEDIA_TYPE_WILDCARD}
- */
- public MediaType(String type, String subtype) {
- this(type,subtype,emptyMap);
- }
-
- /**
- * Creates a new instance of MediaType, both type and subtype are wildcards.
- * Consider using the constant {@link #WILDCARD_TYPE} instead.
- */
- public MediaType() {
- this(MEDIA_TYPE_WILDCARD, MEDIA_TYPE_WILDCARD);
- }
-
- /**
- * Getter for primary type.
- * @return value of primary type.
- */
- public String getType() {
- return this.type;
- }
-
- /**
- * Checks if the primary type is a wildcard.
- * @return true if the primary type is a wildcard
- */
- public boolean isWildcardType() {
- return this.getType().equals(MEDIA_TYPE_WILDCARD);
- }
-
- /**
- * Getter for subtype.
- * @return value of subtype.
- */
- public String getSubtype() {
- return this.subtype;
- }
-
- /**
- * Checks if the subtype is a wildcard
- * @return true if the subtype is a wildcard
- */
- public boolean isWildcardSubtype() {
- return this.getSubtype().equals(MEDIA_TYPE_WILDCARD);
- }
-
- /**
- * Getter for a read-only parameter map. Keys are case-insensitive.
- * @return an immutable map of parameters.
- */
- public Map<String, String> getParameters() {
- return parameters;
- }
-
- /**
- * Check if this media type is compatible with another media type. E.g.
- * image/* is compatible with image/jpeg, image/png, etc. Media type
- * parameters are ignored. The function is commutative.
- * @return true if the types are compatible, false otherwise.
- * @param other the media type to compare with
- */
- public boolean isCompatible(MediaType other) {
- if (other == null)
- return false;
- if (type.equals(MEDIA_TYPE_WILDCARD) || other.type.equals(MEDIA_TYPE_WILDCARD))
- return true;
- else if (type.equalsIgnoreCase(other.type) && (subtype.equals(MEDIA_TYPE_WILDCARD) || other.subtype.equals(MEDIA_TYPE_WILDCARD)))
- return true;
- else
- return this.type.equalsIgnoreCase(other.type)
- && this.subtype.equalsIgnoreCase(other.subtype);
- }
-
- /**
- * Compares obj to this media type to see if they are the same by comparing
- * type, subtype and parameters. Note that the case-sensitivity of parameter
- * values is dependent on the semantics of the parameter name, see
- * {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7">HTTP/1.1</a>}.
- * This method assumes that values are case-sensitive.
- * @param obj the object to compare to
- * @return true if the two media types are the same, false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null)
- return false;
- if (!(obj instanceof MediaType))
- return false;
- MediaType other = (MediaType)obj;
- return (this.type.equalsIgnoreCase(other.type)
- && this.subtype.equalsIgnoreCase(other.subtype)
- && this.parameters.equals(other.parameters));
- }
-
- /**
- * Generate a hashcode from the type, subtype and parameters.
- * @return a hashcode
- */
- @Override
- public int hashCode() {
- return (this.type.toLowerCase()+this.subtype.toLowerCase()).hashCode()+this.parameters.hashCode();
- }
-
- /**
- * Convert the media type to a string suitable for use as the value of a
- * corresponding HTTP header.
- * @return a stringified media type
- */
- @Override
- public String toString() {
- return delegate.toString(this);
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/MultivaluedMap.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/MultivaluedMap.java
deleted file mode 100644
index 7780cb8660a..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/MultivaluedMap.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * MultivaluedMap.java
- *
- * Created on February 13, 2007, 2:30 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * A map of key-values pairs. Each key can have zero or more values.
- *
- */
-public interface MultivaluedMap<K, V> extends Map<K, List<V>> {
-
- /**
- * Set the key's value to be a one item list consisting of the supplied value.
- * Any existing values will be replaced.
- *
- * @param key the key
- * @param value the single value of the key
- */
- void putSingle(K key, V value);
-
- /**
- * Add a value to the current list of values for the supplied key.
- * @param key the key
- * @param value the value to be added.
- */
- void add(K key, V value);
-
- /**
- * A shortcut to get the first value of the supplied key.
- * @param key the key
- * @return the first value for the specified key or null if the key is
- * not in the map.
- */
- V getFirst(K key);
-
-}
-
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/NewCookie.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/NewCookie.java
deleted file mode 100644
index 2cd4fd775fa..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/NewCookie.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * NewCookie.java
- *
- * Created on March 12, 2007, 5:08 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import javax.ws.rs.ext.RuntimeDelegate;
-import javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate;
-
-/**
- * Used to create a new HTTP cookie, transferred in a response.
- * @see <a href="http://www.ietf.org/rfc/rfc2109.txt">IETF RFC 2109</a>
- */
-public class NewCookie extends Cookie {
-
- /**
- * Specifies that the cookie expires with the current application/browser session.
- */
- public static final int DEFAULT_MAX_AGE = -1;
-
- private static final HeaderDelegate<NewCookie> delegate =
- RuntimeDelegate.getInstance().createHeaderDelegate(NewCookie.class);
-
- private String comment = null;
- private int maxAge = DEFAULT_MAX_AGE;
- private boolean secure = false;
-
- /**
- * Create a new instance.
- * @param name the name of the cookie
- * @param value the value of the cookie
- * @throws IllegalArgumentException if name is null
- */
- public NewCookie(String name, String value) {
- super(name, value);
- }
-
- /**
- * Create a new instance.
- * @param name the name of the cookie
- * @param value the value of the cookie
- * @param path the URI path for which the cookie is valid
- * @param domain the host domain for which the cookie is valid
- * @param comment the comment
- * @param maxAge the maximum age of the cookie in seconds
- * @param secure specifies whether the cookie will only be sent over a secure connection
- * @throws IllegalArgumentException if name is null
- */
- public NewCookie(String name, String value, String path, String domain, String comment, int maxAge, boolean secure) {
- super(name, value, path, domain);
- this.comment = comment;
- this.maxAge = maxAge;
- this.secure = secure;
- }
-
- /**
- * Create a new instance.
- * @param name the name of the cookie
- * @param value the value of the cookie
- * @param path the URI path for which the cookie is valid
- * @param domain the host domain for which the cookie is valid
- * @param version the version of the specification to which the cookie complies
- * @param comment the comment
- * @param maxAge the maximum age of the cookie in seconds
- * @param secure specifies whether the cookie will only be sent over a secure connection
- * @throws IllegalArgumentException if name is null
- */
- public NewCookie(String name, String value, String path, String domain, int version, String comment, int maxAge, boolean secure) {
- super(name, value, path, domain, version);
- this.comment = comment;
- this.maxAge = maxAge;
- this.secure = secure;
- }
-
- /**
- * Create a new instance copying the information in the supplied cookie.
- * @param cookie the cookie to clone
- * @throws IllegalArgumentException if cookie is null
- */
- public NewCookie(Cookie cookie) {
- super(cookie==null ? null : cookie.getName(),
- cookie==null ? null : cookie.getValue(),
- cookie==null ? null : cookie.getPath(),
- cookie==null ? null : cookie.getDomain(),
- cookie==null ? Cookie.DEFAULT_VERSION : cookie.getVersion());
- }
-
- /**
- * Create a new instance supplementing the information in the supplied cookie.
- * @param cookie the cookie to clone
- * @param comment the comment
- * @param maxAge the maximum age of the cookie in seconds
- * @param secure specifies whether the cookie will only be sent over a secure connection
- * @throws IllegalArgumentException if cookie is null
- */
- public NewCookie(Cookie cookie, String comment, int maxAge, boolean secure) {
- this(cookie);
- this.comment = comment;
- this.maxAge = maxAge;
- this.secure = secure;
- }
-
- /**
- * Creates a new instance of NewCookie by parsing the supplied string.
- * @param value the cookie string
- * @return the newly created NewCookie
- * @throws IllegalArgumentException if the supplied string cannot be parsed
- * or is null
- */
- public static NewCookie valueOf(String value) throws IllegalArgumentException {
- return delegate.fromString(value);
- }
-
- /**
- * Get the comment associated with the cookie.
- * @return the comment or null if none set
- */
- public String getComment() {
- return comment;
- }
-
- /**
- * Get the maximum age of the the cookie in seconds. Cookies older than
- * the maximum age are discarded. A cookie can be unset by sending a new
- * cookie with maximum age of 0 since it will overwrite any existing cookie
- * and then be immediately discarded. The default value of -1 indicates that the cookie
- * will be discarded at the end of the browser/application session.
- * @return the maximum age in seconds
- */
- public int getMaxAge() {
- return maxAge;
- }
-
- /**
- * Whether the cookie will only be sent over a secure connection. Defaults
- * to false.
- * @return true if the cookie will only be sent over a secure connection,
- * false otherwise.
- */
- public boolean isSecure() {
- return secure;
- }
-
- /**
- * Obtain a new instance of a {@link Cookie} with the same name, value, path,
- * domain and version as this {@code NewCookie}. This method can be used to
- * obtain an object that can be compared for equality with another {@code Cookie};
- * since a {@code Cookie} will never compare equal to a {@code NewCookie}.
- * @return a {@link Cookie}
- */
- public Cookie toCookie() {
- return new Cookie(this.getName(),this.getValue(), this.getPath(),
- this.getDomain(), this.getVersion());
- }
-
- /**
- * Convert the cookie to a string suitable for use as the value of the
- * corresponding HTTP header.
- * @return a stringified cookie
- */
- @Override
- public String toString() {
- return delegate.toString(this);
- }
-
- /**
- * Generate a hashcode by hashing all of the properties
- * @return the hashcode
- */
- @Override
- public int hashCode() {
- int hash = super.hashCode();
- hash = 59 * hash + (this.comment != null ? this.comment.hashCode() : 0);
- hash = 59 * hash + this.maxAge;
- hash = 59 * hash + (this.secure ? 1 : 0);
- return hash;
- }
-
- /**
- * Compare for equality. Use {@link #toCookie()} to compare a
- * {@code NewCookie} to a {@code Cookie} considering only the common
- * properties.
- * @param obj
- * @return true if the object is a {@code NewCookie} with the same value for
- * all properties, false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final NewCookie other = (NewCookie) obj;
- if (this.getName() != other.getName() && (this.getName() == null || !this.getName().equals(other.getName()))) {
- return false;
- }
- if (this.getValue() != other.getValue() && (this.getValue() == null || !this.getValue().equals(other.getValue()))) {
- return false;
- }
- if (this.getVersion() != other.getVersion()) {
- return false;
- }
- if (this.getPath() != other.getPath() && (this.getPath() == null || !this.getPath().equals(other.getPath()))) {
- return false;
- }
- if (this.getDomain() != other.getDomain() && (this.getDomain() == null || !this.getDomain().equals(other.getDomain()))) {
- return false;
- }
- if (this.comment != other.comment && (this.comment == null || !this.comment.equals(other.comment))) {
- return false;
- }
- if (this.maxAge != other.maxAge) {
- return false;
- }
- if (this.secure != other.secure) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/PathSegment.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/PathSegment.java
deleted file mode 100644
index 5245ce1b0d8..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/PathSegment.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * PathSegment.java
- *
- * Created on January 30, 2007, 4:35 PM
- *
- */
-
-package javax.ws.rs.core;
-
-/**
- * Represents a URI path segment and any associated matrix parameters. When an
- * instance of this type is injected with {@link javax.ws.rs.PathParam}, the
- * value of the annotation identifies which path segment is selected and the
- * presence of an {@link javax.ws.rs.Encoded} annotation will result in an
- * instance that supplies the path and matrix parameter values in
- * URI encoded form.
- *
- * @see UriInfo#getPathSegments
- * @see javax.ws.rs.PathParam
- */
-public interface PathSegment {
-
- /**
- * Get the path segment.
- * <p>
- * @return the path segment
- */
- String getPath();
-
- /**
- * Get a map of the matrix parameters associated with the path segment.
- * The map keys are the names of the matrix parameters with any
- * percent-escaped octets decoded.
- *
- * @return the map of matrix parameters
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- MultivaluedMap<String, String> getMatrixParameters();
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/Request.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/Request.java
deleted file mode 100644
index 56e772f42cf..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/Request.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Request.java
- *
- * Created on September 27, 2007, 5:39 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.util.Date;
-import java.util.List;
-import javax.ws.rs.core.Response.ResponseBuilder;
-
-/**
- * An injectable helper for request processing, all methods throw
- * java.lang.IllegalStateException if called outside the scope of a request
- * (e.g. from a provider constructor).
- *
- * Precondition processing (see the <code>evaluatePreconditions</code> methods)
- * can result in either a <code>null</code> return value to indicate that
- * preconditions have been met and that the request should continue, or
- * a non-null return value to indicate that preconditions were not met. In the
- * event that preconditions were not met, the returned <code>ResponseBuilder</code>
- * instance will have an appropriate status and will also include a <code>Vary</code>
- * header if the {@link #selectVariant} method was called prior to to calling
- * <code>evaluatePreconditions</code>. It is the responsibility of the caller
- * to check the status and add additional metadata if required. E.g., see
- * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1, section 10.3.5</a>
- * for details of the headers that are expected to accompany a <code>304 Not Modified</code>
- * response.
- */
-public interface Request {
-
- /**
- * Get the request method, e.g. GET, POST, etc.
- * @return the request method
- * @see javax.ws.rs.HttpMethod
- */
- String getMethod();
-
- /**
- * Select the representation variant that best matches the request. More
- * explicit variants are chosen ahead of less explicit ones. A vary header
- * is computed from the supplied list and automatically added to the
- * response.
- *
- * @param variants a list of Variant that describe all of the
- * available representation variants.
- * @return the variant that best matches the request.
- * @see Variant.VariantListBuilder
- * @throws java.lang.IllegalArgumentException if variants is empty or null
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- Variant selectVariant(List<Variant> variants) throws IllegalArgumentException;
-
- /**
- * Evaluate request preconditions based on the passed in value.
- *
- * @param eTag an ETag for the current state of the resource
- * @return null if the preconditions are met or a ResponseBuilder set with
- * the appropriate status if the preconditions are not met. A returned
- * ResponseBuilder will include an ETag header set with the value of eTag.
- * @throws java.lang.IllegalArgumentException if eTag is null
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- ResponseBuilder evaluatePreconditions(EntityTag eTag);
-
- /**
- * Evaluate request preconditions based on the passed in value.
- *
- * @param lastModified a date that specifies the modification date of the resource
- * @return null if the preconditions are met or a ResponseBuilder set with
- * the appropriate status if the preconditions are not met.
- * @throws java.lang.IllegalArgumentException if lastModified is null
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- ResponseBuilder evaluatePreconditions(Date lastModified);
-
- /**
- * Evaluate request preconditions based on the passed in value.
- *
- * @param lastModified a date that specifies the modification date of the resource
- * @param eTag an ETag for the current state of the resource
- * @return null if the preconditions are met or a ResponseBuilder set with
- * the appropriate status if the preconditions are not met. A returned
- * ResponseBuilder will include an ETag header set with the value of eTag.
- * @throws java.lang.IllegalArgumentException if lastModified or eTag is null
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag eTag);
-
- /**
- * Evaluate request preconditions for a resource that does not currently
- * exist. The primary use of this method is to support the {@link <a
- * href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24">
- * If-Match: *</a>} and {@link <a
- * href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26">
- * If-None-Match: *</a>} preconditions.
- *
- * <p>Note that both preconditions <code>If-None-Match: *</code> and
- * <code>If-None-Match: <i>something</i></code> will always be considered to
- * have been met and it is the applications responsibility
- * to enforce any additional method-specific semantics. E.g. a
- * <code>PUT</code> on a resource that does not exist might succeed whereas
- * a <code>GET</code> on a resource that does not exist would likely result
- * in a 404 response. It would be the responsibility of the application to
- * generate the 404 response.</p>
- *
- * @return null if the preconditions are met or a ResponseBuilder set with
- * the appropriate status if the preconditions are not met.
- * @throws java.lang.IllegalStateException if called outside the scope of
- * a request
- */
- ResponseBuilder evaluatePreconditions();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/Response.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/Response.java
deleted file mode 100644
index dda5ea03776..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/Response.java
+++ /dev/null
@@ -1,749 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Response.java
- *
- * Created on April 18, 2007, 9:00 AM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-/**
- * Defines the contract between a returned instance and the runtime when
- * an application needs to provide metadata to the runtime. An application
- * class can extend this class directly or can use one of the static
- * methods to create an instance using a ResponseBuilder.
- *
- * Several methods have parameters of type URI, {@link UriBuilder} provides
- * convenient methods to create such values as does
- * {@link <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html#create(java.lang.String)">URI.create()</a>}.
- *
- * @see Response.ResponseBuilder
- */
-public abstract class Response {
-
- /**
- * Protected constructor, use one of the static methods to obtain a
- * {@link ResponseBuilder} instance and obtain a Response from that.
- */
- protected Response() {}
-
-
- /**
- * Return the response entity. The response will be serialized using a
- * MessageBodyWriter for either the class of the entity or, in the case of
- * {@link GenericEntity}, the value of {@link GenericEntity#getRawType()}.
- * @return an object instance or null if there is no entity
- * @see javax.ws.rs.ext.MessageBodyWriter
- */
- public abstract Object getEntity();
-
- /**
- * Get the status code associated with the response.
- * @return the response status code or -1 if the status was not set.
- */
- public abstract int getStatus();
-
- /**
- * Get metadata associated with the response as a map. The returned map
- * may be subsequently modified by the JAX-RS runtime. Values will be
- * serialized using a {@link javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate}
- * if one is available via
- * {@link javax.ws.rs.ext.RuntimeDelegate#createHeaderDelegate(java.lang.Class)}
- * for the class of the value or using the values {@code toString} method if a
- * header delegate is not available.
- * @return response metadata as a map
- */
- public abstract MultivaluedMap<String, Object> getMetadata();
-
- /**
- * Create a new ResponseBuilder by performing a shallow copy of an
- * existing Response. The returned builder has its own metadata map but
- * entries are simply references to the keys and values contained in the
- * supplied Response metadata map.
- * @param response a Response from which the status code, entity and metadata
- * will be copied
- * @return a new ReponseBuilder
- */
- public static ResponseBuilder fromResponse(Response response) {
- ResponseBuilder b = status(response.getStatus());
- b.entity(response.getEntity());
- for (String headerName: response.getMetadata().keySet()) {
- List<Object> headerValues = response.getMetadata().get(headerName);
- for (Object headerValue: headerValues) {
- b.header(headerName, headerValue);
- }
- }
- return b;
- }
-
- /**
- * Create a new ResponseBuilder with the supplied status.
- * @param status the response status
- * @return a new ResponseBuilder
- * @throws IllegalArgumentException if status is null
- */
- public static ResponseBuilder status(StatusType status) {
- ResponseBuilder b = ResponseBuilder.newInstance();
- b.status(status);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder with the supplied status.
- * @param status the response status
- * @return a new ResponseBuilder
- * @throws IllegalArgumentException if status is null
- */
- public static ResponseBuilder status(Status status) {
- return status((StatusType)status);
- }
-
- /**
- * Create a new ResponseBuilder with the supplied status.
- * @param status the response status
- * @return a new ResponseBuilder
- * @throws IllegalArgumentException if status is less than 100 or greater
- * than 599.
- */
- public static ResponseBuilder status(int status) {
- ResponseBuilder b = ResponseBuilder.newInstance();
- b.status(status);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder with an OK status.
- *
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder ok() {
- ResponseBuilder b = status(Status.OK);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder that contains a representation. It is the
- * callers responsibility to wrap the actual entity with
- * {@link GenericEntity} if preservation of its generic type is required.
- *
- * @param entity the representation entity data
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder ok(Object entity) {
- ResponseBuilder b = ok();
- b.entity(entity);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder that contains a representation. It is the
- * callers responsibility to wrap the actual entity with
- * {@link GenericEntity} if preservation of its generic type is required.
- *
- * @param entity the representation entity data
- * @param type the media type of the entity
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder ok(Object entity, MediaType type) {
- ResponseBuilder b = ok();
- b.entity(entity);
- b.type(type);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder that contains a representation. It is the
- * callers responsibility to wrap the actual entity with
- * {@link GenericEntity} if preservation of its generic type is required.
- *
- * @param entity the representation entity data
- * @param type the media type of the entity
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder ok(Object entity, String type) {
- ResponseBuilder b = ok();
- b.entity(entity);
- b.type(type);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder that contains a representation. It is the
- * callers responsibility to wrap the actual entity with
- * {@link GenericEntity} if preservation of its generic type is required.
- *
- * @param entity the representation entity data
- * @param variant representation metadata
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder ok(Object entity, Variant variant) {
- ResponseBuilder b = ok();
- b.entity(entity);
- b.variant(variant);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder with an server error status.
- *
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder serverError() {
- ResponseBuilder b = status(Status.INTERNAL_SERVER_ERROR);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder for a created resource, set the location
- * header using the supplied value.
- *
- * @param location the URI of the new resource. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the request URI (see {@link UriInfo#getRequestUri}).
- * @return a new ResponseBuilder
- * @throws java.lang.IllegalArgumentException if location is null
- */
- public static ResponseBuilder created(URI location) {
- ResponseBuilder b = status(Status.CREATED).location(location);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder for an empty response.
- *
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder noContent() {
- ResponseBuilder b = status(Status.NO_CONTENT);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder with a not-modified status.
- *
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder notModified() {
- ResponseBuilder b = status(Status.NOT_MODIFIED);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder with a not-modified status.
- *
- * @param tag a tag for the unmodified entity
- * @return a new ResponseBuilder
- * @throws java.lang.IllegalArgumentException if tag is null
- */
- public static ResponseBuilder notModified(EntityTag tag) {
- ResponseBuilder b = notModified();
- b.tag(tag);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder with a not-modified status
- * and a strong entity tag. This is a shortcut
- * for <code>notModified(new EntityTag(<i>value</i>))</code>.
- *
- * @param tag the string content of a strong entity tag. The JAX-RS
- * runtime will quote the supplied value when creating the header.
- * @return a new ResponseBuilder
- * @throws java.lang.IllegalArgumentException if tag is null
- */
- public static ResponseBuilder notModified(String tag) {
- ResponseBuilder b = notModified();
- b.tag(tag);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder for a redirection. Used in the
- * redirect-after-POST (aka POST/redirect/GET) pattern.
- *
- * @param location the redirection URI. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the base URI of the application (see
- * {@link UriInfo#getBaseUri}).
- * @return a new ResponseBuilder
- * @throws java.lang.IllegalArgumentException if location is null
- */
- public static ResponseBuilder seeOther(URI location) {
- ResponseBuilder b = status(Status.SEE_OTHER).location(location);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder for a temporary redirection.
- *
- * @param location the redirection URI. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the base URI of the application (see
- * {@link UriInfo#getBaseUri}).
- * @return a new ResponseBuilder
- * @throws java.lang.IllegalArgumentException if location is null
- */
- public static ResponseBuilder temporaryRedirect(URI location) {
- ResponseBuilder b = status(Status.TEMPORARY_REDIRECT).location(location);
- return b;
- }
-
- /**
- * Create a new ResponseBuilder for a not acceptable response.
- *
- * @param variants list of variants that were available, a null value is
- * equivalent to an empty list.
- * @return a new ResponseBuilder
- */
- public static ResponseBuilder notAcceptable(List<Variant> variants) {
- ResponseBuilder b = status(Status.NOT_ACCEPTABLE).variants(variants);
- return b;
- }
-
- /**
- * A class used to build Response instances that contain metadata instead
- * of or in addition to an entity. An initial instance may be obtained via
- * static methods of the Response class, instance methods provide the
- * ability to set metadata. E.g. to create a response that indicates the
- * creation of a new resource:
- * <pre>&#64;POST
- * Response addWidget(...) {
- * Widget w = ...
- * URI widgetId = UriBuilder.fromResource(Widget.class)...
- * return Response.created(widgetId).build();
- * }</pre>
- *
- * <p>Several methods have parameters of type URI, {@link UriBuilder} provides
- * convenient methods to create such values as does <code>URI.create()</code>.</p>
- *
- * <p>Where multiple variants of the same method are provided, the type of
- * the supplied parameter is retained in the metadata of the built
- * {@code Response}.</p>
- *
- */
- public static abstract class ResponseBuilder {
-
- /**
- * Protected constructor, use one of the static methods of
- * <code>Response</code> to obtain an instance.
- */
- protected ResponseBuilder() {}
-
- /**
- * Create a new builder instance.
- *
- * @return a new ResponseBuilder
- */
- protected static ResponseBuilder newInstance() {
- ResponseBuilder b = RuntimeDelegate.getInstance().createResponseBuilder();
- return b;
- }
-
- /**
- * Create a Response instance from the current ResponseBuilder. The builder
- * is reset to a blank state equivalent to calling the ok method.
- *
- * @return a Response instance
- */
- public abstract Response build();
-
- /**
- * Create a copy of the ResponseBuilder preserving its state.
- * @return a copy of the ResponseBuilder
- */
- @Override
- public abstract ResponseBuilder clone();
-
- /**
- * Set the status on the ResponseBuilder.
- *
- * @param status the response status
- * @return the updated ResponseBuilder
- * @throws IllegalArgumentException if status is less than 100 or greater
- * than 599.
- */
- public abstract ResponseBuilder status(int status);
-
- /**
- * Set the status on the ResponseBuilder.
- *
- * @param status the response status
- * @return the updated ResponseBuilder
- * @throws IllegalArgumentException if status is null
- */
- public ResponseBuilder status(StatusType status) {
- if (status == null)
- throw new IllegalArgumentException();
- return status(status.getStatusCode());
- };
-
- /**
- * Set the status on the ResponseBuilder.
- *
- * @param status the response status
- * @return the updated ResponseBuilder
- * @throws IllegalArgumentException if status is null
- */
- public ResponseBuilder status(Status status) {
- return status((StatusType)status);
- };
-
- /**
- * Set the entity on the ResponseBuilder. It is the
- * callers responsibility to wrap the actual entity with
- * {@link GenericEntity} if preservation of its generic type is required.
- *
- * @param entity the response entity
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder entity(Object entity);
-
- /**
- * Set the response media type on the ResponseBuilder.
- *
- * @param type the media type of the response entity, if null any
- * existing value for type will be removed
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder type(MediaType type);
-
- /**
- * Set the response media type on the ResponseBuilder.
- *
- * @param type the media type of the response entity, if null any
- * existing value for type will be removed
- * @return the updated ResponseBuilder
- * @throws IllegalArgumentException if type cannot be parsed
- */
- public abstract ResponseBuilder type(String type);
-
- /**
- * Set representation metadata on the ResponseBuilder. Equivalent to
- * setting the values of content type, content language, and content
- * encoding separately using the values of the variant properties.
- *
- * @param variant metadata of the response entity, a null value is
- * equivalent to a variant with all null properties.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder variant(Variant variant);
-
- /**
- * Add a Vary header that lists the available variants.
- *
- * @param variants a list of available representation variants, a null
- * value will remove an existing value for vary.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder variants(List<Variant> variants);
-
- /**
- * Set the language on the ResponseBuilder.
- *
- * @param language the language of the response entity, if null any
- * existing value for language will be removed
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder language(String language);
-
- /**
- * Set the language on the ResponseBuilder.
- *
- *
- * @param language the language of the response entity, if null any
- * existing value for type will be removed
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder language(Locale language);
-
- /**
- * Set the location on the ResponseBuilder.
- *
- * @param location the location. If a relative URI is
- * supplied it will be converted into an absolute URI by resolving it
- * relative to the base URI of the application (see
- * {@link UriInfo#getBaseUri}). If null any
- * existing value for location will be removed.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder location(URI location);
-
- /**
- * Set the content location on the ResponseBuilder.
- *
- * @param location the content location. Relative or absolute URIs
- * may be used for the value of content location. If null any
- * existing value for content location will be removed.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder contentLocation(URI location);
-
- /**
- * Set an entity tag on the ResponseBuilder.
- *
- * @param tag the entity tag, if null any
- * existing entity tag value will be removed.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder tag(EntityTag tag);
-
- /**
- * Set a strong entity tag on the ResponseBuilder. This is a shortcut
- * for <code>tag(new EntityTag(<i>value</i>))</code>.
- *
- * @param tag the string content of a strong entity tag. The JAX-RS
- * runtime will quote the supplied value when creating the header. If
- * null any existing entity tag value will be removed.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder tag(String tag);
-
- /**
- * Set the last modified date on the ResponseBuilder.
- *
- * @param lastModified the last modified date, if null any existing
- * last modified value will be removed.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder lastModified(Date lastModified);
-
- /**
- * Set the cache control data on the ResponseBuilder.
- *
- * @param cacheControl the cache control directives, if null removes any
- * existing cache control directives.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder cacheControl(CacheControl cacheControl);
-
- /**
- * Set the expires date on the ResponseBuilder.
- *
- * @param expires the expiration date, if null removes any existing
- * expires value.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder expires(Date expires);
-
- /**
- * Add a header to the ResponseBuilder.
- *
- * @param name the name of the header
- * @param value the value of the header, the header will be serialized
- * using a {@link javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate} if
- * one is available via
- * {@link javax.ws.rs.ext.RuntimeDelegate#createHeaderDelegate(java.lang.Class)}
- * for the class of {@code value} or using its {@code toString} method if a
- * header delegate is not available. If {@code value} is null then all
- * current headers of the same name will be removed.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder header(String name, Object value);
-
- /**
- * Add cookies to the ResponseBuilder.
- *
- * @param cookies new cookies that will accompany the response. A null
- * value will remove all cookies, including those added via the
- * {@link #header(java.lang.String, java.lang.Object)} method.
- * @return the updated ResponseBuilder
- */
- public abstract ResponseBuilder cookie(NewCookie... cookies);
- }
-
- /**
- * Base interface for statuses used in responses.
- */
- public interface StatusType {
- /**
- * Get the associated status code
- * @return the status code
- */
- public int getStatusCode();
-
- /**
- * Get the class of status code
- * @return the class of status code
- */
- public Status.Family getFamily();
-
- /**
- * Get the reason phrase
- * @return the reason phrase
- */
- public String getReasonPhrase();
- }
-
- /**
- * Commonly used status codes defined by HTTP, see
- * {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10">HTTP/1.1 documentation</a>}
- * for the complete list. Additional status codes can be added by applications
- * by creating an implementation of {@link StatusType}.
- */
- public enum Status implements StatusType {
- /**
- * 200 OK, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1 documentation</a>}.
- */
- OK(200, "OK"),
- /**
- * 201 Created, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1 documentation</a>}.
- */
- CREATED(201, "Created"),
- /**
- * 202 Accepted, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1 documentation</a>}.
- */
- ACCEPTED(202, "Accepted"),
- /**
- * 204 No Content, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1 documentation</a>}.
- */
- NO_CONTENT(204, "No Content"),
- /**
- * 301 Moved Permanently, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1 documentation</a>}.
- */
- MOVED_PERMANENTLY(301, "Moved Permanently"),
- /**
- * 303 See Other, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1 documentation</a>}.
- */
- SEE_OTHER(303, "See Other"),
- /**
- * 304 Not Modified, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1 documentation</a>}.
- */
- NOT_MODIFIED(304, "Not Modified"),
- /**
- * 307 Temporary Redirect, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1 documentation</a>}.
- */
- TEMPORARY_REDIRECT(307, "Temporary Redirect"),
- /**
- * 400 Bad Request, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1 documentation</a>}.
- */
- BAD_REQUEST(400, "Bad Request"),
- /**
- * 401 Unauthorized, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1 documentation</a>}.
- */
- UNAUTHORIZED(401, "Unauthorized"),
- /**
- * 403 Forbidden, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1 documentation</a>}.
- */
- FORBIDDEN(403, "Forbidden"),
- /**
- * 404 Not Found, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1 documentation</a>}.
- */
- NOT_FOUND(404, "Not Found"),
- /**
- * 406 Not Acceptable, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1 documentation</a>}.
- */
- NOT_ACCEPTABLE(406, "Not Acceptable"),
- /**
- * 409 Conflict, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1 documentation</a>}.
- */
- CONFLICT(409, "Conflict"),
- /**
- * 410 Gone, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1 documentation</a>}.
- */
- GONE(410, "Gone"),
- /**
- * 412 Precondition Failed, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1 documentation</a>}.
- */
- PRECONDITION_FAILED(412, "Precondition Failed"),
- /**
- * 415 Unsupported Media Type, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1 documentation</a>}.
- */
- UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"),
- /**
- * 500 Internal Server Error, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1 documentation</a>}.
- */
- INTERNAL_SERVER_ERROR(500, "Internal Server Error"),
- /**
- * 503 Service Unavailable, see {@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1 documentation</a>}.
- */
- SERVICE_UNAVAILABLE(503, "Service Unavailable");
-
- private final int code;
- private final String reason;
- private Family family;
-
- /**
- * An enumeration representing the class of status code. Family is used
- * here since class is overloaded in Java.
- */
- public enum Family {INFORMATIONAL, SUCCESSFUL, REDIRECTION, CLIENT_ERROR, SERVER_ERROR, OTHER};
-
- Status(final int statusCode, final String reasonPhrase) {
- this.code = statusCode;
- this.reason = reasonPhrase;
- switch(code/100) {
- case 1: this.family = Family.INFORMATIONAL; break;
- case 2: this.family = Family.SUCCESSFUL; break;
- case 3: this.family = Family.REDIRECTION; break;
- case 4: this.family = Family.CLIENT_ERROR; break;
- case 5: this.family = Family.SERVER_ERROR; break;
- default: this.family = Family.OTHER; break;
- }
- }
-
- /**
- * Get the class of status code
- * @return the class of status code
- */
- public Family getFamily() {
- return family;
- }
-
- /**
- * Get the associated status code
- * @return the status code
- */
- public int getStatusCode() {
- return code;
- }
-
- /**
- * Get the reason phrase
- * @return the reason phrase
- */
- public String getReasonPhrase() {
- return toString();
- }
-
- /**
- * Get the reason phrase
- * @return the reason phrase
- */
- @Override
- public String toString() {
- return reason;
- }
-
- /**
- * Convert a numerical status code into the corresponding Status
- * @param statusCode the numerical status code
- * @return the matching Status or null is no matching Status is defined
- */
- public static Status fromStatusCode(final int statusCode) {
- for (Status s : Status.values()) {
- if (s.code == statusCode) {
- return s;
- }
- }
- return null;
- }
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/SecurityContext.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/SecurityContext.java
deleted file mode 100644
index 6b29ff69210..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/SecurityContext.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package javax.ws.rs.core;
-
-import java.security.Principal;
-
-/**
- * An injectable interface that provides access to security related
- * information.
- *
- * @see Context
- */
-public interface SecurityContext {
-
- /**
- * String identifier for Basic authentication. Value "BASIC"
- */
- public static final String BASIC_AUTH = "BASIC";
-
- /**
- * String identifier for Client Certificate authentication. Value "CLIENT_CERT"
- */
- public static final String CLIENT_CERT_AUTH = "CLIENT_CERT";
-
- /**
- * String identifier for Digest authentication. Value "DIGEST"
- */
- public static final String DIGEST_AUTH = "DIGEST";
-
- /**
- * String identifier for Form authentication. Value "FORM"
- */
- public static final String FORM_AUTH = "FORM";
-
- /**
- * Returns a <code>java.security.Principal</code> object containing the
- * name of the current authenticated user. If the user
- * has not been authenticated, the method returns null.
- *
- * @return a <code>java.security.Principal</code> containing the name
- * of the user making this request; null if the user has not been
- * authenticated
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public Principal getUserPrincipal();
-
- /**
- * Returns a boolean indicating whether the authenticated user is included
- * in the specified logical "role". If the user has not been authenticated,
- * the method returns <code>false</code>.
- *
- * @param role a <code>String</code> specifying the name of the role
- * @return a <code>boolean</code> indicating whether the user making
- * the request belongs to a given role; <code>false</code> if the user
- * has not been authenticated
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public boolean isUserInRole(String role);
-
- /**
- * Returns a boolean indicating whether this request was made
- * using a secure channel, such as HTTPS.
- *
- * @return <code>true</code> if the request was made using a secure
- * channel, <code>false</code> otherwise
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public boolean isSecure();
-
- /**
- * Returns the string value of the authentication scheme used to protect
- * the resource. If the resource is not authenticated, null is returned.
- *
- * Values are the same as the CGI variable AUTH_TYPE
- *
- * @return one of the static members BASIC_AUTH, FORM_AUTH,
- * CLIENT_CERT_AUTH, DIGEST_AUTH (suitable for == comparison) or the
- * container-specific string indicating the authentication scheme,
- * or null if the request was not authenticated.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public String getAuthenticationScheme();
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/StreamingOutput.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/StreamingOutput.java
deleted file mode 100644
index 55ce1944086..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/StreamingOutput.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * StreamingOutput.java
- *
- * Created on March 3, 2008, 4:00 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import javax.ws.rs.WebApplicationException;
-
-/**
- * A type that may be used as a resource method return value or as the entity
- * in a {@link Response} when the application wishes to stream the output.
- * This is a lightweight alternative to a
- * {@link javax.ws.rs.ext.MessageBodyWriter}.
- *
- * @see javax.ws.rs.ext.MessageBodyWriter
- * @see javax.ws.rs.core.Response
- */
-public interface StreamingOutput {
- /**
- * Called to write the message body.
- * @param output the OutputStream to write to.
- * @throws java.io.IOException if an IO error is encountered
- * @throws javax.ws.rs.WebApplicationException if a specific
- * HTTP error response needs to be produced. Only effective if thrown prior
- * to any bytes being written to output.
- */
- void write(OutputStream output) throws IOException, WebApplicationException;
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilder.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilder.java
deleted file mode 100644
index 50d06620126..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilder.java
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * UriBuilder.java
- *
- * Created on July 18, 2007, 11:53 AM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.util.Map;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-/**
- * URI template aware utility class for building URIs from their components. See
- * {@link javax.ws.rs.Path#value} for an explanation of URI templates.
- *
- * <p>Builder methods perform contextual encoding of characters not permitted in
- * the corresponding URI component following the rules of the
- * <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">application/x-www-form-urlencoded</a>
- * media type for query parameters and
- * <a href="http://ietf.org/rfc/rfc3986.txt">RFC 3986</a> for all other
- * components. Note that only characters not permitted in a particular component
- * are subject to encoding so, e.g., a path supplied to one of the {@code path}
- * methods may contain matrix parameters or multiple path segments since the
- * separators are legal characters and will not be encoded. Percent encoded
- * values are also recognized where allowed and will not be double encoded.</p>
- *
- * <p>URI templates are allowed in most components of a URI but their value is
- * restricted to a particular component. E.g.
- * <blockquote><code>UriBuilder.fromPath("{arg1}").build("foo#bar");</code></blockquote>
- * would result in encoding of the '#' such that the resulting URI is
- * "foo%23bar". To create a URI "foo#bar" use
- * <blockquote><code>UriBuilder.fromPath("{arg1}").fragment("{arg2}").build("foo", "bar")</code></blockquote>
- * instead. URI template names and delimiters are never encoded but their
- * values are encoded when a URI is built.
- * Template parameter regular expressions are ignored when building a URI, i.e.
- * no validation is performed.
- *
- * @see java.net.URI
- * @see javax.ws.rs.Path
- */
-public abstract class UriBuilder {
-
- /**
- * Protected constructor, use one of the static <code>from<i>XXX</i></code>
- * methods to obtain an instance.
- */
- protected UriBuilder() {}
-
- /**
- * Creates a new instance of UriBuilder.
- * @return a new instance of UriBuilder
- */
- protected static UriBuilder newInstance() {
- UriBuilder b = RuntimeDelegate.getInstance().createUriBuilder();
- return b;
- }
-
- /**
- * Create a new instance initialized from an existing URI.
- * @param uri a URI that will be used to initialize the UriBuilder.
- * @return a new UriBuilder
- * @throws IllegalArgumentException if uri is null
- */
- public static UriBuilder fromUri(URI uri) throws IllegalArgumentException {
- UriBuilder b = newInstance();
- b.uri(uri);
- return b;
- }
-
- /**
- * Create a new instance initialized from an existing URI.
- * @param uri a URI that will be used to initialize the UriBuilder, may not
- * contain URI parameters.
- * @return a new UriBuilder
- * @throws IllegalArgumentException if uri is not a valid URI or is null
- */
- public static UriBuilder fromUri(String uri) throws IllegalArgumentException {
- URI u;
- try {
- u = URI.create(uri);
- } catch (NullPointerException ex) {
- throw new IllegalArgumentException(ex.getMessage(), ex);
- }
- return fromUri(u);
- }
-
- /**
- * Create a new instance representing a relative URI initialized from a
- * URI path.
- * @param path a URI path that will be used to initialize the UriBuilder,
- * may contain URI template parameters.
- * @return a new UriBuilder
- * @throws IllegalArgumentException if path is null
- */
- public static UriBuilder fromPath(String path) throws IllegalArgumentException {
- UriBuilder b = newInstance();
- b.path(path);
- return b;
- }
-
- /**
- * Create a new instance representing a relative URI initialized from a
- * root resource class.
- *
- * @param resource a root resource whose {@link javax.ws.rs.Path} value will
- * be used to initialize the UriBuilder.
- * @return a new UriBuilder
- * @throws IllegalArgumentException if resource is not annotated with
- * {@link javax.ws.rs.Path} or resource is null.
- */
- public static UriBuilder fromResource(Class<?> resource) throws IllegalArgumentException {
- UriBuilder b = newInstance();
- b.path(resource);
- return b;
- }
-
- /**
- * Create a copy of the UriBuilder preserving its state. This is a more
- * efficient means of creating a copy than constructing a new UriBuilder
- * from a URI returned by the {@link #build} method.
- * @return a copy of the UriBuilder
- */
- @Override
- public abstract UriBuilder clone();
-
- /**
- * Copies the non-null components of the supplied URI to the UriBuilder replacing
- * any existing values for those components.
- * @param uri the URI to copy components from
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if uri is null
- */
- public abstract UriBuilder uri(URI uri) throws IllegalArgumentException;
-
- /**
- * Set the URI scheme.
- * @param scheme the URI scheme, may contain URI template parameters.
- * A null value will unset the URI scheme.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if scheme is invalid
- */
- public abstract UriBuilder scheme(String scheme) throws IllegalArgumentException;
-
- /**
- * Set the URI scheme-specific-part (see {@link java.net.URI}). This
- * method will overwrite any existing
- * values for authority, user-info, host, port and path.
- * @param ssp the URI scheme-specific-part, may contain URI template parameters
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if ssp cannot be parsed or is null
- */
- public abstract UriBuilder schemeSpecificPart(String ssp) throws IllegalArgumentException;
-
- /**
- * Set the URI user-info.
- * @param ui the URI user-info, may contain URI template parameters.
- * A null value will unset userInfo component of the URI.
- * @return the updated UriBuilder
- */
- public abstract UriBuilder userInfo(String ui);
-
- /**
- * Set the URI host.
- * @return the updated UriBuilder
- * @param host the URI host, may contain URI template parameters.
- * A null value will unset the host component of the URI.
- * @throws IllegalArgumentException if host is invalid.
- */
- public abstract UriBuilder host(String host) throws IllegalArgumentException;
-
- /**
- * Set the URI port.
- * @param port the URI port, a value of -1 will unset an explicit port.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if port is invalid
- */
- public abstract UriBuilder port(int port) throws IllegalArgumentException;
-
- /**
- * Set the URI path. This method will overwrite
- * any existing path and associated matrix parameters.
- * Existing '/' characters are preserved thus a single value can
- * represent multiple URI path segments.
- * @param path the path, may contain URI template parameters.
- * A null value will unset the path component of the URI.
- * @return the updated UriBuilder
- */
- public abstract UriBuilder replacePath(String path);
-
- /**
- * Append path to the existing path.
- * When constructing the final path, a '/' separator will be inserted
- * between the existing path and the supplied path if necessary.
- * Existing '/' characters are preserved thus a single value can
- * represent multiple URI path segments.
- * @param path the path, may contain URI template parameters
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if path is null
- */
- public abstract UriBuilder path(String path) throws IllegalArgumentException;
-
- /**
- * Append the path from a Path-annotated class to the
- * existing path.
- * When constructing the final path, a '/' separator will be inserted
- * between the existing path and the supplied path if necessary.
- *
- * @param resource a resource whose {@link javax.ws.rs.Path} value will be
- * used to obtain the path to append.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if resource is null, or
- * if resource is not annotated with {@link javax.ws.rs.Path}
- */
- public abstract UriBuilder path(Class resource) throws IllegalArgumentException;
-
- /**
- * Append the path from a Path-annotated method to the
- * existing path.
- * When constructing the final path, a '/' separator will be inserted
- * between the existing path and the supplied path if necessary.
- * This method is a convenience shortcut to <code>path(Method)</code>, it
- * can only be used in cases where there is a single method with the
- * specified name that is annotated with {@link javax.ws.rs.Path}.
- *
- * @param resource the resource containing the method
- * @param method the name of the method whose {@link javax.ws.rs.Path} value will be
- * used to obtain the path to append
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if resource or method is null,
- * or there is more than or less than one variant of the method annotated with
- * {@link javax.ws.rs.Path}
- */
- public abstract UriBuilder path(Class resource, String method) throws IllegalArgumentException;
-
- /**
- * Append the path from a {@link javax.ws.rs.Path}-annotated method to the
- * existing path.
- * When constructing the final path, a '/' separator will be inserted
- * between the existing path and the supplied path if necessary.
- *
- * @param method a method whose {@link javax.ws.rs.Path} value will be
- * used to obtain the path to append to the existing path
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if method is null or is
- * not annotated with a {@link javax.ws.rs.Path}
- */
- public abstract UriBuilder path(Method method) throws IllegalArgumentException;
-
- /**
- * Append path segments to the existing path.
- * When constructing the final path, a '/' separator will be inserted
- * between the existing path and the first path segment if necessary and
- * each supplied segment will also be separated by '/'.
- * Existing '/' characters are encoded thus a single value can
- * only represent a single URI path segment.
- * @param segments the path segment values, each may contain URI template
- * parameters
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if segments or any element of segments
- * is null
- */
- public abstract UriBuilder segment(String... segments) throws IllegalArgumentException;
-
- /**
- * Set the matrix parameters of the current final segment of the current URI path.
- * This method will overwrite any existing matrix parameters on the current final
- * segment of the current URI path. Note that the matrix parameters
- * are tied to a particular path segment; subsequent addition of path segments
- * will not affect their position in the URI path.
- * @param matrix the matrix parameters, may contain URI template parameters.
- * A null value will remove all matrix parameters of the current final segment
- * of the current URI path.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if matrix cannot be parsed
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- public abstract UriBuilder replaceMatrix(String matrix) throws IllegalArgumentException;
-
- /**
- * Append a matrix parameter to the existing set of matrix parameters of
- * the current final segment of the URI path. If multiple values are supplied
- * the parameter will be added once per value. Note that the matrix parameters
- * are tied to a particular path segment; subsequent addition of path segments
- * will not affect their position in the URI path.
- * @param name the matrix parameter name, may contain URI template parameters
- * @param values the matrix parameter value(s), each object will be converted
- * to a {@code String} using its {@code toString()} method. Stringified
- * values may contain URI template parameters.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if name or values is null
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- public abstract UriBuilder matrixParam(String name, Object... values) throws IllegalArgumentException;
-
- /**
- * Replace the existing value(s) of a matrix parameter on
- * the current final segment of the URI path. If multiple values are supplied
- * the parameter will be added once per value. Note that the matrix parameters
- * are tied to a particular path segment; subsequent addition of path segments
- * will not affect their position in the URI path.
- * @param name the matrix parameter name, may contain URI template parameters
- * @param values the matrix parameter value(s), each object will be converted
- * to a {@code String} using its {@code toString()} method. Stringified
- * values may contain URI template parameters. If {@code values} is empty
- * or null then all current values of the parameter are removed.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if name is null.
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- public abstract UriBuilder replaceMatrixParam(String name, Object... values) throws IllegalArgumentException;
-
- /**
- * Set the URI query string. This method will overwrite any existing query
- * parameters.
- * @param query the URI query string, may contain URI template parameters.
- * A null value will remove all query parameters.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if query cannot be parsed
- */
- public abstract UriBuilder replaceQuery(String query) throws IllegalArgumentException;
-
- /**
- * Append a query parameter to the existing set of query parameters. If
- * multiple values are supplied the parameter will be added once per value.
- * @param name the query parameter name, may contain URI template parameters
- * @param values the query parameter value(s), each object will be converted
- * to a {@code String} using its {@code toString()} method. Stringified
- * values may contain URI template parameters.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if name or values is null
- */
- public abstract UriBuilder queryParam(String name, Object... values) throws IllegalArgumentException;
-
- /**
- * Replace the existing value(s) of a query parameter. If
- * multiple values are supplied the parameter will be added once per value.
- * @param name the query parameter name, may contain URI template parameters
- * @param values the query parameter value(s), each object will be converted
- * to a {@code String} using its {@code toString()} method. Stringified
- * values may contain URI template parameters. If {@code values} is empty
- * or null then all current values of the parameter are removed.
- * @return the updated UriBuilder
- * @throws IllegalArgumentException if name is null
- */
- public abstract UriBuilder replaceQueryParam(String name, Object... values) throws IllegalArgumentException;
-
- /**
- * Set the URI fragment.
- * @param fragment the URI fragment, may contain URI template parameters.
- * A null value will remove any existing fragment.
- * @return the updated UriBuilder
- */
- public abstract UriBuilder fragment(String fragment);
-
- /**
- * Build a URI, any URI template parameters will be replaced by the value in
- * the supplied map. Values are converted to <code>String</code> using
- * their <code>toString</code> method and are then encoded to match the
- * rules of the URI component to which they pertain. All '%' characters
- * in the stringified values will be encoded.
- * The state of the builder is unaffected; this method may be called
- * multiple times on the same builder instance.
- * @param values a map of URI template parameter names and values
- * @return the URI built from the UriBuilder
- * @throws IllegalArgumentException if there are any URI template parameters
- * without a supplied value, or if a template parameter value is null.
- * @throws UriBuilderException if a URI cannot be constructed based on the
- * current state of the builder.
- */
- public abstract URI buildFromMap(Map<String, ? extends Object> values)
- throws IllegalArgumentException, UriBuilderException;
-
- /**
- * Build a URI, any URI template parameters will be replaced by the value in
- * the supplied map. Values are converted to <code>String</code> using
- * their <code>toString</code> method and are then encoded to match the
- * rules of the URI component to which they pertain. All % characters in
- * the stringified values that are not followed by two hexadecimal numbers
- * will be encoded.
- * The state of the builder is unaffected; this method may be called
- * multiple times on the same builder instance.
- * @param values a map of URI template parameter names and values
- * @return the URI built from the UriBuilder
- * @throws IllegalArgumentException if there are any URI template parameters
- * without a supplied value, or if a template parameter value is null.
- * @throws UriBuilderException if a URI cannot be constructed based on the
- * current state of the builder.
- */
- public abstract URI buildFromEncodedMap(Map<String, ? extends Object> values)
- throws IllegalArgumentException, UriBuilderException;
-
- /**
- * Build a URI, using the supplied values in order to replace any URI
- * template parameters. Values are converted to <code>String</code> using
- * their <code>toString</code> method and are then encoded to match the
- * rules of the URI component to which they pertain. All '%' characters
- * in the stringified values will be encoded.
- * The state of the builder is unaffected; this method may be called
- * multiple times on the same builder instance.
- * <p>All instances of the same template parameter
- * will be replaced by the same value that corresponds to the position of the
- * first instance of the template parameter. e.g. the template "{a}/{b}/{a}"
- * with values {"x", "y", "z"} will result in the the URI "x/y/x", <i>not</i>
- * "x/y/z".
- * @param values a list of URI template parameter values
- * @return the URI built from the UriBuilder
- * @throws IllegalArgumentException if there are any URI template parameters
- * without a supplied value, or if a value is null.
- * @throws UriBuilderException if a URI cannot be constructed based on the
- * current state of the builder.
- */
- public abstract URI build(Object... values)
- throws IllegalArgumentException, UriBuilderException;
-
- /**
- * Build a URI.
- * Any URI templates parameters will be replaced with the supplied values in
- * order. Values are converted to <code>String</code> using
- * their <code>toString</code> method and are then encoded to match the
- * rules of the URI component to which they pertain. All % characters in
- * the stringified values that are not followed by two hexadecimal numbers
- * will be encoded.
- * The state of the builder is unaffected; this method may be called
- * multiple times on the same builder instance.
- * <p>All instances of the same template parameter
- * will be replaced by the same value that corresponds to the position of the
- * first instance of the template parameter. e.g. the template "{a}/{b}/{a}"
- * with values {"x", "y", "z"} will result in the the URI "x/y/x", <i>not</i>
- * "x/y/z".
- * @param values a list of URI template parameter values
- * @return the URI built from the UriBuilder
- * @throws IllegalArgumentException if there are any URI template parameters
- * without a supplied value, or if a value is null.
- * @throws UriBuilderException if a URI cannot be constructed based on the
- * current state of the builder.
- */
- public abstract URI buildFromEncoded(Object... values)
- throws IllegalArgumentException, UriBuilderException;
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilderException.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilderException.java
deleted file mode 100644
index 7c716fca81b..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/UriBuilderException.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * UriBuilderException.java
- *
- * Created on August 22, 2007, 4:41 PM
- *
- */
-
-package javax.ws.rs.core;
-
-/**
- * A runtime exception thrown by {@link UriBuilder#build} methods when a {@link
- * java.net.URI} cannot be constructed based on the current state of the
- * builder.
- */
-public class UriBuilderException extends java.lang.RuntimeException {
- private static final long serialVersionUID = 956255913370721193L;
-
- /**
- * Creates a new instance of <code>UriBuilderException</code> without detail message.
- */
- public UriBuilderException() {
- }
-
-
- /**
- * Constructs an instance of <code>UriBuilderException</code> with the specified detail message.
- * @param msg the detail message (which is saved for later retrieval by the Throwable.getMessage() method).
- */
- public UriBuilderException(String msg) {
- super(msg);
- }
-
- /**
- * Constructs an instance of <code>UriBuilderException</code> with the specified detail message and cause.
- * <p>Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.
- * @param msg the detail message (which is saved for later retrieval by the Throwable.getMessage() method).
- * @param cause the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public UriBuilderException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- /**
- * Constructs a new exception with the specified cause and a detail message
- * of (<code>cause==null ? null : cause.toString()</code>) (which typically contains
- * the class and detail message of cause). This constructor is useful
- * for exceptions that are little more than wrappers for other throwables.
- * @param cause the original exception
- */
- public UriBuilderException(Throwable cause) {
- super(cause);
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/UriInfo.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/UriInfo.java
deleted file mode 100644
index 32393fe064b..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/UriInfo.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * UriInfo.java
- *
- * Created on April 13, 2007, 2:55 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.net.URI;
-import java.util.List;
-
-/**
- * An injectable interface that provides access to application and request
- * URI information. Relative URIs are relative to the base URI of the
- * application, see {@link #getBaseUri}.
- *
- * <p>All methods throw <code>java.lang.IllegalStateException</code>
- * if called outside the scope of a request (e.g. from a provider constructor).</p>
- *
- * @see Context
- */
-public interface UriInfo {
-
- /**
- * Get the path of the current request relative to the base URI as
- * a string. All sequences of escaped octets are decoded, equivalent to
- * <code>getPath(true)</code>.
- *
- * @return the relative URI path
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public String getPath();
-
- /**
- * Get the path of the current request relative to the base URI as
- * a string.
- *
- * @param decode controls whether sequences of escaped octets are decoded
- * (true) or not (false).
- * @return the relative URI path
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public String getPath(boolean decode);
-
- /**
- * Get the path of the current request relative to the base URI as a
- * list of {@link PathSegment}. This method is useful when the
- * path needs to be parsed, particularly when matrix parameters may be
- * present in the path. All sequences of escaped octets in path segments
- * and matrix parameter values are decoded,
- * equivalent to <code>getPathSegments(true)</code>.
- * @return an unmodifiable list of {@link PathSegment}. The matrix parameter
- * map of each path segment is also unmodifiable.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- * @see PathSegment
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- public List<PathSegment> getPathSegments();
-
- /**
- * Get the path of the current request relative to the base URI as a
- * list of {@link PathSegment}. This method is useful when the
- * path needs to be parsed, particularly when matrix parameters may be
- * present in the path.
- * @param decode controls whether sequences of escaped octets in path segments
- * and matrix parameter values are decoded (true) or not (false).
- * @return an unmodifiable list of {@link PathSegment}. The matrix parameter
- * map of each path segment is also unmodifiable.
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- * @see PathSegment
- * @see <a href="http://www.w3.org/DesignIssues/MatrixURIs.html">Matrix URIs</a>
- */
- public List<PathSegment> getPathSegments(boolean decode);
-
- /**
- * Get the absolute request URI including any query parameters.
- * @return the absolute request URI
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public URI getRequestUri();
-
- /**
- * Get the absolute request URI in the form of a UriBuilder.
- * @return a UriBuilder initialized with the absolute request URI
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public UriBuilder getRequestUriBuilder();
-
- /**
- * Get the absolute path of the request. This includes everything preceding
- * the path (host, port etc) but excludes query parameters.
- * This is a shortcut for
- * <code>uriInfo.getBase().resolve(uriInfo.getPath()).</code>
- * @return the absolute path of the request
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public URI getAbsolutePath();
-
- /**
- * Get the absolute path of the request in the form of a UriBuilder.
- * This includes everything preceding the path (host, port etc) but excludes
- * query parameters.
- * @return a UriBuilder initialized with the absolute path of the request
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public UriBuilder getAbsolutePathBuilder();
-
- /**
- * Get the base URI of the application. URIs of root resource classes
- * are all relative to this base URI.
- * @return the base URI of the application
- */
- public URI getBaseUri();
-
- /**
- * Get the base URI of the application in the form of a UriBuilder.
- * @return a UriBuilder initialized with the base URI of the application.
- */
- public UriBuilder getBaseUriBuilder();
-
- /**
- * Get the values of any embedded URI template parameters.
- * All sequences of escaped octets are decoded,
- * equivalent to <code>getPathParameters(true)</code>.
- * @return an unmodifiable map of parameter names and values
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- * @see javax.ws.rs.Path
- * @see javax.ws.rs.PathParam
- */
- public MultivaluedMap<String, String> getPathParameters();
-
- /**
- * Get the values of any embedded URI template parameters.
- *
- * @param decode controls whether sequences of escaped octets are decoded
- * (true) or not (false).
- * @return an unmodifiable map of parameter names and values
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- * @see javax.ws.rs.Path
- * @see javax.ws.rs.PathParam
- */
- public MultivaluedMap<String, String> getPathParameters(boolean decode);
-
- /**
- * Get the URI query parameters of the current request.
- * The map keys are the names of the query parameters with any
- * escaped characters decoded.
- * All sequences of escaped octets in parameter values are decoded,
- * equivalent to <code>getQueryParameters(true)</code>.
- * @return an unmodifiable map of query parameter names and values
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public MultivaluedMap<String, String> getQueryParameters();
-
- /**
- * Get the URI query parameters of the current request.
- * The map keys are the names of the query parameters with any
- * escaped characters decoded.
- * @param decode controls whether sequences of escaped octets in parameter
- * values are decoded (true) or not (false).
- * @return an unmodifiable map of query parameter names and values
- * @throws java.lang.IllegalStateException if called outside the scope of a request
- */
- public MultivaluedMap<String, String> getQueryParameters(boolean decode);
-
- /**
- * Get a read-only list of URIs for matched resources. Each entry is a
- * relative URI that matched a resource class, a
- * sub-resource method or a sub-resource locator. All sequences of escaped
- * octets are decoded, equivalent to {@code getMatchedURIs(true)}.
- * Entries do not include query parameters but do include matrix parameters
- * if present in the request URI. Entries are ordered in reverse request
- * URI matching order, with the current resource URI first. E.g. given the
- * following resource classes:
- *
- * <pre>&#064;Path("foo")
- *public class FooResource {
- * &#064;GET
- * public String getFoo() {...}
- *
- * &#064;Path("bar")
- * public BarResource getBarResource() {...}
- *}
- *
- *public class BarResource {
- * &#064;GET
- * public String getBar() {...}
- *}
- * </pre>
- *
- * <p>The values returned by this method based on request uri and where
- * the method is called from are:</p>
- *
- * <table border="1">
- * <tr>
- * <th>Request</th>
- * <th>Called from</th>
- * <th>Value(s)</th>
- * </tr>
- * <tr>
- * <td>GET /foo</td>
- * <td>FooResource.getFoo</td>
- * <td>foo</td>
- * </tr>
- * <tr>
- * <td>GET /foo/bar</td>
- * <td>FooResource.getBarResource</td>
- * <td>foo/bar, foo</td>
- * </tr>
- * <tr>
- * <td>GET /foo/bar</td>
- * <td>BarResource.getBar</td>
- * <td>foo/bar, foo</td>
- * </tr>
- * </table>
- *
- *
- * @return a read-only list of URI paths for matched resources.
- */
- public List<String> getMatchedURIs();
-
- /**
- * Get a read-only list of URIs for matched resources. Each entry is a
- * relative URI that matched a resource class, a sub-resource
- * method or a sub-resource locator. Entries do not include query
- * parameters but do include matrix parameters if present in the request URI.
- * Entries are ordered in reverse request URI matching order, with the
- * current resource URI first. See {@link #getMatchedURIs()} for an
- * example.
- *
- * @param decode controls whether sequences of escaped octets are decoded
- * (true) or not (false).
- * @return a read-only list of URI paths for matched resources.
- */
- public List<String> getMatchedURIs(boolean decode);
-
- /**
- * Get a read-only list of the currently matched resource class instances.
- * Each entry is a resource class instance that matched the request URI
- * either directly or via a sub-resource method or a sub-resource locator.
- * Entries are ordered according to reverse request URI matching order,
- * with the current resource first. E.g. given the following resource
- * classes:
- *
- * <pre>&#064;Path("foo")
- *public class FooResource {
- * &#064;GET
- * public String getFoo() {...}
- *
- * &#064;Path("bar")
- * public BarResource getBarResource() {...}
- *}
- *
- *public class BarResource {
- * &#064;GET
- * public String getBar() {...}
- *}
- * </pre>
- *
- * <p>The values returned by this method based on request uri and where
- * the method is called from are:</p>
- *
- * <table border="1">
- * <tr>
- * <th>Request</th>
- * <th>Called from</th>
- * <th>Value(s)</th>
- * </tr>
- * <tr>
- * <td>GET /foo</td>
- * <td>FooResource.getFoo</td>
- * <td>FooResource</td>
- * </tr>
- * <tr>
- * <td>GET /foo/bar</td>
- * <td>FooResource.getBarResource</td>
- * <td>FooResource</td>
- * </tr>
- * <tr>
- * <td>GET /foo/bar</td>
- * <td>BarResource.getBar</td>
- * <td>BarResource, FooResource</td>
- * </tr>
- * </table>
- *
- * @return a read-only list of matched resource class instances.
- */
- public List<Object> getMatchedResources();
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/Variant.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/Variant.java
deleted file mode 100644
index ce69aa0baab..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/Variant.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Variant.java
- *
- * Created on September 27, 2007, 3:12 PM
- *
- */
-
-package javax.ws.rs.core;
-
-import java.io.StringWriter;
-import java.util.List;
-import java.util.Locale;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-/**
- * Abstraction for a resource representation variant.
- */
-public class Variant {
-
- private Locale language;
- private MediaType mediaType;
- private String encoding;
-
- /**
- * Create a new instance of Variant
- * @param mediaType the media type of the variant - may be null
- * @param language the language of the variant - may be null
- * @param encoding the content encoding of the variant - may be null
- * @throws java.lang.IllegalArgumentException if all three parameters are
- * null
- */
- public Variant(MediaType mediaType, Locale language, String encoding) {
- if (mediaType==null && language==null && encoding==null)
- throw new IllegalArgumentException("mediaType, language, encoding all null");
- this.encoding = encoding;
- this.language = language;
- this.mediaType = mediaType;
- }
-
- /**
- * Get the language of the variant
- * @return the language or null if none set
- */
- public Locale getLanguage() {
- return language;
- }
-
- /**
- * Get the media type of the variant
- * @return the media type or null if none set
- */
- public MediaType getMediaType() {
- return mediaType;
- }
-
- /**
- * Get the encoding of the variant
- * @return the encoding or null if none set
- */
- public String getEncoding() {
- return encoding;
- }
-
- /**
- * Create a {@link VariantListBuilder} initialized with a set of supported
- * media types.
- * @param mediaTypes the available mediaTypes. If specific charsets
- * are supported they should be included as parameters of the respective
- * media type.
- * @return the initailized builder
- * @throws java.lang.IllegalArgumentException if mediaTypes is null or
- * contains no elements.
- */
- public static VariantListBuilder mediaTypes(MediaType... mediaTypes) {
- VariantListBuilder b = VariantListBuilder.newInstance();
- b.mediaTypes(mediaTypes);
- return b;
- }
-
- /**
- * Create a {@link VariantListBuilder} initialized with a set of supported
- * languages.
- * @param languages the available languages.
- * @return the initailized builder
- * @throws java.lang.IllegalArgumentException if languages is null or
- * contains no elements.
- */
- public static VariantListBuilder languages(Locale... languages) {
- VariantListBuilder b = VariantListBuilder.newInstance();
- b.languages(languages);
- return b;
- }
-
- /**
- * Create a {@link VariantListBuilder} initialized with a set of supported
- * encodings.
- * @param encodings the available encodings.
- * @return the initailized builder
- * @throws java.lang.IllegalArgumentException if encodings is null or
- * contains no elements.
- */
- public static VariantListBuilder encodings(String... encodings) {
- VariantListBuilder b = VariantListBuilder.newInstance();
- b.encodings(encodings);
- return b;
- }
-
- /**
- * Generate hash code from variant properties.
- * @return the hash code
- */
- @Override
- public int hashCode() {
- int hash = 7;
- hash = 29 * hash + (this.language != null ? this.language.hashCode() : 0);
- hash = 29 * hash + (this.mediaType != null ? this.mediaType.hashCode() : 0);
- hash = 29 * hash + (this.encoding != null ? this.encoding.hashCode() : 0);
- return hash;
- }
-
- /**
- * Compares obj to this variant to see if they are the same
- * considering all property values.
- * @param obj the object to compare to
- * @return true if the two variants are the same, false otherwise.
- */
- @Override
- public boolean equals(Object obj) {
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- final Variant other = (Variant) obj;
- if (this.language != other.language && (this.language == null || !this.language.equals(other.language))) {
- return false;
- }
- if (this.mediaType != other.mediaType && (this.mediaType == null || !this.mediaType.equals(other.mediaType))) {
- return false;
- }
- if (this.encoding != other.encoding && (this.encoding == null || !this.encoding.equals(other.encoding))) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- StringWriter w = new StringWriter();
- w.append("Variant[mediaType=");
- w.append(mediaType==null ? "null" : mediaType.toString());
- w.append(", language=");
- w.append(language==null ? "null" : language.toString());
- w.append(", encoding=");
- w.append(encoding==null ? "null" : encoding);
- w.append("]");
- return w.toString();
- }
-
- /**
- * A builder for a list of representation variants.
- */
- public static abstract class VariantListBuilder {
-
- /**
- * Protected constructor, use the static <code>newInstance</code>
- * method to obtain an instance.
- */
- protected VariantListBuilder() {}
-
- /**
- * Create a new builder instance.
- * @return a new Builder
- */
- public static VariantListBuilder newInstance() {
- VariantListBuilder b = RuntimeDelegate.getInstance().createVariantListBuilder();
- return b;
- }
-
- /**
- * Build a list of representation variants from the current state of
- * the builder. After this method is called the builder is reset to
- * an empty state.
- * @return a list of representation variants
- */
- public abstract List<Variant> build();
-
- /**
- * Add the current combination of metadata to the list of supported variants,
- * after this method is called the current combination of metadata is emptied.
- * If more than one value is supplied for one or more of the variant properties
- * then a variant will be generated for each possible combination. E.g.
- * in the following <code>list</code> would have four members:
- * <p><pre>List<Variant> list = VariantListBuilder.newInstance().languages("en","fr")
- * .encodings("zip", "identity").add().build()</pre>
- *
- * @return the updated builder
- * @throws java.lang.IllegalStateException if there is not at least one
- * mediaType, language or encoding set for the current variant.
- */
- public abstract VariantListBuilder add();
-
- /**
- * Set the language[s] for this variant.
- * @param languages the available languages
- * @return the updated builder
- */
- public abstract VariantListBuilder languages(Locale... languages);
-
- /**
- * Set the encoding[s] for this variant.
- * @param encodings the available encodings
- * @return the updated builder
- */
- public abstract VariantListBuilder encodings(String... encodings);
-
- /**
- * Set the media type[s] for this variant.
- * @param mediaTypes the available mediaTypes. If specific charsets
- * are supported they should be included as parameters of the respective
- * media type.
- * @return the updated builder
- */
- public abstract VariantListBuilder mediaTypes(MediaType... mediaTypes);
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/core/package-info.java b/plugins/com.sun.jersey.source/javax/ws/rs/core/package-info.java
deleted file mode 100644
index 99f200c1feb..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/core/package-info.java
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * Low-level interfaces and annotations used to create RESTful service
- * resources.
- */
-package javax.ws.rs.core; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/ContextResolver.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/ContextResolver.java
deleted file mode 100644
index 957e5d68047..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/ContextResolver.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package javax.ws.rs.ext;
-
-/**
- * Contract for a provider that supplies context information to resource
- * classes and other providers. An implementation of this interface must be
- * annotated with {@link Provider}.
- *
- * A <code>ContextResolver</code> implementation may be annotated
- * with {@link javax.ws.rs.Produces} to restrict the media types for
- * which it will be considered suitable.
- *
- * @see javax.ws.rs.core.Context
- * @see Providers#getContextResolver(java.lang.Class, javax.ws.rs.core.MediaType)
- * @see Provider
- * @see javax.ws.rs.Produces
- */
-public interface ContextResolver<T> {
-
- /**
- * Get a context of type <code>T</code> that is applicable to the supplied
- * type.
- * @param type the class of object for which a context is desired
- * @return a context for the supplied type or <code>null</code> if a
- * context for the supplied type is not available from this provider.
- */
- T getContext(Class<?> type);
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/ExceptionMapper.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/ExceptionMapper.java
deleted file mode 100644
index 1bed6cb49da..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/ExceptionMapper.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * 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;
-
-/**
- * Contract for a provider that maps Java exceptions to
- * {@link javax.ws.rs.core.Response}. An implementation of this interface must
- * be annotated with {@link Provider}.
- *
- * @see Provider
- * @see javax.ws.rs.core.Response
- */
-public interface ExceptionMapper<E extends Throwable> {
-
- /**
- * Map an exception to a {@link javax.ws.rs.core.Response}. Returning
- * {@code null} results in a {@link javax.ws.rs.core.Response.Status#NO_CONTENT}
- * response. Throwing a runtime exception results in a
- * {@link javax.ws.rs.core.Response.Status#INTERNAL_SERVER_ERROR} response
- * @param exception the exception to map to a response
- * @return a response mapped from the supplied exception
- */
- Response toResponse(E exception);
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/FactoryFinder.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/FactoryFinder.java
deleted file mode 100644
index cb92624d0c2..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/FactoryFinder.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * FactoryFinder.java
- *
- * Created on November 16, 2007, 3:14 PM
- *
- */
-package javax.ws.rs.ext;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Properties;
-
-class FactoryFinder {
-
- static ClassLoader getContextClassLoader() {
- return AccessController.doPrivileged(
- new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- ClassLoader cl = null;
- try {
- cl = Thread.currentThread().getContextClassLoader();
- } catch (SecurityException ex) { }
- return cl;
- }
- });
- }
-
- /**
- * Creates an instance of the specified class using the specified
- * <code>ClassLoader</code> object.
- *
- * @exception ClassNotFoundException if the given class could not be found
- * or could not be instantiated
- */
- private static Object newInstance(String className,
- ClassLoader classLoader) throws ClassNotFoundException {
- try {
- Class spiClass;
- if (classLoader == null) {
- spiClass = Class.forName(className);
- } else {
- try {
- spiClass = Class.forName(className, false, classLoader);
- } catch (ClassNotFoundException ex) {
- spiClass = Class.forName(className);
- }
- }
- return spiClass.newInstance();
- } catch (ClassNotFoundException x) {
- throw x;
- } catch (Exception x) {
- throw new ClassNotFoundException(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Finds the implementation <code>Class</code> object for the given
- * factory name, or if that fails, finds the <code>Class</code> object
- * for the given fallback class name. The arguments supplied MUST be
- * used in order. If using the first argument is successful, the second
- * one will not be used.
- * <P>
- * This method is package private so that this code can be shared.
- *
- * @return the <code>Class</code> object of the specified message factory;
- * may not be <code>null</code>
- *
- * @param factoryId the name of the factory to find, which is
- * a system property
- * @param fallbackClassName the implementation class name, which is
- * to be used only if nothing else
- * is found; <code>null</code> to indicate that
- * there is no fallback class name
- * @exception WebServiceException if there is an error
- */
- static Object find(String factoryId, String fallbackClassName) throws ClassNotFoundException {
- ClassLoader classLoader = getContextClassLoader();
-
- String serviceId = "META-INF/services/" + factoryId;
- // try to find services in CLASSPATH
- try {
- InputStream is;
- if (classLoader == null) {
- is = ClassLoader.getSystemResourceAsStream(serviceId);
- } else {
- is = classLoader.getResourceAsStream(serviceId);
- }
-
- if (is != null) {
- BufferedReader rd =
- new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
- String factoryClassName = rd.readLine();
- rd.close();
-
- if (factoryClassName != null &&
- !"".equals(factoryClassName)) {
- return newInstance(factoryClassName, classLoader);
- }
- }
- } catch (Exception ex) {
- }
-
-
- // try to read from $java.home/lib/jaxrs.properties
- try {
- String javah = System.getProperty("java.home");
- String configFile = javah + File.separator +
- "lib" + File.separator + "jaxrs.properties";
- File f = new File(configFile);
- if (f.exists()) {
- Properties props = new Properties();
- props.load(new FileInputStream(f));
- String factoryClassName = props.getProperty(factoryId);
- return newInstance(factoryClassName, classLoader);
- }
- } catch (Exception ex) {
- }
-
-
- // Use the system property
- try {
- String systemProp =
- System.getProperty(factoryId);
- if (systemProp != null) {
- return newInstance(systemProp, classLoader);
- }
- } catch (SecurityException se) {
- }
-
- if (fallbackClassName == null) {
- throw new ClassNotFoundException(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- return newInstance(fallbackClassName, classLoader);
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyReader.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyReader.java
deleted file mode 100644
index e4d82213f38..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyReader.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * MessageBodyReader.java
- *
- * Created on November 8, 2007, 3:57 PM
- *
- */
-
-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.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * Contract for a provider that supports the conversion of a stream to a
- * Java type. To add a <code>MessageBodyReader</code> implementation, annotate the
- * implementation class with <code>@Provider</code>.
- *
- * A <code>MessageBodyReader</code> implementation may be annotated
- * with {@link javax.ws.rs.Consumes} to restrict the media types for which it will
- * be considered suitable.
- *
- * @see Provider
- * @see javax.ws.rs.Consumes
- */
-public interface MessageBodyReader<T> {
-
- /**
- * Ascertain if the MessageBodyReader can produce an instance of a
- * particular type. The type parameter gives the
- * class of the object that should be produced, the genericType parameter
- * gives the java.lang.reflect.Type of the object that should be produced.
- * E.g. if the object to be produced is List<String>, the type parameter
- * will be java.util.List and the genericType parameter will be
- * java.lang.reflect.ParameterizedType.
- *
- * @param type the class of object to be produced.
- * @param genericType the type of object to be produced. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the formal type of the method parameter as returned by
- * <code>Method.getGenericParameterTypes</code>.
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be initialized with the produced instance. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the annotations on that parameter returned by
- * <code>Method.getParameterAnnotations</code>.
- * @param mediaType the media type of the HTTP entity, if one is not
- * specified in the request then <code>application/octet-stream</code> is
- * used.
- * @return true if the type is supported, otherwise false.
- */
- boolean isReadable(Class<?> type, Type genericType,
- Annotation annotations[], MediaType mediaType);
-
- /**
- * Read a type from the {@link InputStream}.
- *
- * @return the type that was read from the stream.
- * @param type the type that is to be read from the entity stream.
- * @param genericType the type of object to be produced. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the formal type of the method parameter as returned by
- * <code>Method.getGenericParameterTypes</code>.
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be initialized with the produced instance. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the annotations on that parameter returned by
- * <code>Method.getParameterAnnotations</code>.
- * @param mediaType the media type of the HTTP entity.
- * @param httpHeaders the read-only HTTP headers associated with HTTP entity.
- * @param entityStream the {@link InputStream} of the HTTP entity. The
- * caller is responsible for ensuring that the input stream ends when the
- * entity has been consumed. The implementation should not close the input stream.
- * @throws java.io.IOException if an IO error arises
- * @throws javax.ws.rs.WebApplicationException if a specific
- * HTTP error response needs to be produced. Only effective if thrown prior
- * to the response being committed.
- */
- T readFrom(Class<T> type, Type genericType,
- Annotation annotations[], MediaType mediaType,
- MultivaluedMap<String, String> httpHeaders,
- InputStream entityStream) throws IOException, WebApplicationException;
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyWriter.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyWriter.java
deleted file mode 100644
index 758f49a73e8..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/MessageBodyWriter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * MessageBodyWriter.java
- *
- * Created on November 8, 2007, 3:57 PM
- *
- */
-
-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.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-/**
- * Contract for a provider that supports the conversion of a Java type to a
- * stream. To add a <code>MessageBodyWriter</code> implementation, annotate the
- * implementation class with <code>@Provider</code>.
- *
- * A <code>MessageBodyWriter</code> implementation may be annotated
- * with {@link javax.ws.rs.Produces} to restrict the media types for which it will
- * be considered suitable.
- *
- * @param T the type that can be written
- * @see Provider
- * @see javax.ws.rs.Produces
- */
-public interface MessageBodyWriter<T> {
-
- /**
- * Ascertain if the MessageBodyWriter supports a particular type.
- *
- * @param type the class of object that is to be written.
- * @param genericType the type of object to be written, obtained either
- * by reflection of a resource method return type or via inspection
- * of the returned instance. {@link javax.ws.rs.core.GenericEntity}
- * provides a way to specify this information at runtime.
- * @param annotations an array of the annotations on the resource
- * method that returns the object.
- * @param mediaType the media type of the HTTP entity.
- * @return true if the type is supported, otherwise false.
- */
- boolean isWriteable(Class<?> type, Type genericType,
- Annotation annotations[], MediaType mediaType);
-
- /**
- * Called before <code>writeTo</code> to ascertain the length in bytes of
- * the serialized form of <code>t</code>. A non-negative return value is
- * used in a HTTP <code>Content-Length</code> header.
- * @param t the instance to write
- * @param type the class of object that is to be written.
- * @param genericType the type of object to be written, obtained either
- * by reflection of a resource method return type or by inspection
- * of the returned instance. {@link javax.ws.rs.core.GenericEntity}
- * provides a way to specify this information at runtime.
- * @param annotations an array of the annotations on the resource
- * method that returns the object.
- * @param mediaType the media type of the HTTP entity.
- * @return length in bytes or -1 if the length cannot be determined in
- * advance
- */
- long getSize(T t, Class<?> type, Type genericType, Annotation annotations[],
- MediaType mediaType);
-
- /**
- * Write a type to an HTTP response. The response header map is mutable
- * but any changes must be made before writing to the output stream since
- * the headers will be flushed prior to writing the response body.
- *
- * @param t the instance to write.
- * @param type the class of object that is to be written.
- * @param genericType the type of object to be written, obtained either
- * by reflection of a resource method return type or by inspection
- * of the returned instance. {@link javax.ws.rs.core.GenericEntity}
- * provides a way to specify this information at runtime.
- * @param annotations an array of the annotations on the resource
- * method that returns the object.
- * @param mediaType the media type of the HTTP entity.
- * @param httpHeaders a mutable map of the HTTP response headers.
- * @param entityStream the {@link OutputStream} for the HTTP entity. The
- * implementation should not close the output stream.
- * @throws java.io.IOException if an IO error arises
- * @throws javax.ws.rs.WebApplicationException if a specific
- * HTTP error response needs to be produced. Only effective if thrown prior
- * to the response being committed.
- */
- void writeTo(T t, Class<?> type, Type genericType, Annotation annotations[],
- MediaType mediaType,
- MultivaluedMap<String, Object> httpHeaders,
- OutputStream entityStream) throws IOException, WebApplicationException;
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/Provider.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/Provider.java
deleted file mode 100644
index 2cb86365869..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/Provider.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Provider.java
- *
- * Created on May 15, 2007, 11:59 AM
- *
- */
-
-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;
-
-/**
- * Marks an implementation of an extension interface.
- *
- * @see MessageBodyReader
- * @see MessageBodyWriter
- * @see ContextResolver
- * @see ExceptionMapper
- */
-@Target({ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-public @interface Provider {
-
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/Providers.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/Providers.java
deleted file mode 100644
index 0fc8ce180dc..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/Providers.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * Providers.java
- *
- * Created on March 5, 2008, 9:00 AM
- *
- */
-
-package javax.ws.rs.ext;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import javax.ws.rs.core.MediaType;
-
-/**
- * An injectable interface providing runtime lookup of provider instances.
- *
- * @see javax.ws.rs.core.Context
- * @see MessageBodyReader
- * @see MessageBodyWriter
- * @see ContextResolver
- * @see ExceptionMapper
- */
-public interface Providers {
-
- /**
- * Get a message body reader that matches a set of criteria. The set of
- * readers is first filtered by comparing the supplied value of
- * {@code mediaType} with the value of each reader's
- * {@link javax.ws.rs.Consumes}, ensuring the supplied value of
- * {@code type} is assignable to the generic type of the reader, and
- * eliminating those that do not match.
- * The list of matching readers is then ordered with those with the best
- * matching values of {@link javax.ws.rs.Consumes} (x/y > x&#47;* > *&#47;*)
- * sorted first. Finally, the
- * {@link MessageBodyReader#isReadable}
- * method is called on each reader in order using the supplied criteria and
- * the first reader that returns {@code true} is selected and returned.
- *
- * @param type the class of object that is to be read.
- * @param genericType the type of object to be produced. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the formal type of the method parameter as returned by
- * <code>Class.getGenericParameterTypes</code>.
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be initialized with the produced instance. E.g. if the
- * message body is to be converted into a method parameter, this will be
- * the annotations on that parameter returned by
- * <code>Class.getParameterAnnotations</code>.
- * @param mediaType the media type of the data that will be read.
- * @return a MessageBodyReader that matches the supplied criteria or null
- * if none is found.
- */
- <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type,
- Type genericType, Annotation annotations[], MediaType mediaType);
-
- /**
- * Get a message body writer that matches a set of criteria. The set of
- * writers is first filtered by comparing the supplied value of
- * {@code mediaType} with the value of each writer's
- * {@link javax.ws.rs.Produces}, ensuring the supplied value of
- * {@code type} is assignable to the generic type of the reader, and
- * eliminating those that do not match.
- * The list of matching writers is then ordered with those with the best
- * matching values of {@link javax.ws.rs.Produces} (x/y > x&#47;* > *&#47;*)
- * sorted first. Finally, the
- * {@link MessageBodyWriter#isWriteable}
- * method is called on each writer in order using the supplied criteria and
- * the first writer that returns {@code true} is selected and returned.
- *
- * @param type the class of object that is to be written.
- * @param genericType the type of object to be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the declared type of the field as returned by
- * <code>Field.getGenericType</code>.
- * @param annotations an array of the annotations on the declaration of the
- * artifact that will be written. E.g. if the
- * message body is to be produced from a field, this will be
- * the annotations on that field returned by
- * <code>Field.getDeclaredAnnotations</code>.
- * @param mediaType the media type of the data that will be written.
- * @return a MessageBodyReader that matches the supplied criteria or null
- * if none is found.
- */
- <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> type,
- Type genericType, Annotation annotations[], MediaType mediaType);
-
- /**
- * Get an exception mapping provider for a particular class of exception.
- * Returns the provider whose generic type is the nearest superclass of
- * {@code type}.
- * @param type the class of exception
- * @return an {@link ExceptionMapper} for the supplied type or null if none
- * is found.
- */
- <T extends Throwable> ExceptionMapper<T> getExceptionMapper(Class<T> type);
-
- /**
- * Get a context resolver for a particular type of context and media type.
- * The set of resolvers is first filtered by comparing the supplied value of
- * {@code mediaType} with the value of each resolver's
- * {@link javax.ws.rs.Produces}, ensuring the generic type of the context
- * resolver is assignable to the supplied value of {@code contextType}, and
- * eliminating those that do not match. If only one resolver matches the
- * criteria then it is returned. If more than one resolver matches then the
- * list of matching resolvers is ordered with those with the best
- * matching values of {@link javax.ws.rs.Produces} (x/y > x&#47;* > *&#47;*)
- * sorted first. A proxy is returned that delegates calls to
- * {@link ContextResolver#getContext(java.lang.Class)} to each matching context
- * resolver in order and returns the first non-null value it obtains or null
- * if all matching context resolvers return null.
- *
- * @param contextType the class of context desired
- * @param mediaType the media type of data for which a context is required.
- * @return a matching context resolver instance or null if no matching
- * context providers are found.
- */
- <T> ContextResolver<T> getContextResolver(Class<T> contextType,
- MediaType mediaType);
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/RuntimeDelegate.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/RuntimeDelegate.java
deleted file mode 100644
index 1fbed8f4a7e..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/RuntimeDelegate.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * The contents of this file are subject to the terms
- * of the Common Development and Distribution License
- * (the "License"). You may not use this file except
- * in compliance with the License.
- *
- * You can obtain a copy of the license at
- * http://www.opensource.org/licenses/cddl1.php
- * See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-/*
- * RuntimeDelegate.java
- *
- * Created on November 15, 2007, 4:00 PM
- *
- */
-
-package javax.ws.rs.ext;
-
-import java.lang.reflect.ReflectPermission;
-import java.net.URL;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.core.Response.ResponseBuilder;
-import javax.ws.rs.core.Variant.VariantListBuilder;
-import javax.ws.rs.core.UriBuilder;
-
-/**
- * Implementations of JAX-RS provide a concrete subclass of RuntimeDelegate and
- * various JAX-RS API methods defer to methods of RuntimeDelegate for their
- * functionality. Regular users of JAX-RS are not expected to use this class
- * directly and overriding an implementation of this class with a user supplied
- * subclass may cause unexpected behavior.
- *
- */
-public abstract class RuntimeDelegate {
-
- public static final String JAXRS_RUNTIME_DELEGATE_PROPERTY
- = "javax.ws.rs.ext.RuntimeDelegate";
- private static final String JAXRS_DEFAULT_RUNTIME_DELEGATE
- = "com.sun.ws.rs.ext.RuntimeDelegateImpl";
-
- private static ReflectPermission rp = new ReflectPermission("suppressAccessChecks");
-
- protected RuntimeDelegate() {
- }
-
- private static volatile RuntimeDelegate rd;
-
- /**
- * Obtain a RuntimeDelegate instance. If an instance had not already been
- * created and set via {@link #setInstance}, the first invocation will
- * create an instance which will then be cached for future use.
- *
- * <p>
- * The algorithm used to locate the RuntimeDelegate subclass to use consists
- * of the following steps:
- * <p>
- * <ul>
- * <li>
- * If a resource with the name of
- * <code>META-INF/services/javax.ws.rs.ext.RuntimeDelegate</code>
- * exists, then its first line, if present, is used as the UTF-8 encoded
- * name of the implementation class.
- * </li>
- * <li>
- * If the $java.home/lib/jaxrs.properties file exists and it is readable by
- * the <code>java.util.Properties.load(InputStream)</code> method and it contains
- * an entry whose key is <code>javax.ws.rs.ext.RuntimeDelegate</code>, then the value of
- * that entry is used as the name of the implementation class.
- * </li>
- * <li>
- * If a system property with the name <code>javax.ws.rs.ext.RuntimeDelegate</code>
- * is defined, then its value is used as the name of the implementation class.
- * </li>
- * <li>
- * Finally, a default implementation class name is used.
- * </li>
- * </ul>
- *
- * @return an instance of RuntimeDelegate
- */
- public static RuntimeDelegate getInstance() {
- // Double-check idiom for lazy initialization of fields.
- RuntimeDelegate result = rd;
- if (result == null) { // First check (no locking)
- synchronized(RuntimeDelegate.class) {
- result = rd;
- if (result == null) { // Second check (with locking)
- rd = result = findDelegate();
- }
- }
- }
- return result;
- }
-
- /**
- * Obtain a RuntimeDelegate instance using the method described in
- * {@link #getInstance}.
- * @return an instance of RuntimeDelegate
- */
- private static RuntimeDelegate findDelegate() {
- try {
- Object delegate =
- FactoryFinder.find(JAXRS_RUNTIME_DELEGATE_PROPERTY,
- JAXRS_DEFAULT_RUNTIME_DELEGATE);
- if (!(delegate instanceof RuntimeDelegate)) {
- Class pClass = RuntimeDelegate.class;
- String classnameAsResource = pClass.getName().replace('.', '/') + ".class";
- ClassLoader loader = pClass.getClassLoader();
- if(loader == null) {
- loader = ClassLoader.getSystemClassLoader();
- }
- URL targetTypeURL = loader.getResource(classnameAsResource);
- throw new LinkageError("ClassCastException: attempting to cast" +
- delegate.getClass().getClassLoader().getResource(classnameAsResource) +
- "to" + targetTypeURL.toString() );
- }
- return (RuntimeDelegate) delegate;
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * Set the runtime delegate that will be used by JAX-RS classes. If this method
- * is not called prior to {@link #getInstance} then an implementation will
- * be sought as described in {@link #getInstance}.
- * @param rd the runtime delegate instance
- * @throws SecurityException if there is a security manager and the permission
- * ReflectPermission("suppressAccessChecks") has not been granted.
- */
- public static void setInstance(RuntimeDelegate rd) throws SecurityException {
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- security.checkPermission(rp);
- }
- synchronized(RuntimeDelegate.class) {
- RuntimeDelegate.rd = rd;
- }
- }
-
- /**
- * Create a new instance of a {@link javax.ws.rs.core.UriBuilder}.
- * @return new UriBuilder instance
- * @see javax.ws.rs.core.UriBuilder
- */
- public abstract UriBuilder createUriBuilder();
-
- /**
- * Create a new instance of a {@link javax.ws.rs.core.Response.ResponseBuilder}.
- * @return new ResponseBuilder instance
- * @see javax.ws.rs.core.Response.ResponseBuilder
- */
- public abstract ResponseBuilder createResponseBuilder();
-
- /**
- * Create a new instance of a {@link javax.ws.rs.core.Variant.VariantListBuilder}.
- *
- * @return new VariantListBuilder instance
- * @see javax.ws.rs.core.Variant.VariantListBuilder
- */
- public abstract VariantListBuilder createVariantListBuilder();
-
- /**
- * Create a configured instance of the supplied endpoint type. How the
- * returned endpoint instance is published is dependent on the type of
- * endpoint.
- * @param application the application configuration
- * @param endpointType the type of endpoint instance to be created.
- * @return a configured instance of the requested type.
- * @throws java.lang.IllegalArgumentException if application is null or the
- * requested endpoint type is not supported.
- * @throws java.lang.UnsupportedOperationException if the implementation
- * supports no endpoint types.
- */
- public abstract <T> T createEndpoint(Application application,
- Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException;
-
- /**
- * Obtain an instance of a HeaderDelegate for the supplied class. An
- * implementation is required to support the following values for type:
- * {@link javax.ws.rs.core.Cookie}, {@link javax.ws.rs.core.CacheControl},
- * {@link javax.ws.rs.core.EntityTag}, {@link javax.ws.rs.core.NewCookie},
- * {@link javax.ws.rs.core.MediaType} and {@code java.util.Date}.
- * @param type the class of the header
- * @return an instance of HeaderDelegate for the supplied type
- * @throws java.lang.IllegalArgumentException if type is null
- */
- public abstract <T> HeaderDelegate<T> createHeaderDelegate(Class<T> type);
-
- /**
- * Defines the contract for a delegate that is responsible for
- * converting between the String form of a HTTP header and
- * the corresponding JAX-RS type <code>T</code>.
- * @param T a JAX-RS type that corresponds to the value of a HTTP header
- */
- public static interface HeaderDelegate<T> {
- /**
- * Parse the supplied value and create an instance of <code>T</code>.
- * @param value the string value
- * @return the newly created instance of <code>T</code>
- * @throws IllegalArgumentException if the supplied string cannot be
- * parsed or is null
- */
- public T fromString(String value) throws IllegalArgumentException;
-
- /**
- * Convert the supplied value to a String.
- * @param value the value of type <code>T</code>
- * @return a String representation of the value
- * @throws IllegalArgumentException if the supplied object cannot be
- * serialized or is null
- */
- public String toString(T value);
- }
-}
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/ext/package-info.java b/plugins/com.sun.jersey.source/javax/ws/rs/ext/package-info.java
deleted file mode 100644
index 16dd85ee7fe..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/ext/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * APIs that provide extensions to the types supported by the JAX-RS API.
- */
-package javax.ws.rs.ext; \ No newline at end of file
diff --git a/plugins/com.sun.jersey.source/javax/ws/rs/package-info.java b/plugins/com.sun.jersey.source/javax/ws/rs/package-info.java
deleted file mode 100644
index de23b600cba..00000000000
--- a/plugins/com.sun.jersey.source/javax/ws/rs/package-info.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * High-level interfaces and annotations used to create RESTful service
- * resources. E.g.:
-<pre>
-&#064;Path("widgets/{widgetid}")
-&#064;Consumes("application/widgets+xml")
-&#064;Produces("application/widgets+xml")
-public class WidgetResource {
-
- &#064;GET
- public String getWidget(&#064;PathParam("widgetid") String id) {
- return getWidgetAsXml(id);
- }
-
- &#064;PUT
- public void updateWidget(&#064;PathParam("widgetid") String id,
- Source update) {
- updateWidgetFromXml(id, update);
- }
-
- ...
-}
-</pre>
- */
-package javax.ws.rs; \ No newline at end of file
diff --git a/plugins/com.sun.jersey/.classpath b/plugins/com.sun.jersey/.classpath
deleted file mode 100644
index ae2b966ba5d..00000000000
--- a/plugins/com.sun.jersey/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry exported="true" kind="lib" path="" sourcepath="/com.sun.jersey.source"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/com.sun.jersey/.project b/plugins/com.sun.jersey/.project
deleted file mode 100644
index 52ec5691738..00000000000
--- a/plugins/com.sun.jersey/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>com.sun.jersey</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/com.sun.jersey/META-INF/MANIFEST.MF b/plugins/com.sun.jersey/META-INF/MANIFEST.MF
deleted file mode 100644
index 93fc55064ba..00000000000
--- a/plugins/com.sun.jersey/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,117 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Jersey
-Bundle-SymbolicName: com.sun.jersey
-Bundle-Version: 1.8.0.qualifier
-Bundle-Vendor: jersey.java.net
-Export-Package: com.sun.jersey.api,
- com.sun.jersey.api.client,
- com.sun.jersey.api.client.async,
- com.sun.jersey.api.client.config,
- com.sun.jersey.api.client.filter,
- com.sun.jersey.api.container,
- com.sun.jersey.api.container.filter,
- com.sun.jersey.api.container.grizzly,
- com.sun.jersey.api.container.httpserver,
- com.sun.jersey.api.core,
- com.sun.jersey.api.json,
- com.sun.jersey.api.model,
- com.sun.jersey.api.provider.jaxb,
- com.sun.jersey.api.representation,
- com.sun.jersey.api.uri,
- com.sun.jersey.api.view,
- com.sun.jersey.api.wadl,
- com.sun.jersey.api.wadl.config,
- com.sun.jersey.atom.rome.impl,
- com.sun.jersey.atom.rome.impl.provider.entity,
- com.sun.jersey.client.impl,
- com.sun.jersey.client.impl.async,
- com.sun.jersey.client.osgi,
- com.sun.jersey.client.proxy,
- com.sun.jersey.client.urlconnection,
- com.sun.jersey.core.header,
- com.sun.jersey.core.header.reader,
- com.sun.jersey.core.impl.provider.entity,
- com.sun.jersey.core.impl.provider.header,
- com.sun.jersey.core.impl.provider.xml,
- com.sun.jersey.core.osgi,
- com.sun.jersey.core.provider,
- com.sun.jersey.core.provider.jaxb,
- com.sun.jersey.core.reflection,
- com.sun.jersey.core.spi.component,
- com.sun.jersey.core.spi.component.ioc,
- com.sun.jersey.core.spi.factory,
- com.sun.jersey.core.spi.scanning,
- com.sun.jersey.core.spi.scanning.uri,
- com.sun.jersey.core.util,
- com.sun.jersey.fastinfoset.impl.provider.entity,
- com.sun.jersey.impl,
- com.sun.jersey.json.impl,
- com.sun.jersey.json.impl.provider.entity,
- com.sun.jersey.json.impl.reader,
- com.sun.jersey.json.impl.writer,
- com.sun.jersey.localization,
- com.sun.jersey.multipart,
- com.sun.jersey.multipart.file,
- com.sun.jersey.multipart.impl,
- com.sun.jersey.server.impl,
- com.sun.jersey.server.impl.application,
- com.sun.jersey.server.impl.cdi,
- com.sun.jersey.server.impl.component,
- com.sun.jersey.server.impl.container,
- com.sun.jersey.server.impl.container.filter,
- com.sun.jersey.server.impl.container.grizzly,
- com.sun.jersey.server.impl.container.httpserver,
- com.sun.jersey.server.impl.container.servlet,
- com.sun.jersey.server.impl.ejb,
- com.sun.jersey.server.impl.inject,
- com.sun.jersey.server.impl.managedbeans,
- com.sun.jersey.server.impl.model,
- com.sun.jersey.server.impl.model.method,
- com.sun.jersey.server.impl.model.method.dispatch,
- com.sun.jersey.server.impl.model.parameter,
- com.sun.jersey.server.impl.model.parameter.multivalued,
- com.sun.jersey.server.impl.modelapi.annotation,
- com.sun.jersey.server.impl.modelapi.validation,
- com.sun.jersey.server.impl.monitoring,
- com.sun.jersey.server.impl.provider,
- com.sun.jersey.server.impl.resource,
- com.sun.jersey.server.impl.template,
- com.sun.jersey.server.impl.uri,
- com.sun.jersey.server.impl.uri.rules,
- com.sun.jersey.server.impl.uri.rules.automata,
- com.sun.jersey.server.impl.wadl,
- com.sun.jersey.server.osgi,
- com.sun.jersey.server.probes,
- com.sun.jersey.server.spi.component,
- com.sun.jersey.server.wadl,
- com.sun.jersey.server.wadl.generators,
- com.sun.jersey.server.wadl.generators.resourcedoc,
- com.sun.jersey.server.wadl.generators.resourcedoc.model,
- com.sun.jersey.server.wadl.generators.resourcedoc.xhtml,
- com.sun.jersey.spi,
- com.sun.jersey.spi.container,
- com.sun.jersey.spi.container.servlet,
- com.sun.jersey.spi.dispatch,
- com.sun.jersey.spi.inject,
- com.sun.jersey.spi.monitoring,
- com.sun.jersey.spi.resource,
- com.sun.jersey.spi.scanning,
- com.sun.jersey.spi.service,
- com.sun.jersey.spi.template,
- com.sun.jersey.spi.uri.rules,
- com.sun.research.ws.wadl,
- com.sun.ws.rs.ext
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Import-Package: javax.mail;version="1.4.1",
- javax.mail.event;version="1.4.1",
- javax.mail.internet;version="1.4.1",
- javax.mail.search;version="1.4.1",
- javax.mail.util;version="1.4.1",
- javax.servlet,
- javax.servlet.http,
- javax.ws.rs,
- javax.ws.rs.core,
- javax.ws.rs.ext,
- org.objectweb.asm,
- org.jvnet.mimepull
diff --git a/plugins/com.sun.jersey/META-INF/jersey-module-version b/plugins/com.sun.jersey/META-INF/jersey-module-version
deleted file mode 100644
index 6259340971b..00000000000
--- a/plugins/com.sun.jersey/META-INF/jersey-module-version
+++ /dev/null
@@ -1 +0,0 @@
-1.8
diff --git a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.properties b/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.properties
deleted file mode 100644
index 18a3591f4e7..00000000000
--- a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Generated by org.apache.felix.bundleplugin
-#Fri Jun 24 12:18:17 CEST 2011
-version=1.8
-groupId=com.sun.jersey.contribs
-artifactId=jersey-multipart
diff --git a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.xml b/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.xml
deleted file mode 100644
index e7f11aa0d72..00000000000
--- a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey.contribs/jersey-multipart/pom.xml
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
-
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License"). You
- may not use this file except in compliance with the License. You can
- obtain a copy of the License at
- http://glassfish.java.net/public/CDDL+GPL_1_1.html
- or packager/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
-
- When distributing the software, include this License Header Notice in each
- file and include the License file at packager/legal/LICENSE.txt.
-
- GPL Classpath Exception:
- Oracle designates this particular file as subject to the "Classpath"
- exception as provided by Oracle in the GPL Version 2 section of the License
- file that accompanied this code.
-
- Modifications:
- If applicable, add the following below the License Header, with the fields
- enclosed by brackets [] replaced by your own identifying information:
- "Portions Copyright [year] [name of copyright owner]"
-
- Contributor(s):
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-contribs</artifactId>
- <version>1.8</version>
- </parent>
-
- <artifactId>jersey-multipart</artifactId>
- <packaging>jar</packaging>
- <name>jersey-multipart</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jvnet</groupId>
- <artifactId>mimepull</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <links>
- <link>http://jsr311.java.net/nonav/releases/1.1</link>
- <link>http://jersey.java.net/nonav/apidocs/${project.version}/jersey/</link>
- </links>
- <excludePackageNames>com.sun.jersey.multipart.impl</excludePackageNames>
- <notimestamp>true</notimestamp>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>cobertura</id>
- <activation>
- <property>
- <name>cobertura</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- <version>${project.version}</version>
- <classifier>cobertura</classifier>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-grizzly2</artifactId>
- <version>${project.version}</version>
- <optional>true</optional>
- <classifier>cobertura</classifier>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <classifier>cobertura</classifier>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-apache-client</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- <classifier>cobertura</classifier>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <dependencies>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-grizzly2</artifactId>
- <version>${project.version}</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-apache-client</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </profile>
- </profiles>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}/src/main/java</directory>
- <includes>
- <include>META-INF/**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.properties b/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.properties
deleted file mode 100644
index e8e3d6e06d5..00000000000
--- a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Generated by org.apache.felix.bundleplugin
-#Fri Jun 24 12:39:35 CEST 2011
-version=1.8
-groupId=com.sun.jersey
-artifactId=jersey-bundle
diff --git a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.xml b/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.xml
deleted file mode 100644
index 5c8d543b54d..00000000000
--- a/plugins/com.sun.jersey/META-INF/maven/com.sun.jersey/jersey-bundle/pom.xml
+++ /dev/null
@@ -1,477 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
-
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License"). You
- may not use this file except in compliance with the License. You can
- obtain a copy of the License at
- http://glassfish.java.net/public/CDDL+GPL_1_1.html
- or packager/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
-
- When distributing the software, include this License Header Notice in each
- file and include the License file at packager/legal/LICENSE.txt.
-
- GPL Classpath Exception:
- Oracle designates this particular file as subject to the "Classpath"
- exception as provided by Oracle in the GPL Version 2 section of the License
- file that accompanied this code.
-
- Modifications:
- If applicable, add the following below the License Header, with the fields
- enclosed by brackets [] replaced by your own identifying information:
- "Portions Copyright [year] [name of copyright owner]"
-
- Contributor(s):
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-project</artifactId>
- <version>1.8</version>
- <!--relativePath>../pom.xml</relativePath-->
- </parent>
- <artifactId>jersey-bundle</artifactId>
- <packaging>jar</packaging>
- <name>jersey-bundle</name>
- <description>A bundle containing code of all jar-based modules that provide
- JAX-RS and Jersey-related features. Such a bundle is *only intended* for
- developers that do not use Maven's dependency system.
- The bundle does not include code for contributes, tests and samples.
- </description>
- <dependencies>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-grizzly</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-atom</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-json</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-fastinfoset</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-jaxrs</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-xc</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.servlet</artifactId>
- <version>3.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.glassfish</groupId>
- <artifactId>javax.ejb</artifactId>
- <version>3.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-osgi-bundle</artifactId>
- <version>1.0.1-Final</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.6.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.grizzly</groupId>
- <artifactId>grizzly-servlet-webserver</artifactId>
- <version>1.9.31</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.net.httpserver</groupId>
- <artifactId>http</artifactId>
- <version>20070405</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>rome</groupId>
- <artifactId>rome</artifactId>
- <version>0.9</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>jdom</groupId>
- <artifactId>jdom</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jettison</groupId>
- <artifactId>jettison</artifactId>
- <version>1.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.fastinfoset</groupId>
- <artifactId>FastInfoset</artifactId>
- <version>1.2.9</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>3.1</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi_R4_core</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>release</id>
- <build>
- <plugins>
- <plugin> <!-- generate javadoc from sources unpacked above -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <links>
- <link>https://jsr311.dev.java.net/nonav/releases/1.1</link>
- </links>
- <sourcepath>${gen-src-dir}</sourcepath>
- <!-- excludePackageNames HAS TO be defined as single line -->
- <excludePackageNames>com.sun.jersey.core.impl com.sun.jersey.client.impl com.sun.jersey.server.impl com.sun.jersey.impl com.sun.research.ws.wadl com.sun.jersey.atom.rome.impl com.sun.jersey.fastinfoset.impl com.sun.jersey.json.impl</excludePackageNames>
- <notimestamp>true</notimestamp>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
- <build>
- <resources>
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- </resource>
- <resource>
- <directory>${gen-src-dir}</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- </plugin>
- <plugin> <!-- want to unpack sources from individual modules -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${gen-src-dir}</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${gen-src-dir}</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-grizzly</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${gen-src-dir}</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${gen-src-dir}</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-atom</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${gen-src-dir}</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-json</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${gen-src-dir}</outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-fastinfoset</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- <classifier>sources</classifier>
- <overWrite>false</overWrite>
- <outputDirectory>${gen-src-dir}</outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin> <!-- want to compile META-INF/services registry from individual modules -->
- <groupId>com.sun.istack</groupId>
- <artifactId>maven-istack-commons-plugin</artifactId>
- <version>0.1</version>
- <executions>
- <execution>
- <goals>
- <goal>metainf-services</goal>
- </goals>
- <phase>generate-sources</phase>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-grizzly</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-atom</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-json</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- <artifactItem>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-fastinfoset</artifactId>
- <version>${project.version}</version>
- </artifactItem>
- </artifactItems>
- <providers>
- <spi>com.sun.jersey.spi.container.ContainerProvider</spi>
- <spi>com.sun.jersey.spi.container.ContainerRequestFilter</spi>
- <spi>com.sun.jersey.spi.container.ContainerResponseFilter</spi>
- <spi>com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider</spi>
- <spi>com.sun.jersey.spi.container.WebApplicationProvider</spi>
- <spi>com.sun.jersey.spi.HeaderDelegateProvider</spi>
- <spi>com.sun.jersey.spi.inject.InjectableProvider</spi>
- <spi>com.sun.jersey.spi.StringReaderProvider</spi>
- <spi>javax.ws.rs.ext.MessageBodyReader</spi>
- <spi>javax.ws.rs.ext.MessageBodyWriter</spi>
- <spi>javax.ws.rs.ext.RuntimeDelegate</spi>
- </providers>
- <destDir>${gen-src-dir}</destDir>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <id>add-test-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-test-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>src-test</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <configuration>
- <instructions>
- <Export-Package>com.sun.jersey.*,com.sun.research.ws.wadl,com.sun.ws.rs.ext</Export-Package>
- </instructions>
- <unpackBundle>true</unpackBundle>
- </configuration>
- <executions>
- <execution>
- <id>osgi-bundle</id>
- <phase>package</phase>
- <goals>
- <goal>bundle</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin> <!-- remove the generated src dir-->
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>src</directory>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <repositories>
- <repository>
- <id>glassfish-repository</id>
- <name>Repository for Glassfish</name>
- <url>http://maven.glassfish.org/content/groups/glassfish</url>
- </repository>
- </repositories>
-
- <properties>
- <gen-src-dir>${basedir}/src/main/java</gen-src-dir>
- </properties>
-</project>
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.server.impl.model.method.dispatch.ResourceMethodDispatchProvider
+++ /dev/null
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider
deleted file mode 100644
index 4905c35f378..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.HeaderDelegateProvider
+++ /dev/null
@@ -1,9 +0,0 @@
-com.sun.jersey.core.impl.provider.header.LocaleProvider
-com.sun.jersey.core.impl.provider.header.EntityTagProvider
-com.sun.jersey.core.impl.provider.header.MediaTypeProvider
-com.sun.jersey.core.impl.provider.header.CacheControlProvider
-com.sun.jersey.core.impl.provider.header.NewCookieProvider
-com.sun.jersey.core.impl.provider.header.CookieProvider
-com.sun.jersey.core.impl.provider.header.URIProvider
-com.sun.jersey.core.impl.provider.header.DateProvider
-com.sun.jersey.core.impl.provider.header.StringProvider
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.StringReaderProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.StringReaderProvider
deleted file mode 100644
index e73eb3dbab0..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.StringReaderProvider
+++ /dev/null
@@ -1,6 +0,0 @@
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$TypeFromStringEnum
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$TypeValueOf
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$TypeFromString
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$StringConstructor
-com.sun.jersey.server.impl.model.parameter.multivalued.StringReaderProviders$DateProvider
-com.sun.jersey.server.impl.model.parameter.multivalued.JAXBStringReaderProviders$RootElementProvider
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerProvider
deleted file mode 100644
index 9d53c752f08..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerProvider
+++ /dev/null
@@ -1,2 +0,0 @@
-com.sun.jersey.server.impl.container.httpserver.HttpHandlerContainerProvider
-com.sun.jersey.server.impl.container.grizzly.GrizzlyContainerProvider
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter
deleted file mode 100644
index a25c3d85b2a..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerRequestFilter
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.container.filter.NormalizeFilter
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ContainerResponseFilter
+++ /dev/null
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider
deleted file mode 100644
index 63914d8749c..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodCustomInvokerDispatchProvider
+++ /dev/null
@@ -1,6 +0,0 @@
-com.sun.jersey.server.impl.model.method.dispatch.VoidVoidDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.HttpReqResDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.MultipartFormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider
-com.sun.jersey.multipart.impl.FormDataMultiPartDispatchProvider
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider
deleted file mode 100644
index 63914d8749c..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.ResourceMethodDispatchProvider
+++ /dev/null
@@ -1,6 +0,0 @@
-com.sun.jersey.server.impl.model.method.dispatch.VoidVoidDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.HttpReqResDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.MultipartFormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider
-com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider
-com.sun.jersey.multipart.impl.FormDataMultiPartDispatchProvider
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider
deleted file mode 100644
index a8d59db87bf..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.container.WebApplicationProvider
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.container.WebApplicationProviderImpl
diff --git a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider b/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider
deleted file mode 100644
index 6b86d6a053b..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/com.sun.jersey.spi.inject.InjectableProvider
+++ /dev/null
@@ -1,5 +0,0 @@
-com.sun.jersey.core.impl.provider.xml.SAXParserContextProvider
-com.sun.jersey.core.impl.provider.xml.XMLStreamReaderContextProvider
-com.sun.jersey.core.impl.provider.xml.DocumentBuilderFactoryProvider
-com.sun.jersey.core.impl.provider.xml.TransformerFactoryProvider
-com.sun.jersey.multipart.impl.MultiPartConfigProvider
diff --git a/plugins/com.sun.jersey/META-INF/services/javax.enterprise.inject.spi.Extension b/plugins/com.sun.jersey/META-INF/services/javax.enterprise.inject.spi.Extension
deleted file mode 100644
index 4222d19b29e..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/javax.enterprise.inject.spi.Extension
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.cdi.CDIExtension \ No newline at end of file
diff --git a/plugins/com.sun.jersey/META-INF/services/javax.servlet.ServletContainerInitializer b/plugins/com.sun.jersey/META-INF/services/javax.servlet.ServletContainerInitializer
deleted file mode 100644
index 26f35bb3243..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/javax.servlet.ServletContainerInitializer
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer \ No newline at end of file
diff --git a/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyReader b/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyReader
deleted file mode 100644
index 8ccdcdb62f9..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyReader
+++ /dev/null
@@ -1,48 +0,0 @@
-com.sun.jersey.core.impl.provider.entity.StringProvider
-com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
-com.sun.jersey.core.impl.provider.entity.FileProvider
-com.sun.jersey.core.impl.provider.entity.InputStreamProvider
-com.sun.jersey.core.impl.provider.entity.DataSourceProvider
-com.sun.jersey.core.impl.provider.entity.RenderedImageProvider
-com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
-com.sun.jersey.core.impl.provider.entity.FormProvider
-com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
-com.sun.jersey.core.impl.provider.entity.ReaderProvider
-com.sun.jersey.core.impl.provider.entity.DocumentProvider
-com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
-com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
-com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
-com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
-com.sun.jersey.core.impl.provider.entity.EntityHolderReader
-com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider
-com.sun.jersey.atom.rome.impl.provider.entity.AtomEntryProvider
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
-com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
-
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetRootElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetJAXBElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetListElementProvider
-
-com.sun.jersey.multipart.impl.MultiPartReaderClientSide
-com.sun.jersey.multipart.impl.MultiPartReaderServerSide
-
diff --git a/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyWriter b/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyWriter
deleted file mode 100644
index 972b41755da..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.MessageBodyWriter
+++ /dev/null
@@ -1,41 +0,0 @@
-com.sun.jersey.core.impl.provider.entity.StringProvider
-com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
-com.sun.jersey.core.impl.provider.entity.FileProvider
-com.sun.jersey.core.impl.provider.entity.InputStreamProvider
-com.sun.jersey.core.impl.provider.entity.DataSourceProvider
-com.sun.jersey.core.impl.provider.entity.RenderedImageProvider
-com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
-com.sun.jersey.core.impl.provider.entity.FormProvider
-com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$App
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$Text
-com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
-com.sun.jersey.core.impl.provider.entity.ReaderProvider
-com.sun.jersey.core.impl.provider.entity.DocumentProvider
-com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider
-com.sun.jersey.core.impl.provider.entity.SourceProvider$SourceWriter
-com.sun.jersey.server.impl.template.ViewableMessageBodyWriter
-com.sun.jersey.atom.rome.impl.provider.entity.AtomFeedProvider
-com.sun.jersey.atom.rome.impl.provider.entity.AtomEntryProvider
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$App
-com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
-com.sun.jersey.json.impl.provider.entity.JSONWithPaddingProvider
-com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetRootElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetJAXBElementProvider
-com.sun.jersey.fastinfoset.impl.provider.entity.FastInfosetListElementProvider
-com.sun.jersey.multipart.impl.MultiPartWriter
diff --git a/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.RuntimeDelegate b/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.RuntimeDelegate
deleted file mode 100644
index 0d2c36fbb72..00000000000
--- a/plugins/com.sun.jersey/META-INF/services/javax.ws.rs.ext.RuntimeDelegate
+++ /dev/null
@@ -1 +0,0 @@
-com.sun.jersey.server.impl.provider.RuntimeDelegateImpl
diff --git a/plugins/com.sun.jersey/META-INF/taglib.tld b/plugins/com.sun.jersey/META-INF/taglib.tld
deleted file mode 100644
index 2e83f8eabc1..00000000000
--- a/plugins/com.sun.jersey/META-INF/taglib.tld
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
- <tlib-version>1.0</tlib-version>
- <jsp-version>1.2</jsp-version>
- <short-name>jerseyview</short-name>
- <uri>urn:com:sun:jersey:api:view</uri>
- <description>
- The tag library contains tags that takes advantage of
- the request dispatching mechanism.
- </description>
- <tag>
- <name>include</name>
- <tag-class>com.sun.jersey.server.impl.container.servlet.Include</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <name>page</name>
- <required>yes</required>
- <rtexprvalue>yes</rtexprvalue>
- </attribute>
- <attribute>
- <name>resource</name>
- <required>no</required>
- <rtexprvalue>yes</rtexprvalue>
- </attribute>
- </tag>
-</taglib>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/com.sun.jersey/build.properties b/plugins/com.sun.jersey/build.properties
deleted file mode 100644
index f2b5072ab08..00000000000
--- a/plugins/com.sun.jersey/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-output.. = .
-bin.includes = META-INF/,\
- com/
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ConflictException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ConflictException.class
deleted file mode 100644
index a0d830777f8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ConflictException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/JResponse$AJResponseBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/JResponse$AJResponseBuilder.class
deleted file mode 100644
index a30f1398c53..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/JResponse$AJResponseBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/JResponse$JResponseBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/JResponse$JResponseBuilder.class
deleted file mode 100644
index 4b7d28923ac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/JResponse$JResponseBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/JResponse.class b/plugins/com.sun.jersey/com/sun/jersey/api/JResponse.class
deleted file mode 100644
index 70f00e19c26..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/JResponse.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/JResponseAsResponse.class b/plugins/com.sun.jersey/com/sun/jersey/api/JResponseAsResponse.class
deleted file mode 100644
index 054c1404123..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/JResponseAsResponse.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/MessageException.class b/plugins/com.sun.jersey/com/sun/jersey/api/MessageException.class
deleted file mode 100644
index 65a53d7ee56..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/MessageException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/NotFoundException.class b/plugins/com.sun.jersey/com/sun/jersey/api/NotFoundException.class
deleted file mode 100644
index bbe58a19649..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/NotFoundException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$CookieParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$CookieParamException.class
deleted file mode 100644
index fd825d58620..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$CookieParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$FormParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$FormParamException.class
deleted file mode 100644
index 61675d94167..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$FormParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$HeaderParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$HeaderParamException.class
deleted file mode 100644
index 9fadad51437..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$HeaderParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$MatrixParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$MatrixParamException.class
deleted file mode 100644
index 3bdd18516af..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$MatrixParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$PathParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$PathParamException.class
deleted file mode 100644
index 0b95289b98b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$PathParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$QueryParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$QueryParamException.class
deleted file mode 100644
index 77fcd7275e2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$QueryParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$URIParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$URIParamException.class
deleted file mode 100644
index 142e56d2d28..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException$URIParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException.class b/plugins/com.sun.jersey/com/sun/jersey/api/ParamException.class
deleted file mode 100644
index 5c901d948f1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/ParamException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/Responses$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/Responses$1.class
deleted file mode 100644
index 13c45eb3456..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/Responses$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/Responses.class b/plugins/com.sun.jersey/com/sun/jersey/api/Responses.class
deleted file mode 100644
index 5a6bc035232..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/Responses.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AbstractClientRequestAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AbstractClientRequestAdapter.class
deleted file mode 100644
index 58600b297f1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AbstractClientRequestAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncUniformInterface.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncUniformInterface.class
deleted file mode 100644
index ba910086ece..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncUniformInterface.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$1.class
deleted file mode 100644
index c947c58a9a9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$2.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$2.class
deleted file mode 100644
index 75e85915882..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$Builder.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$Builder.class
deleted file mode 100644
index 2cfe5a94239..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource$Builder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource.class
deleted file mode 100644
index c5b96c22e34..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewResource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewUniformInterface.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewUniformInterface.class
deleted file mode 100644
index aaa12e9231b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncViewUniformInterface.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$1.class
deleted file mode 100644
index c7f150d779a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$2.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$2.class
deleted file mode 100644
index b3082472a70..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$3.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$3.class
deleted file mode 100644
index 4e1ceaef0f5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$4.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$4.class
deleted file mode 100644
index e9f3a2620cc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$5.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$5.class
deleted file mode 100644
index 31db525afec..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$5.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$6.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$6.class
deleted file mode 100644
index a5c6c4492f0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$6.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$Builder.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$Builder.class
deleted file mode 100644
index dd959d972ce..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource$Builder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource.class
deleted file mode 100644
index 5c3e29628ca..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/AsyncWebResource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$1.class
deleted file mode 100644
index b3327ee2844..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$2.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$2.class
deleted file mode 100644
index 173e5895421..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$3.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$3.class
deleted file mode 100644
index 22e92440ecd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4$1.class
deleted file mode 100644
index ebf544f7b5c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4.class
deleted file mode 100644
index 29332b95416..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl$1.class
deleted file mode 100644
index b3d2c99810b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl.class
deleted file mode 100644
index 151c374930c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ComponentProcessorFactoryImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ContextInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ContextInjectableProvider.class
deleted file mode 100644
index fcb8de14410..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client$ContextInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/Client.class
deleted file mode 100644
index 154e9fb8a58..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/Client.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandler.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandler.class
deleted file mode 100644
index a3b061a9832..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandlerException.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandlerException.class
deleted file mode 100644
index 5c57825b0b2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientHandlerException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest$Builder.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest$Builder.class
deleted file mode 100644
index bd0b352b7ca..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest$Builder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest.class
deleted file mode 100644
index 879258dd7dd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequest.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequestAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequestAdapter.class
deleted file mode 100644
index 19fff847a40..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientRequestAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse$Status.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse$Status.class
deleted file mode 100644
index 2b3d103b399..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse$Status.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse.class
deleted file mode 100644
index 05ac3914894..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ClientResponse.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/CommittingOutputStream.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/CommittingOutputStream.class
deleted file mode 100644
index d225437fbc7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/CommittingOutputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ComponentsClientConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ComponentsClientConfig.class
deleted file mode 100644
index 29f9e7b296d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ComponentsClientConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/GenericType.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/GenericType.class
deleted file mode 100644
index 7d044ff4561..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/GenericType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/PartialRequestBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/PartialRequestBuilder.class
deleted file mode 100644
index b07f52ec216..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/PartialRequestBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestBuilder.class
deleted file mode 100644
index d434306b052..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriter.class
deleted file mode 100644
index 6d34c36342c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterImpl.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterImpl.class
deleted file mode 100644
index 803911d6cb5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterListener.class
deleted file mode 100644
index 3c06362148b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter$RequestEntityWriterListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter.class
deleted file mode 100644
index f92d7e860fc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/RequestWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler.class
deleted file mode 100644
index 7323e7f15ce..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/TerminatingClientHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterface.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterface.class
deleted file mode 100644
index b1b32877001..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterface.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterfaceException.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterfaceException.class
deleted file mode 100644
index b5b0f394a8f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/UniformInterfaceException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$1.class
deleted file mode 100644
index e35384ea7c9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$Builder.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$Builder.class
deleted file mode 100644
index 4a3410923af..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource$Builder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource.class
deleted file mode 100644
index e486e8079e7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewResource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewUniformInterface.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewUniformInterface.class
deleted file mode 100644
index 8f5fc486b78..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/ViewUniformInterface.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$1.class
deleted file mode 100644
index 1d7753efddb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$Builder.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$Builder.class
deleted file mode 100644
index d6934668db6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource$Builder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource.class
deleted file mode 100644
index 7d7b29dfee4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResourceLinkHeaders.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResourceLinkHeaders.class
deleted file mode 100644
index fb0d557e447..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/WebResourceLinkHeaders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/AsyncClientHandler.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/async/AsyncClientHandler.class
deleted file mode 100644
index bb7c1c8b789..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/AsyncClientHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/FutureListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/async/FutureListener.class
deleted file mode 100644
index 9d0b7114b53..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/FutureListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/ITypeListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/async/ITypeListener.class
deleted file mode 100644
index f7b637e3dac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/ITypeListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/TypeListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/async/TypeListener.class
deleted file mode 100644
index fb3c0922598..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/async/TypeListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/config/ClientConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/config/ClientConfig.class
deleted file mode 100644
index 6b8c7c9b20a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/config/ClientConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/config/DefaultClientConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/config/DefaultClientConfig.class
deleted file mode 100644
index 1833b81ca9c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/config/DefaultClientConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientFilter.class
deleted file mode 100644
index 227adcfe149..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientRequestContainer.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientRequestContainer.class
deleted file mode 100644
index cc8c4d9ba73..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ClientRequestContainer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter$Adapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter$Adapter.class
deleted file mode 100644
index 32a3b78bcc1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter$Adapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter.class
deleted file mode 100644
index addcfcdbac3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ConnectionListenerFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ContainerListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ContainerListener.class
deleted file mode 100644
index f64d3ee08a8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ContainerListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/Filterable.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/Filterable.class
deleted file mode 100644
index 0d2d37e46cf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/Filterable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter$Adapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter$Adapter.class
deleted file mode 100644
index b568fb69ed7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter$Adapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.class
deleted file mode 100644
index 221ca5175e0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.class
deleted file mode 100644
index d751a0e94cd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPBasicAuthFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$1.class
deleted file mode 100644
index 79388ed9a3e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$QOP.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$QOP.class
deleted file mode 100644
index 974266d7536..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$QOP.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$State.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$State.class
deleted file mode 100644
index a6f0f71974b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter$State.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.class
deleted file mode 100644
index 0bf5c572400..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/HTTPDigestAuthFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$Adapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$Adapter.class
deleted file mode 100644
index 3ae591112cb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$Adapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$LoggingOutputStream.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$LoggingOutputStream.class
deleted file mode 100644
index 80e051194ca..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter$LoggingOutputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter.class
deleted file mode 100644
index e848b8c3628..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/LoggingFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/OnStartConnectionListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/OnStartConnectionListener.class
deleted file mode 100644
index 32b184cfedd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/OnStartConnectionListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingInputStream.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingInputStream.class
deleted file mode 100644
index 0b9cbcb980a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingInputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingOutputStream.class b/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingOutputStream.class
deleted file mode 100644
index b16242c9241..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/client/filter/ReportingOutputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerException.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerException.class
deleted file mode 100644
index c97dbf88d00..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerFactory.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerFactory.class
deleted file mode 100644
index a757d43d7c5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/ContainerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/MappableContainerException.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/MappableContainerException.class
deleted file mode 100644
index 80ca5282431..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/MappableContainerException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter$Adapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter$Adapter.class
deleted file mode 100644
index 0216383e324..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter$Adapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.class
deleted file mode 100644
index 291a123b73f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter$Adapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter$Adapter.class
deleted file mode 100644
index 037ad7f1575..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter$Adapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter.class
deleted file mode 100644
index 05d2630df6a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/LoggingFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/PostReplaceFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/PostReplaceFilter.class
deleted file mode 100644
index 8a60dac63a1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/PostReplaceFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$AbstractRequestFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$AbstractRequestFilter.class
deleted file mode 100644
index 425536d110c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$AbstractRequestFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$ResourceMethodFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$ResourceMethodFilter.class
deleted file mode 100644
index af100ba050a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$ResourceMethodFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceLocatorFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceLocatorFilter.class
deleted file mode 100644
index 969e96e38e5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceLocatorFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceMethodFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceMethodFilter.class
deleted file mode 100644
index 5da21983c0e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory$SubResourceMethodFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.class
deleted file mode 100644
index 8c165b8510a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/ResourceDebuggingFilterFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory$Filter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory$Filter.class
deleted file mode 100644
index 617d47b9ba9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory$Filter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.class
deleted file mode 100644
index 97541bb95b8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/RolesAllowedResourceFilterFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/UriConnegFilter.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/UriConnegFilter.class
deleted file mode 100644
index b443e6e7f7b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/filter/UriConnegFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.class
deleted file mode 100644
index 31a074ab399..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyServerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.class
deleted file mode 100644
index e4f3931ffcc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/grizzly/GrizzlyWebContainerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/container/httpserver/HttpServerFactory.class b/plugins/com.sun.jersey/com/sun/jersey/api/container/httpserver/HttpServerFactory.class
deleted file mode 100644
index 66eae8c6608..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/container/httpserver/HttpServerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ApplicationAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ApplicationAdapter.class
deleted file mode 100644
index b8ff0d12e2f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ApplicationAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ClassNamesResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ClassNamesResourceConfig.class
deleted file mode 100644
index 8bd3775fc14..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ClassNamesResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ClasspathResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ClasspathResourceConfig.class
deleted file mode 100644
index 1be6ccdbb6d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ClasspathResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/DefaultResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/DefaultResourceConfig.class
deleted file mode 100644
index 0ece361af8b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/DefaultResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ExtendedUriInfo.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ExtendedUriInfo.class
deleted file mode 100644
index 5aff22fb370..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ExtendedUriInfo.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpContext.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpContext.class
deleted file mode 100644
index 5ebb827cbb0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpRequestContext.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpRequestContext.class
deleted file mode 100644
index 88535b5cef0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpRequestContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpResponseContext.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpResponseContext.class
deleted file mode 100644
index 8b57ba105e1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/HttpResponseContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/InjectParam.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/InjectParam.class
deleted file mode 100644
index cede80ce36b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/InjectParam.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/PackagesResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/PackagesResourceConfig.class
deleted file mode 100644
index 0a235170a12..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/PackagesResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ParentRef.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ParentRef.class
deleted file mode 100644
index 79d76482115..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ParentRef.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$1.class
deleted file mode 100644
index ce9b40b1105..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$2.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$2.class
deleted file mode 100644
index 0b46ad65c83..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$TypeParser.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$TypeParser.class
deleted file mode 100644
index 7b9880e7f41..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig$TypeParser.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig.class
deleted file mode 100644
index 6b8504ce343..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfigurator.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfigurator.class
deleted file mode 100644
index 879be7c7cd8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceConfigurator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceContext.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceContext.class
deleted file mode 100644
index bbaae3ad742..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ResourceContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/ScanningResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/ScanningResourceConfig.class
deleted file mode 100644
index fe32b740c91..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/ScanningResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$1.class
deleted file mode 100644
index 7f15f5e2370..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$TraceHeaderListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$TraceHeaderListener.class
deleted file mode 100644
index f4615837add..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation$TraceHeaderListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation.class
deleted file mode 100644
index 8771e752bda..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/TraceInformation.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/Traceable.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/Traceable.class
deleted file mode 100644
index 73156ebd0b3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/Traceable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/core/WebAppResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/core/WebAppResourceConfig.class
deleted file mode 100644
index 4daae1e9a84..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/core/WebAppResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfigurated.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfigurated.class
deleted file mode 100644
index a60eb7d4ae2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfigurated.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$1.class
deleted file mode 100644
index 4daaf5c6b0e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Builder.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Builder.class
deleted file mode 100644
index 3fe0d5c6b9e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Builder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedBuilder.class
deleted file mode 100644
index 2644b9e6c2f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedJettisonBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedJettisonBuilder.class
deleted file mode 100644
index bc251a4ce32..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$MappedJettisonBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$NaturalBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$NaturalBuilder.class
deleted file mode 100644
index ed8ed2c8206..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$NaturalBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Notation.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Notation.class
deleted file mode 100644
index 7fe9b664daa..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration$Notation.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration.class
deleted file mode 100644
index f22e6639412..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONConfiguration.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$1.class
deleted file mode 100644
index 1044bf11f42..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$2.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$2.class
deleted file mode 100644
index d7a6d6ac4bb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$JSONNotation.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$JSONNotation.class
deleted file mode 100644
index 39b6a1ebd92..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext$JSONNotation.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext.class
deleted file mode 100644
index 61b8068bc57..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONJAXBContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONMarshaller.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONMarshaller.class
deleted file mode 100644
index 7abd7a7edcc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONMarshaller.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONUnmarshaller.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONUnmarshaller.class
deleted file mode 100644
index 18aa5dc5d07..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONUnmarshaller.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONWithPadding.class b/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONWithPadding.class
deleted file mode 100644
index 4eb57bed9e8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/json/JSONWithPadding.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractField.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractField.class
deleted file mode 100644
index f8d127de547..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractField.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractImplicitViewMethod.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractImplicitViewMethod.class
deleted file mode 100644
index 76daf0ea360..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractImplicitViewMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractMethod.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractMethod.class
deleted file mode 100644
index dce2da123f0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelComponent.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelComponent.class
deleted file mode 100644
index 1fcb5682b01..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelComponent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelVisitor.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelVisitor.class
deleted file mode 100644
index 50edb7f29c3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractModelVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResource.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResource.class
deleted file mode 100644
index 1b1b0215d7a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceConstructor.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceConstructor.class
deleted file mode 100644
index 3c6e0a378e1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceConstructor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceMethod.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceMethod.class
deleted file mode 100644
index beda56b0c00..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelContext.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelContext.class
deleted file mode 100644
index a94a47ec6b9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelListener.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelListener.class
deleted file mode 100644
index 853c5834059..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractResourceModelListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSetterMethod.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSetterMethod.class
deleted file mode 100644
index e7b40f94f15..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSetterMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceLocator.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceLocator.class
deleted file mode 100644
index 1044ed13e5b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceLocator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceMethod.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceMethod.class
deleted file mode 100644
index 7c249fb5929..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/AbstractSubResourceMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter$Source.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter$Source.class
deleted file mode 100644
index 3cb061ff365..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter$Source.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter.class
deleted file mode 100644
index 7df6f0fe24a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameterized.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameterized.class
deleted file mode 100644
index bb31446c51e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/Parameterized.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/PathAnnotated.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/PathAnnotated.class
deleted file mode 100644
index 5f05ab391fb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/PathAnnotated.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/PathValue.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/PathValue.class
deleted file mode 100644
index 0f1b7be3591..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/PathValue.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/model/ResourceModelIssue.class b/plugins/com.sun.jersey/com/sun/jersey/api/model/ResourceModelIssue.class
deleted file mode 100644
index 83f9c2387a5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/model/ResourceModelIssue.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/provider/jaxb/XmlHeader.class b/plugins/com.sun.jersey/com/sun/jersey/api/provider/jaxb/XmlHeader.class
deleted file mode 100644
index 1dacc3afba9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/provider/jaxb/XmlHeader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/representation/Form.class b/plugins/com.sun.jersey/com/sun/jersey/api/representation/Form.class
deleted file mode 100644
index f99d09cbc3f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/representation/Form.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriBuilderImpl.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriBuilderImpl.class
deleted file mode 100644
index debec2f60a0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriBuilderImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$1.class
deleted file mode 100644
index f35618b716e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$PathSegmentImpl.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$PathSegmentImpl.class
deleted file mode 100644
index f98c8207831..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$PathSegmentImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$Type.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$Type.class
deleted file mode 100644
index c63c7355cc8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent$Type.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent.class
deleted file mode 100644
index 01500755b73..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriComponent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$1.class
deleted file mode 100644
index ec3ae09b802..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$EmptyStringMatchResult.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$EmptyStringMatchResult.class
deleted file mode 100644
index f1c18151bc6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$EmptyStringMatchResult.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$GroupIndexMatchResult.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$GroupIndexMatchResult.class
deleted file mode 100644
index b06f5682637..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern$GroupIndexMatchResult.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern.class
deleted file mode 100644
index b3664214bbe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriPattern.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate$1.class
deleted file mode 100644
index ab1eebeaca8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate.class
deleted file mode 100644
index f2e324cb37b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplate.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$CharacterIterator.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$CharacterIterator.class
deleted file mode 100644
index e9b0b99f5c8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$CharacterIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$StringCharacterIterator.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$StringCharacterIterator.class
deleted file mode 100644
index dbfdb8b199e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser$StringCharacterIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser.class b/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser.class
deleted file mode 100644
index 81e9f14228c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/uri/UriTemplateParser.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/view/ImplicitProduces.class b/plugins/com.sun.jersey/com/sun/jersey/api/view/ImplicitProduces.class
deleted file mode 100644
index 376e67d51b8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/view/ImplicitProduces.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/view/Viewable.class b/plugins/com.sun.jersey/com/sun/jersey/api/view/Viewable.class
deleted file mode 100644
index 38b822cbed2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/view/Viewable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask$Loader.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask$Loader.class
deleted file mode 100644
index 6cdf58d2a49..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask$Loader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask.class
deleted file mode 100644
index 163dd2a333d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/WadlGeneratorTask.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder$1.class
deleted file mode 100644
index 10f4a8e9fde..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder.class
deleted file mode 100644
index 27954ef8c8c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigDescriptionBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigDescriptionBuilder.class
deleted file mode 100644
index 14529cfcbec..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigDescriptionBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigGeneratorImpl.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigGeneratorImpl.class
deleted file mode 100644
index 22ae35c4dd3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigGeneratorImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigImpl.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigImpl.class
deleted file mode 100644
index c6678c2fcde..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig$WadlGeneratorConfigImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.class
deleted file mode 100644
index 538a76bcf3b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.class
deleted file mode 100644
index 0e5451ae605..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorConfigLoader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.class
deleted file mode 100644
index f19940edbe0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorDescription.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$1.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$1.class
deleted file mode 100644
index 2f78cf5ff45..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$Callback.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$Callback.class
deleted file mode 100644
index 8bec4fb12a1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$Callback.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$CallbackList.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$CallbackList.class
deleted file mode 100644
index 460eb9d938b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$CallbackList.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$WadlGeneratorControl.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$WadlGeneratorControl.class
deleted file mode 100644
index 8f7828950a6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader$WadlGeneratorControl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.class b/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.class
deleted file mode 100644
index 464419ddaf9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/api/wadl/config/WadlGeneratorLoader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/ImplMessages.class b/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/ImplMessages.class
deleted file mode 100644
index de27588e197..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/ImplMessages.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/impl.properties b/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/impl.properties
deleted file mode 100644
index f0af1a17ce0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/impl.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-error.marshalling.atom=Error marshalling out Atom object of type "{0}".
-error.creating.atom=Error creating Atom object of type "{0}".
-error.not.atom.feed=Feed is Not of type Atom Feed : "{0}".
diff --git a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.class b/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.class
deleted file mode 100644
index 01c2cf9e4cb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomEntryProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.class b/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.class
deleted file mode 100644
index b1218273468..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/atom/rome/impl/provider/entity/AtomFeedProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/impl/ClientRequestImpl.class b/plugins/com.sun.jersey/com/sun/jersey/client/impl/ClientRequestImpl.class
deleted file mode 100644
index 5d22ca7e70d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/impl/ClientRequestImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/impl/CopyOnWriteHashMap.class b/plugins/com.sun.jersey/com/sun/jersey/client/impl/CopyOnWriteHashMap.class
deleted file mode 100644
index 25e9ecee4fc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/impl/CopyOnWriteHashMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener$1.class b/plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener$1.class
deleted file mode 100644
index c18ff51a192..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener.class b/plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener.class
deleted file mode 100644
index ff92a936a0a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/impl/async/FutureClientResponseListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/osgi/Activator.class b/plugins/com.sun.jersey/com/sun/jersey/client/osgi/Activator.class
deleted file mode 100644
index 3764669fdf3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/osgi/Activator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxy.class b/plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxy.class
deleted file mode 100644
index 6419cc7c6f5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxy.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxyProvider.class b/plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxyProvider.class
deleted file mode 100644
index e3af8c9f000..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/proxy/ViewProxyProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HTTPSProperties.class b/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HTTPSProperties.class
deleted file mode 100644
index ce4e433c40e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HTTPSProperties.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.class b/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.class
deleted file mode 100644
index 6d4226a27b8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1$1.class b/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1$1.class
deleted file mode 100644
index 2223deac007..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1.class b/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1.class
deleted file mode 100644
index 5d1810d43af..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$URLConnectionResponse.class b/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$URLConnectionResponse.class
deleted file mode 100644
index 7d02504cf56..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler$URLConnectionResponse.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.class b/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.class
deleted file mode 100644
index eb26be6c530..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableLanguageTag.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableLanguageTag.class
deleted file mode 100644
index e63b5ea0023..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableLanguageTag.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableMediaType.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableMediaType.class
deleted file mode 100644
index 1760ae06640..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableMediaType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableToken.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableToken.class
deleted file mode 100644
index 5015705f366..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/AcceptableToken.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition$ContentDispositionBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition$ContentDispositionBuilder.class
deleted file mode 100644
index 32ab36fb01a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition$ContentDispositionBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition.class
deleted file mode 100644
index b2d0dac00ac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/ContentDisposition.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition$FormDataContentDispositionBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition$FormDataContentDispositionBuilder.class
deleted file mode 100644
index 84aa33f3686..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition$FormDataContentDispositionBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition.class
deleted file mode 100644
index 7d6534f7c49..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/FormDataContentDisposition.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat$1.class
deleted file mode 100644
index 7a1a6af1493..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat.class
deleted file mode 100644
index 3a155cee445..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/HttpDateFormat.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/InBoundHeaders.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/InBoundHeaders.class
deleted file mode 100644
index 842c3acac77..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/InBoundHeaders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/LanguageTag.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/LanguageTag.class
deleted file mode 100644
index 23dd79cbd0a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/LanguageTag.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader$LinkHeaderBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader$LinkHeaderBuilder.class
deleted file mode 100644
index d0b152446c6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader$LinkHeaderBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader.class
deleted file mode 100644
index b2725fa9047..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeaders.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeaders.class
deleted file mode 100644
index 2427d3676b7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/LinkHeaders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/MatchingEntityTag.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/MatchingEntityTag.class
deleted file mode 100644
index 99d673bc6c4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/MatchingEntityTag.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$1.class
deleted file mode 100644
index b75bdca0638..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$2.class
deleted file mode 100644
index 03b32a96572..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$3.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$3.class
deleted file mode 100644
index 7df61c5b32e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$4.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$4.class
deleted file mode 100644
index 356a4ab063a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes.class
deleted file mode 100644
index a32bb01acfd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/MediaTypes.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/OutBoundHeaders.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/OutBoundHeaders.class
deleted file mode 100644
index 134af00f08f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/OutBoundHeaders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/ParameterizedHeader.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/ParameterizedHeader.class
deleted file mode 100644
index 2d4af172a3b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/ParameterizedHeader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/QualityFactor.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/QualityFactor.class
deleted file mode 100644
index 924da501a04..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/QualityFactor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/QualitySourceMediaType.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/QualitySourceMediaType.class
deleted file mode 100644
index 21d36f0f0b8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/QualitySourceMediaType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/Token.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/Token.class
deleted file mode 100644
index 2e6da4d8293..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/Token.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableCookie.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableCookie.class
deleted file mode 100644
index d0a2d683767..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableCookie.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableNewCookie.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableNewCookie.class
deleted file mode 100644
index dba2f2de4c5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser$MutableNewCookie.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser.class
deleted file mode 100644
index 9d1333c9f0a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/CookiesParser.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.class
deleted file mode 100644
index 163bea17d9b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderListAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$1.class
deleted file mode 100644
index 6013e680bed..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$2.class
deleted file mode 100644
index 8dce5fe1833..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$3.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$3.class
deleted file mode 100644
index 9bf3eef143e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$4.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$4.class
deleted file mode 100644
index a681932f6d7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$5.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$5.class
deleted file mode 100644
index 3a74a48e961..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$5.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$6.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$6.class
deleted file mode 100644
index 4415d9f0f3c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$6.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$7.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$7.class
deleted file mode 100644
index dcb0adaaca1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$7.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$8.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$8.class
deleted file mode 100644
index 0a97d4cfe48..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$8.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$9.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$9.class
deleted file mode 100644
index f72d7ae11b6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$9.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$Event.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$Event.class
deleted file mode 100644
index 97fc5478045..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$Event.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$ListElementCreator.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$ListElementCreator.class
deleted file mode 100644
index 81a68f2d99e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader$ListElementCreator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader.class
deleted file mode 100644
index 3a36b517ca1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.class b/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.class
deleted file mode 100644
index 06a8a5bf8bd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/header/reader/HttpHeaderReaderImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.class
deleted file mode 100644
index 6277eb22ead..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/BaseFormProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.class
deleted file mode 100644
index c10282b95e9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ByteArrayProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource$DSByteArrayOutputStream.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource$DSByteArrayOutputStream.class
deleted file mode 100644
index 5df876eddfc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource$DSByteArrayOutputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource.class
deleted file mode 100644
index 1f6180e582d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider$ByteArrayDataSource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.class
deleted file mode 100644
index 7d4d7a9e9eb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DataSourceProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DocumentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DocumentProvider.class
deleted file mode 100644
index 50a7f741868..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/DocumentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.class
deleted file mode 100644
index c682000077a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/EntityHolderReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FileProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FileProvider.class
deleted file mode 100644
index 0bb510d6c71..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FileProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.class
deleted file mode 100644
index e2662263ab4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormMultivaluedMapProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormProvider.class
deleted file mode 100644
index 7067fbc88ff..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/FormProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector$Replacer.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector$Replacer.class
deleted file mode 100644
index cdb72bbc8fe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector$Replacer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector.class
deleted file mode 100644
index 6ea2ddb62c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/Inflector.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.class
deleted file mode 100644
index 05150e904da..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/InputStreamProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.class
deleted file mode 100644
index 9d6e40fc601..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/MimeMultipartProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ReaderProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ReaderProvider.class
deleted file mode 100644
index 1aaf49e6b08..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/ReaderProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.class
deleted file mode 100644
index a0bbcee6994..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/RenderedImageProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$DOMSourceReader.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$DOMSourceReader.class
deleted file mode 100644
index 15d31e29eab..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$DOMSourceReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SAXSourceReader.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SAXSourceReader.class
deleted file mode 100644
index 4bc63e701f2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SAXSourceReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SourceWriter.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SourceWriter.class
deleted file mode 100644
index 6a413f8c13d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$SourceWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$StreamSourceReader.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$StreamSourceReader.class
deleted file mode 100644
index 7d0251a59ae..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider$StreamSourceReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider.class
deleted file mode 100644
index 86490777851..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/SourceProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.class
deleted file mode 100644
index 78cc1affa7b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StreamingOutputProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StringProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StringProvider.class
deleted file mode 100644
index 28967686528..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/StringProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$App.class
deleted file mode 100644
index a11bd8327f7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$General.class
deleted file mode 100644
index 8cd64da91d0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$Text.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$Text.class
deleted file mode 100644
index fbd60f63d08..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider$Text.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.class
deleted file mode 100644
index 9be4105d396..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLJAXBElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$App.class
deleted file mode 100644
index 62d44fa1592..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$General.class
deleted file mode 100644
index 9869a6303e9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$Text.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$Text.class
deleted file mode 100644
index a27885b9f6e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider$Text.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.class
deleted file mode 100644
index d8775f09b5e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLListElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$App.class
deleted file mode 100644
index 45660f7e480..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$General.class
deleted file mode 100644
index 266d2cb010a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$Text.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$Text.class
deleted file mode 100644
index 5f11bb01fe4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider$Text.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.class
deleted file mode 100644
index 6d7f4bad722..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$App.class
deleted file mode 100644
index 7afc31d864a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$General.class
deleted file mode 100644
index e637c7e230c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$Text.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$Text.class
deleted file mode 100644
index ca55f8bee0c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider$Text.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.class
deleted file mode 100644
index 787db96cf37..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/entity/XMLRootObjectProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CacheControlProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CacheControlProvider.class
deleted file mode 100644
index 3c43a2bd87a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CacheControlProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CookieProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CookieProvider.class
deleted file mode 100644
index 5dc0628c74b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/CookieProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/DateProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/DateProvider.class
deleted file mode 100644
index fa160432a79..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/DateProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/EntityTagProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/EntityTagProvider.class
deleted file mode 100644
index 55954a549e8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/EntityTagProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.class
deleted file mode 100644
index 3fd4b9e8e2e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LinkHeaderProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LocaleProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LocaleProvider.class
deleted file mode 100644
index 504fb6601b0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/LocaleProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.class
deleted file mode 100644
index 1205edbf076..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/MediaTypeProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/NewCookieProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/NewCookieProvider.class
deleted file mode 100644
index f7869733527..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/NewCookieProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/StringProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/StringProvider.class
deleted file mode 100644
index 375396b3416..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/StringProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/URIProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/URIProvider.class
deleted file mode 100644
index b01a8b026fc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/URIProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/WriterUtil.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/WriterUtil.class
deleted file mode 100644
index 0bec648557a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/header/WriterUtil.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.class
deleted file mode 100644
index 6555d9832a4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/DocumentBuilderFactoryProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider$1.class
deleted file mode 100644
index 113997ee8f1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.class
deleted file mode 100644
index f7ec7374e3b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/LazySingletonContextProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.class
deleted file mode 100644
index 6eece6481f0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/SAXParserContextProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$1.class
deleted file mode 100644
index 187f61adf57..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$2.class
deleted file mode 100644
index 056a455e80e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.class
deleted file mode 100644
index 168f6b706a2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/ThreadLocalSingletonContextProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.class
deleted file mode 100644
index f217f744a6c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/TransformerFactoryProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.class
deleted file mode 100644
index 18da992cdd5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/impl/provider/xml/XMLStreamReaderContextProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$1.class
deleted file mode 100644
index 803157be6ee..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$2.class
deleted file mode 100644
index 5635c91eb1f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$BundleFactoryLoader.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$BundleFactoryLoader.class
deleted file mode 100644
index 034120b37c9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$BundleFactoryLoader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$1.class
deleted file mode 100644
index a61b1d312d4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$2.class
deleted file mode 100644
index a807609024f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder.class
deleted file mode 100644
index 4b46a119969..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator$OsgiServiceFinder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator.class
deleted file mode 100644
index afb612d465e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/Activator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/OsgiLocator.class b/plugins/com.sun.jersey/com/sun/jersey/core/osgi/OsgiLocator.class
deleted file mode 100644
index 47d5984084a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/osgi/OsgiLocator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.class
deleted file mode 100644
index e2aa7a34064..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/provider/AbstractMessageReaderWriterProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/provider/CompletableReader.class b/plugins/com.sun.jersey/com/sun/jersey/core/provider/CompletableReader.class
deleted file mode 100644
index 7f5bc2a1028..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/provider/CompletableReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/provider/EntityHolder.class b/plugins/com.sun.jersey/com/sun/jersey/core/provider/EntityHolder.class
deleted file mode 100644
index 9821ce55fbb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/provider/EntityHolder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.class
deleted file mode 100644
index 1ba6a3af844..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.class
deleted file mode 100644
index 6ef63409d9d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractJAXBProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.class
deleted file mode 100644
index 101ada5a208..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractListElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.class
deleted file mode 100644
index d6350e22902..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/provider/jaxb/AbstractRootElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/AnnotatedMethod.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/AnnotatedMethod.class
deleted file mode 100644
index 813d06387fb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/AnnotatedMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$1.class
deleted file mode 100644
index 0d6a6064421..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$2.class
deleted file mode 100644
index 142d0016a68..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$3.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$3.class
deleted file mode 100644
index 74bc6456b77..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$4.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$4.class
deleted file mode 100644
index 1ff70b879ac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$5.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$5.class
deleted file mode 100644
index 7fd1c41203d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$5.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$6.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$6.class
deleted file mode 100644
index 90dae63277a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$6.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$7.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$7.class
deleted file mode 100644
index 308e27bbb4b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$7.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$8.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$8.class
deleted file mode 100644
index 31dcf3ea36c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$8.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$Filter.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$Filter.class
deleted file mode 100644
index 037d03e8040..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList$Filter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList.class
deleted file mode 100644
index 5d190a1e21a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/MethodList.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$1.class
deleted file mode 100644
index 0ceea9e896d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$2.class
deleted file mode 100644
index d6908782103..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$ClassTypePair.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$ClassTypePair.class
deleted file mode 100644
index 147302e37ba..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$ClassTypePair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$DeclaringClassInterfacePair.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$DeclaringClassInterfacePair.class
deleted file mode 100644
index 98fd042b923..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$DeclaringClassInterfacePair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$TypeClassPair.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$TypeClassPair.class
deleted file mode 100644
index 22359c011c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper$TypeClassPair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper.class b/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper.class
deleted file mode 100644
index 21e9cc74627..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/reflection/ReflectionHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/AnnotatedContext.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/AnnotatedContext.class
deleted file mode 100644
index b6fb48f86b1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/AnnotatedContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$1.class
deleted file mode 100644
index a8533c0e36c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorComparator.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorComparator.class
deleted file mode 100644
index 221b8942cd7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorComparator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorInjectablePair.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorInjectablePair.class
deleted file mode 100644
index 1648796c72b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor$ConstructorInjectablePair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor.class
deleted file mode 100644
index bd3937ea176..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentConstructor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentContext.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentContext.class
deleted file mode 100644
index 217c933dce8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentDestructor.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentDestructor.class
deleted file mode 100644
index 501963901b8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentDestructor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector$1.class
deleted file mode 100644
index 2435af35b64..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector.class
deleted file mode 100644
index 421094e8936..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentInjector.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProvider.class
deleted file mode 100644
index 0d8c5dd386f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProviderFactory.class
deleted file mode 100644
index 326514a0752..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentScope.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentScope.class
deleted file mode 100644
index b4239c7d9ae..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ComponentScope.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$Destroyable.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$Destroyable.class
deleted file mode 100644
index 38f4371008b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$Destroyable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$SingletonComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$SingletonComponentProvider.class
deleted file mode 100644
index 8cab7b7f352..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory$SingletonComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory.class
deleted file mode 100644
index 01dae0ecc14..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderClass.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderClass.class
deleted file mode 100644
index b68722e9c73..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderClass.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderListener.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderListener.class
deleted file mode 100644
index ba4c39a80fd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices$ProviderListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices.class
deleted file mode 100644
index 637957100a6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ProviderServices.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.class
deleted file mode 100644
index 72caff57f0f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.class
deleted file mode 100644
index d4877440074..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.class
deleted file mode 100644
index cec2a334f02..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProcessorFactoryInitializer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.class
deleted file mode 100644
index e75f214b060..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.class
deleted file mode 100644
index bf27b4a39ff..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCComponentProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.class
deleted file mode 100644
index 2f67924f1de..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCDestroyable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.class
deleted file mode 100644
index b2831b341da..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCFullyManagedComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.class
deleted file mode 100644
index ca566343876..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCInstantiatedComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.class
deleted file mode 100644
index 950a7e0e4d8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCManagedComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$FullyManagedSingleton.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$FullyManagedSingleton.class
deleted file mode 100644
index d7625cacd64..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$FullyManagedSingleton.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$InstantiatedSingleton.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$InstantiatedSingleton.class
deleted file mode 100644
index 40462fb9261..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$InstantiatedSingleton.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ManagedSingleton.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ManagedSingleton.class
deleted file mode 100644
index 42533c7c9ae..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ManagedSingleton.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ProxiedSingletonWrapper.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ProxiedSingletonWrapper.class
deleted file mode 100644
index 0b4fb1bc0ad..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory$ProxiedSingletonWrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.class
deleted file mode 100644
index f0d83a9355d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.class
deleted file mode 100644
index 314f335a901..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/component/ioc/IoCProxiedComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.class
deleted file mode 100644
index 7dc36dff82c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/AbstractRuntimeDelegate.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$1.class
deleted file mode 100644
index b350eff0815..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$2.class
deleted file mode 100644
index e1d446cf072..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1.class
deleted file mode 100644
index 51d76996e3e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$ContextResolverAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$ContextResolverAdapter.class
deleted file mode 100644
index 1fe18ee38ce..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$ContextResolverAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$NullContextResolverAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$NullContextResolverAdapter.class
deleted file mode 100644
index 0b7075cd68f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory$NullContextResolverAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory.class
deleted file mode 100644
index c97a2753d05..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ContextResolverFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$1.class
deleted file mode 100644
index 0e6a5ea45f3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$2.class
deleted file mode 100644
index 53d444b88c1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$MetaInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$MetaInjectableProvider.class
deleted file mode 100644
index 731597e5d1a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory$MetaInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory.class
deleted file mode 100644
index d0874008c12..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/InjectableProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$1.class
deleted file mode 100644
index ff633f0776c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$2.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$2.class
deleted file mode 100644
index 9c39d7fc51a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$DistanceComparator.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$DistanceComparator.class
deleted file mode 100644
index 21e5e0b33a7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$DistanceComparator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$MessageBodyWriterPair.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$MessageBodyWriterPair.class
deleted file mode 100644
index a3ba66be669..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory$MessageBodyWriterPair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory.class
deleted file mode 100644
index a0d6494158e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/MessageBodyFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.class
deleted file mode 100644
index 62a5eba3846..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderHeaders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.class
deleted file mode 100644
index bfce57b01a9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseBuilderImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl$1.class
deleted file mode 100644
index 3fd7259fc61..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl.class
deleted file mode 100644
index b708d674d14..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/ResponseImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.class
deleted file mode 100644
index eb033e6a863..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/factory/VariantListBuilderImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner$1.class
deleted file mode 100644
index 5a30c83e55a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner.class
deleted file mode 100644
index 98e79dd14ca..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/FilesScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner$1.class
deleted file mode 100644
index 4d22178b7e1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner.class
deleted file mode 100644
index 12b9a5298ff..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/JarFileScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider$1.class
deleted file mode 100644
index 27ea2288d11..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider.class
deleted file mode 100644
index faefdc130f4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner$ResourcesProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner.class
deleted file mode 100644
index 4ef58597376..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/PackageNamesScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/Scanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/Scanner.class
deleted file mode 100644
index f79998cee94..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/Scanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerException.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerException.class
deleted file mode 100644
index 4b3f8fdf80d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerListener.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerListener.class
deleted file mode 100644
index f0468de32f8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/ScannerListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner$1.class
deleted file mode 100644
index b4eb37f866c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.class
deleted file mode 100644
index a0f39d8a44f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/BundleSchemeScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner$1.class
deleted file mode 100644
index 3ca1f13e3fe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.class
deleted file mode 100644
index 29b07645a33..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/FileSchemeScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner$1.class
deleted file mode 100644
index 01c78099af6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.class
deleted file mode 100644
index 8a9068a81c5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/JarZipSchemeScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.class
deleted file mode 100644
index d22a9d8925c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/UriSchemeScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1$1.class
deleted file mode 100644
index 82395e9a014..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1.class
deleted file mode 100644
index 67a8d7b5f42..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.class b/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.class
deleted file mode 100644
index 6cb204db167..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/spi/scanning/uri/VfsSchemeScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/Base64.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/Base64.class
deleted file mode 100644
index 33054bbb2dc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/Base64.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/Closing$Closure.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/Closing$Closure.class
deleted file mode 100644
index e9e41f9c0cc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/Closing$Closure.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/Closing.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/Closing.class
deleted file mode 100644
index 2e629a3cd2c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/Closing.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/FeaturesAndProperties.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/FeaturesAndProperties.class
deleted file mode 100644
index 0a902d2a69e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/FeaturesAndProperties.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparator.class
deleted file mode 100644
index 0899be21498..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$1.class
deleted file mode 100644
index 3ba7e94d1da..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$Entry.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$Entry.class
deleted file mode 100644
index 93631d1c5bf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$Entry.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntryIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntryIterator.class
deleted file mode 100644
index 8496291c5dc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntryIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntrySet.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntrySet.class
deleted file mode 100644
index e86b596153a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$EntrySet.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$HashIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$HashIterator.class
deleted file mode 100644
index a159f74ef12..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$HashIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$KeyIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$KeyIterator.class
deleted file mode 100644
index ad9e114cd57..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$KeyIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$ValueIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$ValueIterator.class
deleted file mode 100644
index 98458a438a8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap$ValueIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap.class
deleted file mode 100644
index 972babaaa32..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorHashMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$1.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$1.class
deleted file mode 100644
index 692b1bbcd96..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$Entry.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$Entry.class
deleted file mode 100644
index 38218f3ac05..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$Entry.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$EntryIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$EntryIterator.class
deleted file mode 100644
index 087c1483947..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$EntryIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$KeyIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$KeyIterator.class
deleted file mode 100644
index a331ec21f3f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$KeyIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$LinkedHashIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$LinkedHashIterator.class
deleted file mode 100644
index 39b4c96df1b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$LinkedHashIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$ValueIterator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$ValueIterator.class
deleted file mode 100644
index cf663b6a1ca..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap$ValueIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.class
deleted file mode 100644
index 25a0a5a55d0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/KeyComparatorLinkedHashMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/LazyVal.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/LazyVal.class
deleted file mode 100644
index 97e3bdb4c12..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/LazyVal.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/MultivaluedMapImpl.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/MultivaluedMapImpl.class
deleted file mode 100644
index a5941d3e6cf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/MultivaluedMapImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/ReaderWriter.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/ReaderWriter.class
deleted file mode 100644
index 0e452fb408d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/ReaderWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.class
deleted file mode 100644
index 5d4ffd38d46..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringIgnoreCaseKeyComparator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.class
deleted file mode 100644
index e37db9c2081..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyIgnoreCaseMultivaluedMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.class
deleted file mode 100644
index e48e8c8cf4c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyObjectValueIgnoreCaseMultivaluedMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.class
deleted file mode 100644
index 14fb6dff037..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/StringKeyStringValueIgnoreCaseMultivaluedMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/ThrowHelper.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/ThrowHelper.class
deleted file mode 100644
index f1c4bca81f3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/ThrowHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.class b/plugins/com.sun.jersey/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.class
deleted file mode 100644
index cdf7ec05dbe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/core/util/UnmodifiableMultivaluedMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.class
deleted file mode 100644
index 0760505cbd7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetJAXBElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.class
deleted file mode 100644
index bb180964b80..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetListElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.class
deleted file mode 100644
index 318f6c74129..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/fastinfoset/impl/provider/entity/FastInfosetRootElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/impl/ApiMessages.class b/plugins/com.sun.jersey/com/sun/jersey/impl/ApiMessages.class
deleted file mode 100644
index 0ac91f101a8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/impl/ApiMessages.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/impl/ImplMessages.class b/plugins/com.sun.jersey/com/sun/jersey/impl/ImplMessages.class
deleted file mode 100644
index 929247d2f50..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/impl/ImplMessages.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/impl/SpiMessages.class b/plugins/com.sun.jersey/com/sun/jersey/impl/SpiMessages.class
deleted file mode 100644
index 54675b5effa..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/impl/SpiMessages.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/impl/api.properties b/plugins/com.sun.jersey/com/sun/jersey/impl/api.properties
deleted file mode 100644
index db08112d0a9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/impl/api.properties
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-#
-# Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved.
-#
-# The contents of this file are subject to the terms of either the GNU
-# General Public License Version 2 only ("GPL") or the Common Development
-# and Distribution License("CDDL") (collectively, the "License"). You
-# may not use this file except in compliance with the License. You can
-# obtain a copy of the License at
-# http://glassfish.java.net/public/CDDL+GPL_1_1.html
-# or packager/legal/LICENSE.txt. See the License for the specific
-# language governing permissions and limitations under the License.
-#
-# When distributing the software, include this License Header Notice in each
-# file and include the License file at packager/legal/LICENSE.txt.
-#
-# GPL Classpath Exception:
-# Oracle designates this particular file as subject to the "Classpath"
-# exception as provided by Oracle in the GPL Version 2 section of the License
-# file that accompanied this code.
-#
-# Modifications:
-# If applicable, add the following below the License Header, with the fields
-# enclosed by brackets [] replaced by your own identifying information:
-# "Portions Copyright [year] [name of copyright owner]"
-#
-# Contributor(s):
-# If you wish your version of this file to be governed by only the CDDL or
-# only the GPL Version 2, indicate your decision by adding "[Contributor]
-# elects to include this software in this distribution under the [CDDL or GPL
-# Version 2] license." If you don't indicate a single choice of license, a
-# recipient has the option to distribute your version of this file under
-# either the CDDL, the GPL Version 2 or to extend the choice of license to
-# its licensees as provided above. However, if you add GPL Version 2 code
-# and therefore, elected the GPL Version 2 license, then the option applies
-# only if the new code is made subject to such option by the copyright
-# holder.
-#
-
diff --git a/plugins/com.sun.jersey/com/sun/jersey/impl/impl.properties b/plugins/com.sun.jersey/com/sun/jersey/impl/impl.properties
deleted file mode 100644
index 2ecf85a841a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/impl/impl.properties
+++ /dev/null
@@ -1,63 +0,0 @@
-error.marshalling.jaxb=Error marshalling JAXB object of type "{0}".
-error.unmarshalling.jaxb=Error unmarshalling JAXB object of type "{0}".
-unable.to.write.mimemultipart=Unable to write MimeMultipart content.
-resource.method=Resource, {0}, with method, {1}
-resource.not.acceptable={0}, is returning a MIME type, "{1}", that is not acceptable.
-resource.mimetype.not.in.produceMime={0}, is returning a MIME type, "{1}", that is acceptable but not a member of @ProduceMime, {2}.
-nested.error=NESTED ERROR: {0}.
-failed.to.create.web.resource=Failed to create Web resource: {0}.
-default.could.not.process.method=Default value, {0} could not be processed by method {1}.
-default.could.not.process.constructor=Default value, {0} could not be processed by constructor {1}.
-exception.invoking.resource.method=Exception invoking Web resource method.
-illegal.initial.capacity=Illegal initial capacity: {0}.
-illegal.load.factor=Illegal load factor: {0}.
-error.processing.method=Error processing resource method, {0}, for ResourceMethodDispatchProvider, {1}.
-generic.type.not.supported=Generic type, {0}, not support for parameter {1}.
-not.valid.httpmethod=Method, {0}, annotated with {1} of resource, {2}, is not recognized as valid resource method.
-not.valid.dynamicresolvingmethod=Method, {0}, annotated with URI template {1} of resource, {2}, is not recognized as valid Java method annotated with @Path.
-quality.more.than.three=Quality value "{0}" has more than 3 digits after the decimal point.
-quality.greater.than.one=Quality value "{0}" is greater than 1.
-object.not.a.webResource=Object, "{0}": is not a Web resource since it is not annotated with @Path.
-bad.uritemplate=Web resource, "{0}": URI template "{1}" of @Path could not be processed on Web resource.
-bad.class.consumemime=Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on Web resource.
-bad.class.producemime=Web resource, "{0}": MIME types "{1}" of @ProcudeMime could not be processed on Web resource.
-bad.method.httpmethod=Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource.
-bad.consumemime=Web resource, "{0}": HTTP method "{1}" of @HttpMethod could not be processed on method "{2}" of Web Resource.
-bad.method.consumemime=Web resource, "{0}": MIME types "{1}" of @ConsumeMime could not be processed on method "{2} of Web Resource.
-bad.method.producemime=Web resource, "{0}": MIME types "{1}" of @ProduceMime could not be processed on method "{2} of Web Resource.
-illegal.config.syntax=Illegal configuration-file syntax.
-illegal.provider.class.name=Illegal provider-class name: {0}.
-provider.not.found=Provider {0} not found.
-provider.could.not.be.created=Provider {0} could not be instantiated: {1}
-no.webresourceclass.in.webxml=No "webresourceclass" specified in web.xml.
-byte.array.cannot.be.null=data parameter, of type byte[], cannot be null.
-bad.content.type=The HTTP header field "Content-Type" with value "{0}" could not be parsed.
-bad.mime.type=The MIME type of the representation with value "{0}" could not be parsed.
-bad.accept.field=The HTTP header field "Accept" with value "{0}" could not be parsed.
-error.no.sub.res.method.locator.found=A resource class, {0}, does not have any resource method, sub-resource method, or sub-resource locator.
-error.res.uri.path.required=A root resource class, {0}, MUST have a URI path.
-error.res.uri.path.invalid=A root resource class, {0}, has an invalid URI path: {1}.
-error.subres.loc.uri.path.invalid=A sub-resource locator, {0}, has an invalid URI path: {1}
-error.subres.loc.has.entity.param=A sub-resource locator, {0}, can not have an entity parameter. Try to move the parameter to the corresponding resource method.
-error.subres.method.uri.path.invalid=A sub-resource method, {0}, has an invalid URI path: {1}
-error.get.returns.void=A HTTP GET method, {0}, MUST return a non-void type.
-error.get.consumes.entity=A HTTP GET method, {0}, should not consume any entity.
-error.subres.loc.returns.void=A sub-resource locator, {0}, MUST return a non-void type.
-new.ar.created.by.introspection.modeler=A new abstract resource created by IntrospectionModeler: {0}
-ambiguous.parameter=Parameter {1} of {0} MUST be only one of a path, query, matrix or header parameter.
-non.pub.res.method=A resource method, {0}, MUST be public scoped otherwise the method is ignored
-non.pub.sub.res.method=A sub-resource method, {0}, MUST be public scoped otherwise the method is ignored
-non.pub.sub.res.loc=A sub-resource locator, {0}, MUST be public scoped otherwise the method is ignored
-fatal.issues.found.at.res.class=Fatal issues found at class {0}. See logs for more details.
-web.app.already.initiated=Web application is already initiated.
-no.root.res.in.res.cfg=The ResourceConfig instance does not contain any root resource classes.
-root.res.no.public.ctor=A root resource, {0}, MUST have a public constructor
-ambiguous.ctors=A root resource, {0}, has ambiguous constructors to use for initialization
-ambiguous.srls=A resource, {0}, has ambiguous sub-resource locator for URI template {1}, which matches with template {2}
-ambiguous.rms.in=A resource, {0}, has ambiguous resource method for HTTP method {1} and input mime-type: {2}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {3} and {4}) are {5} and {6}. This could cause an error for conflicting output types!
-ambiguous.rms.out=A resource, {0}, has ambiguous resource method for HTTP method {1} and output mime-type: {2}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {3} and {4}) are {5} and {6}
-ambiguous.srms.in=A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and input mime-type: {3}. The problematic mime-type sets (as defined by @Consumes annotation at Java methods {4} and {5}) are {6} and {7}. This could cause an error for conflicting output types!
-ambiguous.srms.out=A resource, {0}, has ambiguous sub-resource method for HTTP method {1}, URI path template {2}, and output mime-type: {3}. The problematic mime-type sets (as defined by @Produces annotation at Java methods {4} and {5}) are {6} and {7}
-multiple.http.method.designators=A (sub-)resource method, {0}, should have only one HTTP method designator. It currently has the following designators defined: {1}
-ambiguous.rr.path=A root resource, {0}, has a non-unique URI template {1}
-sub.res.method.treated.as.res.method=A sub-resource method, {0}, with URI template, "{1}", is treated as a resource method \ No newline at end of file
diff --git a/plugins/com.sun.jersey/com/sun/jersey/impl/spi.properties b/plugins/com.sun.jersey/com/sun/jersey/impl/spi.properties
deleted file mode 100644
index f604f53b436..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/impl/spi.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-uritemplate.cannot.be.null=URI template cannot be null.
-template.name.to.value.not.null=Template name to value map cannot be null.
-illegal.config.syntax=Illegal configuration-file syntax.
-illegal.provider.class.name=Illegal provider-class name: {0}.
-provider.could.not.be.created=The class {0} implementing provider {1} could not be instantiated: {2}
-provider.class.could.not.be.loaded=The class {0} implementing provider {1} could not be loaded: {2}
-provider.not.found=The class {0} implementing the provider {1} is not found. The provider implementation is ignored.
-dependent.class.of.provider.not.found=A dependent class, {0}, of the class {1} implementing the provider {2} is not found. The provider implementation is ignored.
-dependent.class.of.provider.format.error={0}. A dependent class of the class {1} implementing the provider {2} is malformed. The provider implementation is ignored. Check if the malformed class is part of a stubbed jar that used for compiling only. \ No newline at end of file
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONMarshaller.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONMarshaller.class
deleted file mode 100644
index 1efd624c64a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONMarshaller.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONUnmarshaller.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONUnmarshaller.class
deleted file mode 100644
index d18549b0462..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/BaseJSONUnmarshaller.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/BufferingInputOutputStream.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/BufferingInputOutputStream.class
deleted file mode 100644
index 4fedf2a77a1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/BufferingInputOutputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/FilteringInputStream.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/FilteringInputStream.class
deleted file mode 100644
index c6c8a86d603..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/FilteringInputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/ImplMessages.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/ImplMessages.class
deleted file mode 100644
index 6609205ff0c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/ImplMessages.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONHelper.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONHelper.class
deleted file mode 100644
index 03881699f68..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONMarshallerImpl.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONMarshallerImpl.class
deleted file mode 100644
index e0ad6b30d18..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONMarshallerImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONTransformer.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONTransformer.class
deleted file mode 100644
index f6b9cca259f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONTransformer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONUnmarshallerImpl.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONUnmarshallerImpl.class
deleted file mode 100644
index 731900c80f4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JSONUnmarshallerImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.class
deleted file mode 100644
index c9bc326c8af..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/JsonRootEatingInputStreamFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/NameUtil.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/NameUtil.class
deleted file mode 100644
index cb55cf89e21..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/NameUtil.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/RootElementWrapper.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/RootElementWrapper.class
deleted file mode 100644
index a472816dc60..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/RootElementWrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory$1.class
deleted file mode 100644
index ce4c0c7558f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory.class
deleted file mode 100644
index a9cfb6e799f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/Stax2JsonFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/impl.properties b/plugins/com.sun.jersey/com/sun/jersey/json/impl/impl.properties
deleted file mode 100644
index 68ec9f3a495..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/impl.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-error.parsing.json.object=Error parsing JSON object.
-error.parsing.json.array=Error parsing JSON array.
-error.writing.json.object=Error writing JSON object.
-error.writing.json.array=Error writing JSON array.
-error.nonge.jsonp.msg.body.writer.not.found=A message body writer for Java type, {0}, and MIME media type, {1}, was not found. If you want to serialize a parametrized type, you might want to use GenericEntity
-error.jsonp.msg.body.writer.not.found=A message body writer for Java type, {0}, and MIME media type, {1}, was not found.
-error.jaxb.ri.2.1.10.missing=NATURAL JSON notation configured, but JAXB RI 2.1.10 not found. For the recent builds to get this working correctly, you need even at least JAXB version 2.1.12. Please add it to your classpath!
-error.jaxb.ri.2.1.12.missing=NATURAL JSON notation configured, but at least JAXB RI 2.1.12 is needed when XML attributes are in use. Please add jaxb-impl-2.1.12 to your classpath! \ No newline at end of file
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$App.class
deleted file mode 100644
index 8de3a5f48e6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$General.class
deleted file mode 100644
index 6306cf177e3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.class
deleted file mode 100644
index 8227a289b5c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONArrayProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$App.class
deleted file mode 100644
index 7dd73b75a69..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$General.class
deleted file mode 100644
index 31395e39829..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.class
deleted file mode 100644
index 1135d9e9f7d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONJAXBElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$App.class
deleted file mode 100644
index f7c6e0350d0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$General.class
deleted file mode 100644
index ed14892e45e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.class
deleted file mode 100644
index f0d540059f6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONListElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.class
deleted file mode 100644
index e407136b4fe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONLowLevelProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$App.class
deleted file mode 100644
index 60f8e17af81..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$General.class
deleted file mode 100644
index 10c65271b81..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.class
deleted file mode 100644
index 26754de925c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONObjectProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$App.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$App.class
deleted file mode 100644
index ef0d0b8de36..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$App.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$General.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$General.class
deleted file mode 100644
index a64a9e11a27..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider$General.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.class
deleted file mode 100644
index aa55f52fcdd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONRootElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.class
deleted file mode 100644
index 2f4ab76f519..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JSONWithPaddingProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$1.class
deleted file mode 100644
index 0e94cfd65c9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext$1.class
deleted file mode 100644
index 4cfb2600d3b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext.class
deleted file mode 100644
index 6338490ddcb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy$ProvidersInjectableProviderContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.class
deleted file mode 100644
index ff99e1381c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/provider/entity/JacksonProviderProxy.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/CharactersEvent.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/CharactersEvent.class
deleted file mode 100644
index e79ee17a239..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/CharactersEvent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndDocumentEvent.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndDocumentEvent.class
deleted file mode 100644
index 42a7b4035cc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndDocumentEvent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndElementEvent.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndElementEvent.class
deleted file mode 100644
index 810f85c180a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/EndElementEvent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$1.class
deleted file mode 100644
index 0c747ba121e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$2.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$2.class
deleted file mode 100644
index d10e85b4a57..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$ProcessingInfo.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$ProcessingInfo.class
deleted file mode 100644
index 139ce7944db..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader$ProcessingInfo.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader.class
deleted file mode 100644
index 2366dc952d0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/Jackson2StaxReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$1.class
deleted file mode 100644
index 58890350562..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$State.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$State.class
deleted file mode 100644
index 7d53857807f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser$State.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.class
deleted file mode 100644
index 0e3afa3aff7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JacksonRootAddingParser.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonLexer.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonLexer.class
deleted file mode 100644
index d26847ecc50..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonLexer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonNamespaceContext.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonNamespaceContext.class
deleted file mode 100644
index c8cd62fd5f5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonNamespaceContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent$Attribute.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent$Attribute.class
deleted file mode 100644
index eff77168350..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent$Attribute.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.class
deleted file mode 100644
index 5d02753f023..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonReaderXmlEvent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonToken.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonToken.class
deleted file mode 100644
index b69b340421c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonToken.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$1.class
deleted file mode 100644
index 721f5223e08..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$2.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$2.class
deleted file mode 100644
index c3db4740f58..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$LaState.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$LaState.class
deleted file mode 100644
index c737e77ae2f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$LaState.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$ProcessingState.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$ProcessingState.class
deleted file mode 100644
index 2f4d96972f5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader$ProcessingState.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.class
deleted file mode 100644
index e2fa80fe4a4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/JsonXmlStreamReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartDocumentEvent.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartDocumentEvent.class
deleted file mode 100644
index 54ce80d843b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartDocumentEvent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartElementEvent.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartElementEvent.class
deleted file mode 100644
index d320b4ff5ec..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StartElementEvent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StaxLocation.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StaxLocation.class
deleted file mode 100644
index 3bfec1f4588..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/reader/StaxLocation.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy$XmlAttribute.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy$XmlAttribute.class
deleted file mode 100644
index f0a9d82acc1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy$XmlAttribute.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.class
deleted file mode 100644
index 831fc0fc88c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/A2EXmlStreamWriterProxy.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$1.class
deleted file mode 100644
index 34b6761d088..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$State.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$State.class
deleted file mode 100644
index f69e3c05f32..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator$State.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.class
deleted file mode 100644
index eab32f963ed..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonArrayWrapperGenerator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.class
deleted file mode 100644
index b76cb5813c3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonRootStrippingGenerator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.class
deleted file mode 100644
index 954ddd888e1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JacksonStringMergingGenerator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonEncoder.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonEncoder.class
deleted file mode 100644
index b2018d9120c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonEncoder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$DummyWriterAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$DummyWriterAdapter.class
deleted file mode 100644
index f64d920fbff..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$DummyWriterAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$ProcessingState.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$ProcessingState.class
deleted file mode 100644
index e8d152047e6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$ProcessingState.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$StringWriterAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$StringWriterAdapter.class
deleted file mode 100644
index 87d3fdda380..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$StringWriterAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$WriterAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$WriterAdapter.class
deleted file mode 100644
index e69695a7c56..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter$WriterAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.class
deleted file mode 100644
index 4a805ce38f3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/JsonXmlStreamWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$1.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$1.class
deleted file mode 100644
index 874aa12a59d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$2.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$2.class
deleted file mode 100644
index 21c5def1ea0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$3.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$3.class
deleted file mode 100644
index 4d88093a72f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$4.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$4.class
deleted file mode 100644
index 2ea7bff87e5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$ProcessingInfo.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$ProcessingInfo.class
deleted file mode 100644
index 4b369ddd5fd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter$ProcessingInfo.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.class b/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.class
deleted file mode 100644
index bb7815fa921..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/json/impl/writer/Stax2JacksonWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/localization/Localizable.class b/plugins/com.sun.jersey/com/sun/jersey/localization/Localizable.class
deleted file mode 100644
index bc20d1a061c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/localization/Localizable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessage.class b/plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessage.class
deleted file mode 100644
index 8b3b5e9498c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessage.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessageFactory.class b/plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessageFactory.class
deleted file mode 100644
index 68c49f2bb5e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/localization/LocalizableMessageFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/localization/Localizer.class b/plugins/com.sun.jersey/com/sun/jersey/localization/Localizer.class
deleted file mode 100644
index 5354c87100e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/localization/Localizer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPart.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPart.class
deleted file mode 100644
index 7b60e27295a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartEntity.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartEntity.class
deleted file mode 100644
index 6256d34bce6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartEntity.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartsList.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartsList.class
deleted file mode 100644
index 8c1f2b513fe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/BodyPartsList.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/Boundary.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/Boundary.class
deleted file mode 100644
index 1a2c176d733..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/Boundary.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataBodyPart.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataBodyPart.class
deleted file mode 100644
index 14cbb98e428..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataBodyPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataMultiPart.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataMultiPart.class
deleted file mode 100644
index 13583206fdd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataMultiPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataParam.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataParam.class
deleted file mode 100644
index e62381f0c65..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/FormDataParam.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/HeadersMap.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/HeadersMap.class
deleted file mode 100644
index b6d5ea87aab..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/HeadersMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPart.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPart.class
deleted file mode 100644
index d76c777dff0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartConfig.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartConfig.class
deleted file mode 100644
index c27a853d992..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartMediaTypes.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartMediaTypes.class
deleted file mode 100644
index 0a339d1bd09..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/MultiPartMediaTypes.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/ParameterizedHeadersMap.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/ParameterizedHeadersMap.class
deleted file mode 100644
index e5ccd740471..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/ParameterizedHeadersMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor$CommonMediaTypes.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor$CommonMediaTypes.class
deleted file mode 100644
index 918fe2c83b6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor$CommonMediaTypes.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.class
deleted file mode 100644
index 200d2eb90dc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/DefaultMediaTypePredictor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/FileDataBodyPart.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/file/FileDataBodyPart.class
deleted file mode 100644
index 9fb7695053b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/FileDataBodyPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/MediaTypePredictor.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/file/MediaTypePredictor.class
deleted file mode 100644
index d498c9bcaa2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/file/MediaTypePredictor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$1.class
deleted file mode 100644
index 7b0ef545c70..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataBodyPartMultiPartInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataBodyPartMultiPartInjectable.class
deleted file mode 100644
index aba86c95aa4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataBodyPartMultiPartInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataContentDispositionMultiPartInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataContentDispositionMultiPartInjectable.class
deleted file mode 100644
index 4aef3b9726d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataContentDispositionMultiPartInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataInjectableValuesProvider.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataInjectableValuesProvider.class
deleted file mode 100644
index e3eaad11dd1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataInjectableValuesProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartInjectable.class
deleted file mode 100644
index e4ec96780fe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartParamInjectable.class
deleted file mode 100644
index c8f34b6a6bf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$FormDataMultiPartParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataBodyPartMultiPartInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataBodyPartMultiPartInjectable.class
deleted file mode 100644
index 9cda9a3bb36..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataBodyPartMultiPartInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataContentDispositionMultiPartInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataContentDispositionMultiPartInjectable.class
deleted file mode 100644
index 998b3bb634b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider$ListFormDataContentDispositionMultiPartInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.class
deleted file mode 100644
index 39cd112ec51..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/FormDataMultiPartDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider$1.class
deleted file mode 100644
index 0d94c7587fb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider.class
deleted file mode 100644
index bbd4eb886ef..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartConfigProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.class
deleted file mode 100644
index 3c01889e624..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderClientSide.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.class
deleted file mode 100644
index 8fd2ec8e0ff..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartReaderServerSide.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartWriter.class b/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartWriter.class
deleted file mode 100644
index a9ab3b351c1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/multipart/impl/MultiPartWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/BuildId.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/BuildId.class
deleted file mode 100644
index 0613316676c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/BuildId.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/InitialContextHelper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/InitialContextHelper.class
deleted file mode 100644
index 96442cac7cf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/InitialContextHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalHttpContext.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalHttpContext.class
deleted file mode 100644
index 51b69f0ee4d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalHttpContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker$1.class
deleted file mode 100644
index eddedd7df28..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker.class
deleted file mode 100644
index 2d41e8d2ab1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.class
deleted file mode 100644
index a21f7f78549..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ThreadLocalNamedInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$1.class
deleted file mode 100644
index c5f77098e19..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$2.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$2.class
deleted file mode 100644
index e51bd712766..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$3.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$3.class
deleted file mode 100644
index ecb3f5004d5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$4.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$4.class
deleted file mode 100644
index e827fd0216b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$DimensionChecker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$DimensionChecker.class
deleted file mode 100644
index aaae3c69e1a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$DimensionChecker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$VariantHolder.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$VariantHolder.class
deleted file mode 100644
index 079233752d1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector$VariantHolder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector.class
deleted file mode 100644
index acb54c27c95..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/VariantSelector.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/CloseableServiceFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/CloseableServiceFactory.class
deleted file mode 100644
index 716dbbd37de..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/CloseableServiceFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$1.class
deleted file mode 100644
index 74581fae934..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$ApplicationHolder.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$ApplicationHolder.class
deleted file mode 100644
index f5d333661b6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig$ApplicationHolder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig.class
deleted file mode 100644
index 308aad34386..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/DeferredResourceConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory$ExceptionMapperType.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory$ExceptionMapperType.class
deleted file mode 100644
index 0f82db5c67b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory$ExceptionMapperType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory.class
deleted file mode 100644
index 9e83f49dbac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ExceptionMapperFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.class
deleted file mode 100644
index 1769a3392f7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/ResourceMethodDispatcherFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules$1.class
deleted file mode 100644
index 3f088c69319..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules.class
deleted file mode 100644
index 6adb58bda81..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/RootResourceUriRules.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationContext.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationContext.class
deleted file mode 100644
index 58be23cd6cd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$1.class
deleted file mode 100644
index 4fd7d8cb249..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$10.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$10.class
deleted file mode 100644
index 337e4e62d95..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$10.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$11.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$11.class
deleted file mode 100644
index 87640c3bdba..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$11.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$12.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$12.class
deleted file mode 100644
index b0683a5733f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$12.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$13.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$13.class
deleted file mode 100644
index 1baf63b88fa..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$13.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$14.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$14.class
deleted file mode 100644
index ff7e500c0bd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$14.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15$1.class
deleted file mode 100644
index 1da83aca935..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15.class
deleted file mode 100644
index 1aa22f32658..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$15.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16$1.class
deleted file mode 100644
index 326fe1dfcf2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16.class
deleted file mode 100644
index 20fb3b91d1c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$16.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17$1.class
deleted file mode 100644
index 05cccd0f543..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17.class
deleted file mode 100644
index 90964c2ebe7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$17.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18$1.class
deleted file mode 100644
index 90ea76550e0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18.class
deleted file mode 100644
index 96ff5f91773..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$18.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19$1.class
deleted file mode 100644
index f44a6a1ffc3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19.class
deleted file mode 100644
index 4519e585ba9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$19.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$2.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$2.class
deleted file mode 100644
index 134eb25c580..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20$1.class
deleted file mode 100644
index a11092c092b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20.class
deleted file mode 100644
index ee4c6d8d2a9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$20.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21$1.class
deleted file mode 100644
index ea0ffe6ecda..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21.class
deleted file mode 100644
index 78853ac53ec..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$21.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22$1.class
deleted file mode 100644
index 8ba086b490c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22.class
deleted file mode 100644
index b3688a1d04f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$22.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$23.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$23.class
deleted file mode 100644
index acd28e354ed..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$23.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$3.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$3.class
deleted file mode 100644
index 9d1971c81ac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4$1.class
deleted file mode 100644
index b8cae4aec38..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4.class
deleted file mode 100644
index a98d0d12d83..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5$1.class
deleted file mode 100644
index aaa60788d0e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5.class
deleted file mode 100644
index 35db6e879fc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$5.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6$1.class
deleted file mode 100644
index 0676441ea66..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6.class
deleted file mode 100644
index f2085a46b6b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$6.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7$1.class
deleted file mode 100644
index d0b121153b4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7.class
deleted file mode 100644
index ca89d8367c6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$7.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$8.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$8.class
deleted file mode 100644
index 7656f70128e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$8.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$9.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$9.class
deleted file mode 100644
index 1ac61fc299e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$9.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ClassAnnotationKey.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ClassAnnotationKey.class
deleted file mode 100644
index b7ac0976ad9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ClassAnnotationKey.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl$1.class
deleted file mode 100644
index 1b7bb827e90..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl.class
deleted file mode 100644
index 5cd0650d165..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorFactoryImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorImpl.class
deleted file mode 100644
index f06d80bb85d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ComponentProcessorImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ContextInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ContextInjectableProvider.class
deleted file mode 100644
index 6d24a07a697..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$ContextInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$DispatchingListenerProxy.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$DispatchingListenerProxy.class
deleted file mode 100644
index 086bb442bd5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl$DispatchingListenerProxy.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl.class
deleted file mode 100644
index 6c7e248db55..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/application/WebApplicationImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/build.properties b/plugins/com.sun.jersey/com/sun/jersey/server/impl/build.properties
deleted file mode 100644
index 498ddfe036e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/build.properties
+++ /dev/null
@@ -1 +0,0 @@
-Build-Id: 1.8 06/24/2011 12:39 PM \ No newline at end of file
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AbstractBean.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AbstractBean.class
deleted file mode 100644
index 4ec5b900df2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AbstractBean.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.class
deleted file mode 100644
index 753bf83c73c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedCallableImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.class
deleted file mode 100644
index 72c77bf36a8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedConstructorImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.class
deleted file mode 100644
index 444f344a9fb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedFieldImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedImpl.class
deleted file mode 100644
index a2876cc0124..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.class
deleted file mode 100644
index 8d07f649218..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMemberImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.class
deleted file mode 100644
index 171804c34d3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedMethodImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.class
deleted file mode 100644
index 8fa8fb9e4df..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedParameterImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.class
deleted file mode 100644
index c97443ab17e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/AnnotatedTypeImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator$1.class
deleted file mode 100644
index ab0a2b8e6bb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator.class
deleted file mode 100644
index 0c0ba462aee..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/BeanGenerator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$1.class
deleted file mode 100644
index 4bcf0dee2c1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$2.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$2.class
deleted file mode 100644
index 112d91817c4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$ComponentProviderDestroyable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$ComponentProviderDestroyable.class
deleted file mode 100644
index a8b0c7c2bb4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory$ComponentProviderDestroyable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.class
deleted file mode 100644
index b789dae7676..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.class
deleted file mode 100644
index 8df18f28186..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIComponentProviderFactoryInitializer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$1.class
deleted file mode 100644
index 9f31e0ec339..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$2.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$2.class
deleted file mode 100644
index 157798fb8f5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$3.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$3.class
deleted file mode 100644
index 2e065480fe4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ContextAnnotationLiteral.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ContextAnnotationLiteral.class
deleted file mode 100644
index 7a17fa25ee3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ContextAnnotationLiteral.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$InjectAnnotationLiteral.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$InjectAnnotationLiteral.class
deleted file mode 100644
index 887074e6339..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$InjectAnnotationLiteral.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$JNDIContextDiver.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$JNDIContextDiver.class
deleted file mode 100644
index c6b42850b01..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$JNDIContextDiver.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ParameterBean.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ParameterBean.class
deleted file mode 100644
index 62dd94cc501..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$ParameterBean.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PatchInformation.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PatchInformation.class
deleted file mode 100644
index 02258df9319..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PatchInformation.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PredefinedBean.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PredefinedBean.class
deleted file mode 100644
index f79afeb509d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$PredefinedBean.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$SyntheticQualifierAnnotationImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$SyntheticQualifierAnnotationImpl.class
deleted file mode 100644
index acdc50859ad..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension$SyntheticQualifierAnnotationImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension.class
deleted file mode 100644
index 97bcd14f828..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/CDIExtension.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/DiscoveredParameter.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/DiscoveredParameter.class
deleted file mode 100644
index b790dd96ebb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/DiscoveredParameter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/InitializedLater.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/InitializedLater.class
deleted file mode 100644
index f4110cf010d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/InitializedLater.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/ProviderBasedBean.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/ProviderBasedBean.class
deleted file mode 100644
index ebae314113b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/ProviderBasedBean.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/SyntheticQualifier.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/SyntheticQualifier.class
deleted file mode 100644
index c8c0026ab33..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/SyntheticQualifier.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/Utils.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/Utils.class
deleted file mode 100644
index 05f612c9946..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/cdi/Utils.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$FullyManagedWrapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$FullyManagedWrapper.class
deleted file mode 100644
index b4f9b2c12e8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$FullyManagedWrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$PerRequestWrapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$PerRequestWrapper.class
deleted file mode 100644
index e05a48ff2e3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$PerRequestWrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$SingletonWrapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$SingletonWrapper.class
deleted file mode 100644
index fe3eacb212d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$SingletonWrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$UndefinedWrapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$UndefinedWrapper.class
deleted file mode 100644
index ca539598f29..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory$UndefinedWrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory.class
deleted file mode 100644
index d93722e4a26..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/IoCResourceFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/ResourceFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/ResourceFactory.class
deleted file mode 100644
index aa5e51c7d67..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/component/ResourceFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.class
deleted file mode 100644
index e0d74c42609..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/WebApplicationProviderImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.class
deleted file mode 100644
index 28b8897f14a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/AnnotationResourceFilterFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/FilterFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/FilterFactory.class
deleted file mode 100644
index e4331ca32fe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/FilterFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/NormalizeFilter.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/NormalizeFilter.class
deleted file mode 100644
index af221a2a209..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/filter/NormalizeFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$1.class
deleted file mode 100644
index bb4d9a16989..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$2.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$2.class
deleted file mode 100644
index 7f5fc2225f6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$ContextInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$ContextInjectableProvider.class
deleted file mode 100644
index 8904f59826a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$ContextInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$Writer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$Writer.class
deleted file mode 100644
index 26820d0afb4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer$Writer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.class
deleted file mode 100644
index f8a68ebc3af..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.class
deleted file mode 100644
index 2012d17b23d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/grizzly/GrizzlyContainerProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer$Writer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer$Writer.class
deleted file mode 100644
index 869b98df0b0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer$Writer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.class
deleted file mode 100644
index 7eed66cc092..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.class
deleted file mode 100644
index 2211d4650f3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/httpserver/HttpHandlerContainerProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Include.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Include.class
deleted file mode 100644
index 1cb074a6353..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Include.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.class
deleted file mode 100644
index a4158df797a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JSPTemplateProcessor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.class
deleted file mode 100644
index 17c8dfd7023..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/JerseyServletContainerInitializer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$1.class
deleted file mode 100644
index c4d01625215..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$AbstractPerSession.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$AbstractPerSession.class
deleted file mode 100644
index aa50ed6acb9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$AbstractPerSession.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSesson.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSesson.class
deleted file mode 100644
index 536618a1135..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSesson.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonInstantiated.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonInstantiated.class
deleted file mode 100644
index a5e4a663acd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonInstantiated.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonProxied.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonProxied.class
deleted file mode 100644
index a46ebe30678..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$PerSessonProxied.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$SessionMap.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$SessionMap.class
deleted file mode 100644
index a5ffbac3cc3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory$SessionMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.class
deleted file mode 100644
index 10c074d9b56..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/PerSessionFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.class
deleted file mode 100644
index ebe7c96b7ad..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/RequestDispatcherWrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1$1.class
deleted file mode 100644
index 8c00e7b77f0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1.class
deleted file mode 100644
index e38c8835732..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.class
deleted file mode 100644
index 8a8eeb8c1d9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/ServletAdaptor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Wrapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Wrapper.class
deleted file mode 100644
index f484fe55c1e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/container/servlet/Wrapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory$EJBManagedComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory$EJBManagedComponentProvider.class
deleted file mode 100644
index 2a8cdcfc835..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory$EJBManagedComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.class
deleted file mode 100644
index 68c1168307b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.class
deleted file mode 100644
index abe34488019..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBComponentProviderFactoryInitilizer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.class
deleted file mode 100644
index fa330639bac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBExceptionMapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor$1.class
deleted file mode 100644
index d5ff4e20a6a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.class
deleted file mode 100644
index 7f3bc4bfbbc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBInjectionInterceptor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider$1.class
deleted file mode 100644
index 13b4e8d1106..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.class
deleted file mode 100644
index 7442820a6f5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/ejb/EJBRequestDispatcherProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable$1.class
deleted file mode 100644
index e810f5e36ee..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.class
deleted file mode 100644
index e505fa197c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/AbstractHttpContextInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/InjectableValuesProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/InjectableValuesProvider.class
deleted file mode 100644
index 512897830a6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/InjectableValuesProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.class
deleted file mode 100644
index 63d9a90c1fd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.class
deleted file mode 100644
index a703cf701b0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/inject/ServerInjectableProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory$ManagedBeanComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory$ManagedBeanComponentProvider.class
deleted file mode 100644
index 9e7d951eb24..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory$ManagedBeanComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.class
deleted file mode 100644
index eb0d2b38713..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.class
deleted file mode 100644
index c2985c87882..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/managedbeans/ManagedBeanComponentProviderFactoryInitilizer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ErrorHelper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ErrorHelper.class
deleted file mode 100644
index a76e2781348..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ErrorHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/HttpHelper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/HttpHelper.class
deleted file mode 100644
index 38e09a967fc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/HttpHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceMethodMap.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceMethodMap.class
deleted file mode 100644
index a4b02bec4bf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceMethodMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules$1.class
deleted file mode 100644
index 6bef68c3661..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules.class
deleted file mode 100644
index 02b719dc738..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/ResourceUriRules.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap$ConflictClosure.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap$ConflictClosure.class
deleted file mode 100644
index e76c254bdcc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap$ConflictClosure.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap.class
deleted file mode 100644
index d1cae5400c2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/RulesMap.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.class
deleted file mode 100644
index 8a4d391c3a2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHeadWrapperMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.class
deleted file mode 100644
index a5803bdb58b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod$OptionsRequestDispatcher.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod$OptionsRequestDispatcher.class
deleted file mode 100644
index 9a111582200..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod$OptionsRequestDispatcher.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.class
deleted file mode 100644
index 3ce2897d38d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceHttpOptionsMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod$1.class
deleted file mode 100644
index 4d1cbb79cb9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod.class
deleted file mode 100644
index 575cdfc951f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/ResourceMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$EntityParamInInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$EntityParamInInvoker.class
deleted file mode 100644
index 14ef30b1fde..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$EntityParamInInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$JResponseOutInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$JResponseOutInvoker.class
deleted file mode 100644
index 9902e15eaf7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$JResponseOutInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ObjectOutInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ObjectOutInvoker.class
deleted file mode 100644
index 04be33ba58b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ObjectOutInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ResponseOutInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ResponseOutInvoker.class
deleted file mode 100644
index 4f1bdf9cf40..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$ResponseOutInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$TypeOutInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$TypeOutInvoker.class
deleted file mode 100644
index da43c9118c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$TypeOutInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$VoidOutInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$VoidOutInvoker.class
deleted file mode 100644
index c227396fea1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider$VoidOutInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.class
deleted file mode 100644
index 6bdfb951c16..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/AbstractResourceMethodDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider$EntityInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider$EntityInjectable.class
deleted file mode 100644
index 0f8592b532e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider$EntityInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.class
deleted file mode 100644
index 96d7fd76332..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/EntityParamDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormEntityInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormEntityInjectable.class
deleted file mode 100644
index 126762c592e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormEntityInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormParameterProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormParameterProvider.class
deleted file mode 100644
index 17faa25b3de..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider$FormParameterProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.class
deleted file mode 100644
index 56377ebe013..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/FormDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider$HttpReqResDispatcher.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider$HttpReqResDispatcher.class
deleted file mode 100644
index 7c6842afb13..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider$HttpReqResDispatcher.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.class
deleted file mode 100644
index ff718c6bbac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/HttpReqResDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.class
deleted file mode 100644
index 246f9f228ce..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/MultipartFormDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.class
deleted file mode 100644
index 6030d9763c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/ResourceJavaMethodDispatcher.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider$VoidVoidMethodInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider$VoidVoidMethodInvoker.class
deleted file mode 100644
index 06f08a03afc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider$VoidVoidMethodInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.class
deleted file mode 100644
index 5da81d97115..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/method/dispatch/VoidVoidDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.class
deleted file mode 100644
index 9f619b3b63a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/BaseParamInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieParamInjectable.class
deleted file mode 100644
index f998c36d1d8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieTypeParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieTypeParamInjectable.class
deleted file mode 100644
index 4dec4bb0f37..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider$CookieTypeParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.class
deleted file mode 100644
index a76f5ede14d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/CookieParamInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider$FormParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider$FormParamInjectable.class
deleted file mode 100644
index b00d23f9d74..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider$FormParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.class
deleted file mode 100644
index a2d6d060858..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/FormParamInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider$HeaderParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider$HeaderParamInjectable.class
deleted file mode 100644
index 590ff00ba65..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider$HeaderParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.class
deleted file mode 100644
index bed467794b4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HeaderParamInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$1.class
deleted file mode 100644
index 8e4ae1b4e97..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextInjectable.class
deleted file mode 100644
index 09d567f0f69..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextRequestInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextRequestInjectable.class
deleted file mode 100644
index f2383a99dd1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$HttpContextRequestInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$UriInfoInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$UriInfoInjectable.class
deleted file mode 100644
index 4133ed58c1c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider$UriInfoInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.class
deleted file mode 100644
index 83282807afe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/HttpContextInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider$MatrixParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider$MatrixParamInjectable.class
deleted file mode 100644
index 3fda78e2c4d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider$MatrixParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.class
deleted file mode 100644
index c5dfe378483..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/MatrixParamInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamInjectable.class
deleted file mode 100644
index 54769eda324..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamListPathSegmentInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamListPathSegmentInjectable.class
deleted file mode 100644
index 74685b0a739..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamListPathSegmentInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamPathSegmentInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamPathSegmentInjectable.class
deleted file mode 100644
index 72c08d52a38..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider$PathParamPathSegmentInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.class
deleted file mode 100644
index ec66246948a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/PathParamInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider$QueryParamInjectable.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider$QueryParamInjectable.class
deleted file mode 100644
index 1a9ba5342d1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider$QueryParamInjectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.class
deleted file mode 100644
index 505384e8147..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/QueryParamInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.class
deleted file mode 100644
index 2f8e2c71c3e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/AbstractStringReaderExtractor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$ListString.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$ListString.class
deleted file mode 100644
index 9e8cbbaaa8c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$ListString.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SetString.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SetString.class
deleted file mode 100644
index dfbdff7273f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SetString.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SortedSetString.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SortedSetString.class
deleted file mode 100644
index 763dea1aca4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor$SortedSetString.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.class
deleted file mode 100644
index e04aca933a5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringExtractor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$ListValueOf.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$ListValueOf.class
deleted file mode 100644
index 8d203f823df..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$ListValueOf.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SetValueOf.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SetValueOf.class
deleted file mode 100644
index 44b21b92ea6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SetValueOf.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SortedSetValueOf.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SortedSetValueOf.class
deleted file mode 100644
index cb293c504a1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor$SortedSetValueOf.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.class
deleted file mode 100644
index 46c08475037..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/CollectionStringReaderExtractor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.class
deleted file mode 100644
index 2ae0abf5ed1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/ExtractorContainerException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider$1.class
deleted file mode 100644
index 6d9c6d584e1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider.class
deleted file mode 100644
index c2f528b1e27..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders$RootElementProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.class
deleted file mode 100644
index 26b096d6a31..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/JAXBStringReaderProviders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.class
deleted file mode 100644
index a6e02a58a03..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.class
deleted file mode 100644
index 031d6e2608d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.class
deleted file mode 100644
index 7f0b983d8a3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/MultivaluedParameterExtractorProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.class
deleted file mode 100644
index 30d0e57b1c8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveMapper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.class
deleted file mode 100644
index 36d7826fbbf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/PrimitiveValueOfExtractor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.class
deleted file mode 100644
index e1c3e44ea95..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringExtractor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.class
deleted file mode 100644
index 8b758012882..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderExtractor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.class
deleted file mode 100644
index 9f783b8c1ad..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$1.class
deleted file mode 100644
index 1be8c8cc995..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$AbstractStringReader.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$AbstractStringReader.class
deleted file mode 100644
index 5d39636c3d6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$AbstractStringReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider$1.class
deleted file mode 100644
index 3adbc203070..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider.class
deleted file mode 100644
index 17be89357d6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$DateProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor$1.class
deleted file mode 100644
index f3d72850812..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor.class
deleted file mode 100644
index 5ad580c6f40..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$StringConstructor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString$1.class
deleted file mode 100644
index c119aa40d7b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString.class
deleted file mode 100644
index 7c26b033ee1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromString.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromStringEnum.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromStringEnum.class
deleted file mode 100644
index d6e6bbc166a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeFromStringEnum.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf$1.class
deleted file mode 100644
index dc417cb9468..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf.class
deleted file mode 100644
index 18d33bf8ea9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders$TypeValueOf.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.class
deleted file mode 100644
index 09d48d4b7bb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/model/parameter/multivalued/StringReaderProviders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$1.class
deleted file mode 100644
index 0e70f320039..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$2.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$2.class
deleted file mode 100644
index 1e6f7a2b9dc..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$3.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$3.class
deleted file mode 100644
index 8b6fd3b9e62..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$4.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$4.class
deleted file mode 100644
index ce7036266f3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$5.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$5.class
deleted file mode 100644
index 8635f4bcd96..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$5.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$6.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$6.class
deleted file mode 100644
index 0eb83fa40d3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$6.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$7.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$7.class
deleted file mode 100644
index b648f691739..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$7.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$8.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$8.class
deleted file mode 100644
index ba0ca75dccd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$8.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$ParamAnnotationHelper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$ParamAnnotationHelper.class
deleted file mode 100644
index fa6f683ef2c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller$ParamAnnotationHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.class
deleted file mode 100644
index f9d9f3c1783..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/annotation/IntrospectionModeller.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.class
deleted file mode 100644
index 7a52a25cf12..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/AbstractModelValidator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator$1.class
deleted file mode 100644
index 0f77ab4a327..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.class
deleted file mode 100644
index ecfcf76d568..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/modelapi/validation/BasicValidator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.class
deleted file mode 100644
index b4b08a24e5f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/GlassFishMonitoringInitializer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$1.class
deleted file mode 100644
index 0982a89a55e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedDispatchingListener.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedDispatchingListener.class
deleted file mode 100644
index e4d4bc7fa09..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedDispatchingListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedRequestListener.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedRequestListener.class
deleted file mode 100644
index 4cf79a0e973..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedRequestListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedResponseListener.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedResponseListener.class
deleted file mode 100644
index 73ccdc2a258..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$AggregatedResponseListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$EmptyListener.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$EmptyListener.class
deleted file mode 100644
index 3d6baabd87e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory$EmptyListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.class
deleted file mode 100644
index 3fc873e5403..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/monitoring/MonitoringProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.class
deleted file mode 100644
index 3be73585b2c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/provider/RuntimeDelegateImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$1.class
deleted file mode 100644
index f62490ec18a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$AbstractPerRequest.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$AbstractPerRequest.class
deleted file mode 100644
index a47aea5bd59..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$AbstractPerRequest.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequest.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequest.class
deleted file mode 100644
index d5fb5ad7b88..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequest.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestInstantiated.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestInstantiated.class
deleted file mode 100644
index 2147ed52aa1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestInstantiated.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestProxied.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestProxied.class
deleted file mode 100644
index 54777c41530..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory$PerRequestProxied.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory.class
deleted file mode 100644
index 8009243b39c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/PerRequestFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$1.class
deleted file mode 100644
index 2a0cbce8862..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$AbstractSingleton.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$AbstractSingleton.class
deleted file mode 100644
index 3da76c68725..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$AbstractSingleton.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$Singleton.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$Singleton.class
deleted file mode 100644
index f0c131a6cd1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$Singleton.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonInstantiated.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonInstantiated.class
deleted file mode 100644
index 417e959978c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonInstantiated.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonProxied.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonProxied.class
deleted file mode 100644
index 847733dba08..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory$SingletonProxied.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory.class
deleted file mode 100644
index 51a8d33e06d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/resource/SingletonFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateFactory.class
deleted file mode 100644
index dfaf19d4b13..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateViewProcessor.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateViewProcessor.class
deleted file mode 100644
index 679073bd402..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/TemplateViewProcessor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewResourceMethod.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewResourceMethod.class
deleted file mode 100644
index bb2fd61440f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewResourceMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.class
deleted file mode 100644
index 619a17fdc94..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableMessageBodyWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableRule.class
deleted file mode 100644
index 45b2b31e5c5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/template/ViewableRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern$1.class
deleted file mode 100644
index f2633efa257..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern.class
deleted file mode 100644
index 7bda1172f17..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathPattern.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate$PathTemplateParser.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate$PathTemplateParser.class
deleted file mode 100644
index 430b757d719..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate$PathTemplateParser.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate.class
deleted file mode 100644
index 4b97a698e95..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/PathTemplate.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/UriHelper.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/UriHelper.class
deleted file mode 100644
index d0e0d831421..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/UriHelper.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$1.class
deleted file mode 100644
index f8a16ce0e37..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$EmptyIterator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$EmptyIterator.class
deleted file mode 100644
index 86af6d41fcb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$EmptyIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$SingleEntryIterator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$SingleEntryIterator.class
deleted file mode 100644
index 8e7f41d3a24..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns$SingleEntryIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.class
deleted file mode 100644
index 84ce6cfad0e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/AtomicMatchingPatterns.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/BaseRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/BaseRule.class
deleted file mode 100644
index 95afd4107f2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/BaseRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns$XInterator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns$XInterator.class
deleted file mode 100644
index 22f7ebdd7b1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns$XInterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.class
deleted file mode 100644
index 0bceedf48ac..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/CombiningMatchingPatterns.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$1.class
deleted file mode 100644
index f28f9e6ac50..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$MatchStatus.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$MatchStatus.class
deleted file mode 100644
index 7c5e8d291c9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$MatchStatus.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$Matcher.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$Matcher.class
deleted file mode 100644
index 0032bfa89b4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$Matcher.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$ResourceMethodListPair.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$ResourceMethodListPair.class
deleted file mode 100644
index 0336a51bf4f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule$ResourceMethodListPair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.class
deleted file mode 100644
index 331fe9d0d3b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/HttpMethodRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/PatternRulePair.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/PatternRulePair.class
deleted file mode 100644
index e6df2155a54..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/PatternRulePair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.class
deleted file mode 100644
index 31f0680fe4e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceClassRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.class
deleted file mode 100644
index c4631378e0a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/ResourceObjectRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.class
deleted file mode 100644
index 15db631e178..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RightHandPathRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.class
deleted file mode 100644
index d792d59d6c1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/RootResourceClassesRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns$XInterator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns$XInterator.class
deleted file mode 100644
index f804baa13da..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns$XInterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.class
deleted file mode 100644
index 9adfb33f5a6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SequentialMatchingPatterns.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.class
deleted file mode 100644
index a4a7bf9c98e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/SubLocatorRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/TerminatingRule.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/TerminatingRule.class
deleted file mode 100644
index 5d476a0e67c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/TerminatingRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.class
deleted file mode 100644
index 8080989591e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/UriRulesFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules$SearchState.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules$SearchState.class
deleted file mode 100644
index 7fe11085413..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules$SearchState.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.class
deleted file mode 100644
index a69a7f82dfb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/AutomataMatchingUriTemplateRules.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.class
deleted file mode 100644
index 4ed6a403c9c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieArc.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.class
deleted file mode 100644
index a5e2cf00881..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNode.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$ArrayIterator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$ArrayIterator.class
deleted file mode 100644
index d57a8582ac5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$ArrayIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$EmptyIterator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$EmptyIterator.class
deleted file mode 100644
index 02ce4858c90..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$EmptyIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$SingleEntryIterator.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$SingleEntryIterator.class
deleted file mode 100644
index 415c061dea6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue$SingleEntryIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.class
deleted file mode 100644
index a73c42b0b64..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/uri/rules/automata/TrieNodeValue.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.class
deleted file mode 100644
index 6e00d857c68..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlApplicationContextImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory$1.class
deleted file mode 100644
index 95eba726764..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory.class
deleted file mode 100644
index 6032d14bd93..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethod.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethod.class
deleted file mode 100644
index 56662b3a1b1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethod.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethodDispatcher.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethodDispatcher.class
deleted file mode 100644
index 5d0a879705c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory$WadlOptionsMethodDispatcher.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory.class
deleted file mode 100644
index 637e278860d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlMethodFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlResource.class b/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlResource.class
deleted file mode 100644
index c4d37273d60..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/impl/wadl/WadlResource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/osgi/Activator.class b/plugins/com.sun.jersey/com/sun/jersey/server/osgi/Activator.class
deleted file mode 100644
index 177b21a1cf5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/osgi/Activator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/probes/UriRuleProbeProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/probes/UriRuleProbeProvider.class
deleted file mode 100644
index 187bd0cbaa4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/probes/UriRuleProbeProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$1.class
deleted file mode 100644
index ed5a2f3897e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorComparator.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorComparator.class
deleted file mode 100644
index c9a816442ee..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorComparator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorInjectablePair.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorInjectablePair.class
deleted file mode 100644
index 182b6450218..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor$ConstructorInjectablePair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor.class
deleted file mode 100644
index 1337fbdb76b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentConstructor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentDestructor.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentDestructor.class
deleted file mode 100644
index fcb7821c9fe..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentDestructor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector$1.class
deleted file mode 100644
index df9709b839c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector.class
deleted file mode 100644
index b486ba27576..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentInjector.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProvider.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProvider.class
deleted file mode 100644
index d02cec615e1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.class
deleted file mode 100644
index 275e901befd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.class b/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.class
deleted file mode 100644
index dd4d50b2fb3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/spi/component/ResourceComponentProviderFactoryClass.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlApplicationContext.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlApplicationContext.class
deleted file mode 100644
index 8205a053a73..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlApplicationContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlBuilder.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlBuilder.class
deleted file mode 100644
index 359f9d75c5c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlBuilder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGenerator.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGenerator.class
deleted file mode 100644
index 818879405c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGenerator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl$1.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl$1.class
deleted file mode 100644
index 275535c6799..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl.class
deleted file mode 100644
index 04d3a45d12e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/WadlGeneratorImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ApplicationDocs.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ApplicationDocs.class
deleted file mode 100644
index 7aa22ecca07..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ApplicationDocs.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ObjectFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ObjectFactory.class
deleted file mode 100644
index ef2234423d9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/ObjectFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.class
deleted file mode 100644
index 2e43e31adee..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorApplicationDoc.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.class
deleted file mode 100644
index 52d47876a4c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/WadlGeneratorGrammarsSupport.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.class
deleted file mode 100644
index 243d38f5d04..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/ResourceDocAccessor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.class
deleted file mode 100644
index d06788680d3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/WadlGeneratorResourceDocSupport.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.class
deleted file mode 100644
index 01450496259..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/AnnotationDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.class
deleted file mode 100644
index 18e0ee0e97a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ClassDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.class
deleted file mode 100644
index ab9694b710a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/MethodDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.class
deleted file mode 100644
index ba7c7895704..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/NamedValueType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.class
deleted file mode 100644
index 97c8f414dd6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ObjectFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.class
deleted file mode 100644
index 0dc7526ca5c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ParamDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.class
deleted file mode 100644
index 09442dc8d48..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RepresentationDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.class
deleted file mode 100644
index 7019b1c83ab..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/RequestDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.class
deleted file mode 100644
index b2c97ffe273..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResourceDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.class
deleted file mode 100644
index 28ff6ff0c24..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/ResponseDocType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.class
deleted file mode 100644
index ccfc42aeaec..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/model/WadlParamType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.class
deleted file mode 100644
index 120287059cf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/Elements.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.class
deleted file mode 100644
index ce092dc0b4f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/ObjectFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.class
deleted file mode 100644
index b16ce82d59b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlElementType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.class b/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.class
deleted file mode 100644
index 5733e0f7532..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/server/wadl/generators/resourcedoc/xhtml/XhtmlValueType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/CloseableService.class b/plugins/com.sun.jersey/com/sun/jersey/spi/CloseableService.class
deleted file mode 100644
index 760065e760a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/CloseableService.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/HeaderDelegateProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/HeaderDelegateProvider.class
deleted file mode 100644
index bca6249baa7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/HeaderDelegateProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/MessageBodyWorkers.class b/plugins/com.sun.jersey/com/sun/jersey/spi/MessageBodyWorkers.class
deleted file mode 100644
index 40cabfdf885..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/MessageBodyWorkers.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReader$ValidateDefaultValue.class b/plugins/com.sun.jersey/com/sun/jersey/spi/StringReader$ValidateDefaultValue.class
deleted file mode 100644
index 54226111f5c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReader$ValidateDefaultValue.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReader.class b/plugins/com.sun.jersey/com/sun/jersey/spi/StringReader.class
deleted file mode 100644
index 9e6ebc372f0..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReader.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderProvider.class
deleted file mode 100644
index d016ed3fb7a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderWorkers.class b/plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderWorkers.class
deleted file mode 100644
index 204116d3185..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/StringReaderWorkers.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerRequest.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerRequest.class
deleted file mode 100644
index 22170929a85..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerRequest.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerResponse.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerResponse.class
deleted file mode 100644
index e692d85115f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/AdaptingContainerResponse.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/CachedEntityContainerRequest.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/CachedEntityContainerRequest.class
deleted file mode 100644
index 46baaf830f1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/CachedEntityContainerRequest.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerListener.class
deleted file mode 100644
index 0c8f5e596a8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerNotifier.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerNotifier.class
deleted file mode 100644
index abc18d5caad..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerNotifier.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerProvider.class
deleted file mode 100644
index 73d3ffb4303..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequest.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequest.class
deleted file mode 100644
index 42b52b4461b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequest.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequestFilter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequestFilter.class
deleted file mode 100644
index 7b0a53c8525..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerRequestFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$1.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$1.class
deleted file mode 100644
index 01bd29724e6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$CommittingOutputStream.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$CommittingOutputStream.class
deleted file mode 100644
index 802d7257754..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse$CommittingOutputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse.class
deleted file mode 100644
index bbfd5a0fa16..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponse.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseFilter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseFilter.class
deleted file mode 100644
index 21bd4e06ce3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseWriter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseWriter.class
deleted file mode 100644
index 04fabb28e68..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ContainerResponseWriter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ExceptionMapperContext.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ExceptionMapperContext.class
deleted file mode 100644
index 364df2b281c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ExceptionMapperContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvoker.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvoker.class
deleted file mode 100644
index 881251b326b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvoker.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory$1.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory$1.class
deleted file mode 100644
index bdb5040ce2d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory.class
deleted file mode 100644
index e040f2116f6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/JavaMethodInvokerFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ParamQualifier.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ParamQualifier.class
deleted file mode 100644
index 5e9ba83f221..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ParamQualifier.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ReloadListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ReloadListener.class
deleted file mode 100644
index dd4dee47d58..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ReloadListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilter.class
deleted file mode 100644
index 24ee4f54eba..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilterFactory.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilterFactory.class
deleted file mode 100644
index e37e754930f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilterFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilters.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilters.class
deleted file mode 100644
index 3716a277d5c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceFilters.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.class
deleted file mode 100644
index bfb56e69967..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.class
deleted file mode 100644
index 14a507bc561..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodCustomInvokerDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.class
deleted file mode 100644
index 2964ebe29bb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.class
deleted file mode 100644
index 50117586b8e..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/ResourceMethodDispatchProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplication.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplication.class
deleted file mode 100644
index 84ba63dcc5d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplication.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationFactory.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationFactory.class
deleted file mode 100644
index 5f451e23520..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationListener.class
deleted file mode 100644
index ddf47ea27db..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationProvider.class
deleted file mode 100644
index 6426f833d96..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/WebApplicationProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/PerSession.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/PerSession.class
deleted file mode 100644
index 5944e738b52..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/PerSession.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$ContextInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$ContextInjectableProvider.class
deleted file mode 100644
index 32bd401a66b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$ContextInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$InternalWebComponent.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$InternalWebComponent.class
deleted file mode 100644
index 1286e11789a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer$InternalWebComponent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer.class
deleted file mode 100644
index 321229ee1a5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/ServletContainer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$1.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$1.class
deleted file mode 100644
index 9d580ce8a9b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$2.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$2.class
deleted file mode 100644
index 22c0e38ec62..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$3.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$3.class
deleted file mode 100644
index d26a8d577e1..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$3.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$4.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$4.class
deleted file mode 100644
index c39697c55bf..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$4.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$ContextInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$ContextInjectableProvider.class
deleted file mode 100644
index 258eb90521c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$ContextInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$Writer.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$Writer.class
deleted file mode 100644
index 93a2f571625..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent$Writer.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent.class
deleted file mode 100644
index 8d55984becb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebComponent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig$ConfigType.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig$ConfigType.class
deleted file mode 100644
index 0b701309e13..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig$ConfigType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig.class
deleted file mode 100644
index 0b6e4021ef5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebFilterConfig.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebFilterConfig.class
deleted file mode 100644
index 9ebc9102818..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebFilterConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebServletConfig.class b/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebServletConfig.class
deleted file mode 100644
index 58ef5fdd8fd..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/container/servlet/WebServletConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/dispatch/RequestDispatcher.class b/plugins/com.sun.jersey/com/sun/jersey/spi/dispatch/RequestDispatcher.class
deleted file mode 100644
index 472e7d4d989..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/dispatch/RequestDispatcher.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ClientSide.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ClientSide.class
deleted file mode 100644
index 4e3d7ff83c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ClientSide.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedTo.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedTo.class
deleted file mode 100644
index 6743ad6be29..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedTo.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedToType.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedToType.class
deleted file mode 100644
index ddc453bf751..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ConstrainedToType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$1.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$1.class
deleted file mode 100644
index c235de98918..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$Closure.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$Closure.class
deleted file mode 100644
index a423df1c764..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$Closure.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessage.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessage.class
deleted file mode 100644
index fe036787031..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessage.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessagesException.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessagesException.class
deleted file mode 100644
index 625b4b12c5c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors$ErrorMessagesException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors.class
deleted file mode 100644
index 4cc07659ca9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Errors.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Inject.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Inject.class
deleted file mode 100644
index 6054dd79838..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Inject.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Injectable.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Injectable.class
deleted file mode 100644
index 27daeecbc33..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/Injectable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProvider.class
deleted file mode 100644
index b3a60da9225..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext$InjectableScopePair.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext$InjectableScopePair.class
deleted file mode 100644
index e7194e81aa8..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext$InjectableScopePair.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext.class
deleted file mode 100644
index bf490a8f1cb..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/InjectableProviderContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.class
deleted file mode 100644
index b0f352a75b5..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/PerRequestTypeInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ServerSide.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ServerSide.class
deleted file mode 100644
index 7b31662d56b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/ServerSide.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.class
deleted file mode 100644
index fbfcccc7754..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/inject/SingletonTypeInjectableProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListener.class
deleted file mode 100644
index 5570ab181c7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.class
deleted file mode 100644
index 62d06206c04..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/DispatchingListenerAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.class
deleted file mode 100644
index 77759d304a7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/GlassfishMonitoringProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListener.class
deleted file mode 100644
index 3e5205ae4e7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListenerAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListenerAdapter.class
deleted file mode 100644
index 367805153c6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/RequestListenerAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListener.class
deleted file mode 100644
index 2f021600236..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.class b/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.class
deleted file mode 100644
index 27f49b1b691..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/monitoring/ResponseListenerAdapter.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/resource/PerRequest.class b/plugins/com.sun.jersey/com/sun/jersey/spi/resource/PerRequest.class
deleted file mode 100644
index 5c0d4bbb711..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/resource/PerRequest.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/resource/Singleton.class b/plugins/com.sun.jersey/com/sun/jersey/spi/resource/Singleton.class
deleted file mode 100644
index 1790658fcef..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/resource/Singleton.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$1.class b/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$1.class
deleted file mode 100644
index 3627729310f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$AnnotatedClassVisitor.class b/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$AnnotatedClassVisitor.class
deleted file mode 100644
index 490b46341c9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener$AnnotatedClassVisitor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener.class
deleted file mode 100644
index 2e96830420f..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/AnnotationScannerListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/PathProviderScannerListener.class b/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/PathProviderScannerListener.class
deleted file mode 100644
index 8897ea50916..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/PathProviderScannerListener.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$1.class b/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$1.class
deleted file mode 100644
index 21005ea4211..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$2.class b/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$2.class
deleted file mode 100644
index 296b69004d9..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner$2.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner.class b/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner.class
deleted file mode 100644
index 93506b5058b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/scanning/WebAppResourcesScanner.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceConfigurationError.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceConfigurationError.class
deleted file mode 100644
index b70dd662e7c..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceConfigurationError.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$1.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$1.class
deleted file mode 100644
index c2777c47fb4..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$AbstractLazyIterator.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$AbstractLazyIterator.class
deleted file mode 100644
index c8b50f3ceb6..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$AbstractLazyIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$DefaultServiceIteratorProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$DefaultServiceIteratorProvider.class
deleted file mode 100644
index 7a3f52df519..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$DefaultServiceIteratorProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyClassIterator.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyClassIterator.class
deleted file mode 100644
index e651416afd7..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyClassIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyObjectIterator.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyObjectIterator.class
deleted file mode 100644
index a9f39a492ef..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$LazyObjectIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$ServiceIteratorProvider.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$ServiceIteratorProvider.class
deleted file mode 100644
index 21505f39141..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder$ServiceIteratorProvider.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder.class b/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder.class
deleted file mode 100644
index e7d2a572d13..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/service/ServiceFinder.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/template/ResolvedViewable.class b/plugins/com.sun.jersey/com/sun/jersey/spi/template/ResolvedViewable.class
deleted file mode 100644
index 8dadb210ae3..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/template/ResolvedViewable.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContext.class b/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContext.class
deleted file mode 100644
index d4f86d9b64b..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContextException.class b/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContextException.class
deleted file mode 100644
index cd2b208de99..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateContextException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateProcessor.class b/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateProcessor.class
deleted file mode 100644
index 8658e4b1810..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/template/TemplateProcessor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/template/ViewProcessor.class b/plugins/com.sun.jersey/com/sun/jersey/spi/template/ViewProcessor.class
deleted file mode 100644
index 9f3d2fd7aff..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/template/ViewProcessor.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriMatchResultContext.class b/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriMatchResultContext.class
deleted file mode 100644
index 64947049f8d..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriMatchResultContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRule.class b/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRule.class
deleted file mode 100644
index 0032516e59a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRule.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRuleContext.class b/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRuleContext.class
deleted file mode 100644
index 65ba9a8b5b2..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRuleContext.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRules.class b/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRules.class
deleted file mode 100644
index 042adec999a..00000000000
--- a/plugins/com.sun.jersey/com/sun/jersey/spi/uri/rules/UriRules.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Application.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Application.class
deleted file mode 100644
index 54abe281639..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Application.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Doc.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Doc.class
deleted file mode 100644
index 8743dfdff45..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Doc.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Grammars.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Grammars.class
deleted file mode 100644
index 8b4ab4c8b96..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Grammars.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/HTTPMethods.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/HTTPMethods.class
deleted file mode 100644
index 4ebc524b3f2..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/HTTPMethods.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Include.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Include.class
deleted file mode 100644
index b77673c7b06..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Include.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Link.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Link.class
deleted file mode 100644
index fafef20c234..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Link.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Method.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Method.class
deleted file mode 100644
index 0d77becaac6..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Method.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/ObjectFactory.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/ObjectFactory.class
deleted file mode 100644
index a7ba43e07c5..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/ObjectFactory.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Option.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Option.class
deleted file mode 100644
index 9707d3801fb..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Option.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Param.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Param.class
deleted file mode 100644
index e01924da89b..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Param.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/ParamStyle.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/ParamStyle.class
deleted file mode 100644
index 277f746362e..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/ParamStyle.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/RepresentationType.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/RepresentationType.class
deleted file mode 100644
index 5607cdc198c..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/RepresentationType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Request.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Request.class
deleted file mode 100644
index 28545f8975f..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Request.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Resource.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Resource.class
deleted file mode 100644
index c1430595d0c..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Resource.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/ResourceType.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/ResourceType.class
deleted file mode 100644
index 81c12847fed..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/ResourceType.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Resources.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Resources.class
deleted file mode 100644
index 1293e9b2e06..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Resources.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Response.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/Response.class
deleted file mode 100644
index 21b3e116461..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/Response.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/research/ws/wadl/package-info.class b/plugins/com.sun.jersey/com/sun/research/ws/wadl/package-info.class
deleted file mode 100644
index 497553d4fe1..00000000000
--- a/plugins/com.sun.jersey/com/sun/research/ws/wadl/package-info.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/com/sun/ws/rs/ext/RuntimeDelegateImpl.class b/plugins/com.sun.jersey/com/sun/ws/rs/ext/RuntimeDelegateImpl.class
deleted file mode 100644
index 692355dc6ba..00000000000
--- a/plugins/com.sun.jersey/com/sun/ws/rs/ext/RuntimeDelegateImpl.class
+++ /dev/null
Binary files differ
diff --git a/plugins/com.sun.jersey/pom.xml b/plugins/com.sun.jersey/pom.xml
deleted file mode 100644
index 5b5159341bf..00000000000
--- a/plugins/com.sun.jersey/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.x.core.parent</artifactId>
- <version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.x.core.parent</relativePath>
- </parent>
-
- <artifactId>com.sun.jersey</artifactId>
- <packaging>eclipse-plugin</packaging>
- <name>com.sun.jersey</name>
- <version>1.8.0-SNAPSHOT</version>
-</project> \ No newline at end of file
diff --git a/plugins/org.jvnet.mimepull.source/.classpath b/plugins/org.jvnet.mimepull.source/.classpath
deleted file mode 100644
index f2d414669db..00000000000
--- a/plugins/org.jvnet.mimepull.source/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry exported="true" kind="lib" path=""/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.jvnet.mimepull.source/.project b/plugins/org.jvnet.mimepull.source/.project
deleted file mode 100644
index 20da2bf137d..00000000000
--- a/plugins/org.jvnet.mimepull.source/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.jvnet.mimepull.source</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.jvnet.mimepull.source/META-INF/MANIFEST.MF b/plugins/org.jvnet.mimepull.source/META-INF/MANIFEST.MF
deleted file mode 100644
index cc2f8916d75..00000000000
--- a/plugins/org.jvnet.mimepull.source/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Mimepull Source
-Bundle-SymbolicName: org.jvnet.mimepull.source
-Bundle-Version: 1.5.0.qualifier
-Bundle-Vendor: mimepull.java.net
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/org.jvnet.mimepull.source/build.properties b/plugins/org.jvnet.mimepull.source/build.properties
deleted file mode 100644
index 1ac73badbfe..00000000000
--- a/plugins/org.jvnet.mimepull.source/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-output.. = .
-bin.includes = META-INF/,\
- org/
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Chunk.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Chunk.java
deleted file mode 100644
index 3d4e2998574..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Chunk.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-final class Chunk {
- volatile Chunk next;
- volatile Data data;
-
- public Chunk(Data data) {
- this.data = data;
- }
-
- /**
- * Creates a new chunk and adds to linked list.
- *
- * @param dataHead of the linked list
- * @param buf MIME part partial data
- * @return created chunk
- */
- public Chunk createNext(DataHead dataHead, ByteBuffer buf) {
- return next = new Chunk(data.createNext(dataHead, buf));
- }
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/ChunkInputStream.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/ChunkInputStream.java
deleted file mode 100644
index 16c28b7c0c9..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/ChunkInputStream.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.InputStream;
-import java.io.IOException;
-
-/**
- * Constructs a InputStream from a linked list of {@link Chunk}s.
- *
- * @author Kohsuke Kawaguchi
- * @author Jitendra Kotamraju
- */
-final class ChunkInputStream extends InputStream {
- Chunk current;
- int offset;
- int len;
- final MIMEMessage msg;
- final MIMEPart part;
- byte[] buf;
-
- public ChunkInputStream(MIMEMessage msg, MIMEPart part, Chunk startPos) {
- this.current = startPos;
- len = current.data.size();
- buf = current.data.read();
- this.msg = msg;
- this.part = part;
- }
-
- @Override
- public int read(byte b[], int off, int sz) throws IOException {
- if(!fetch()) return -1;
-
- sz = Math.min(sz, len-offset);
- System.arraycopy(buf,offset,b,off,sz);
- return sz;
- }
-
- public int read() throws IOException {
- if(!fetch()) return -1;
- return (buf[offset++] & 0xff);
- }
-
- /**
- * Gets to the next chunk if we are done with the current one.
- * @return
- */
- private boolean fetch() {
- if (current == null) {
- throw new IllegalStateException("Stream already closed");
- }
- while(offset==len) {
- while(!part.parsed && current.next == null) {
- msg.makeProgress();
- }
- current = current.next;
-
- if (current == null) {
- return false;
- }
- this.offset = 0;
- this.buf = current.data.read();
- this.len = current.data.size();
- }
- return true;
- }
-
- public void close() throws IOException {
- super.close();
- current = null;
- }
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Data.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Data.java
deleted file mode 100644
index e213b6d7c8f..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Data.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author Kohsuke Kawaguchi
- * @author Jitendra Kotamraju
- */
-interface Data {
-
- /**
- * size of the chunk given by the parser
- *
- * @return size of the chunk
- */
- int size();
-
- /**
- * TODO: should the return type be ByteBuffer ??
- * Return part's partial data. The data is read only.
- *
- * @return a byte array which contains {#size()} bytes. The returned
- * array may be larger than {#size()} bytes and contains data
- * from offset 0.
- */
- byte[] read();
-
- /**
- * Write this partial data to a file
- *
- * @param file to which the data needs to be written
- * @return file pointer before the write operation(at which the data is
- * written from)
- */
- long writeTo(DataFile file);
-
- /**
- * Factory method to create a Data. The implementation could
- * be file based one or memory based one.
- *
- * @param dataHead start of the linked list of data objects
- * @param buf contains partial content for a part
- * @return Data
- */
- Data createNext(DataHead dataHead, ByteBuffer buf);
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataFile.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataFile.java
deleted file mode 100644
index ebabff8b40d..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataFile.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.*;
-
-/**
- * Use {@link RandomAccessFile} for concurrent access of read
- * and write partial part's content.
- *
- * @author Kohsuke Kawaguchi
- * @author Jitendra Kotamraju
- */
-final class DataFile {
- private WeakDataFile weak;
- private long writePointer;
-
- DataFile(File file) {
- writePointer=0;
- weak = new WeakDataFile(this, file);
- }
-
- /**
- *
- */
- void close() {
- weak.close();
- }
-
- /**
- * Read data from the given file pointer position.
- *
- * @param pointer read position
- * @param buf that needs to be filled
- * @param offset the start offset of the data.
- * @param length of data that needs to be read
- */
- synchronized void read(long pointer, byte[] buf, int offset, int length ) {
- weak.read(pointer, buf, offset, length);
- }
-
- void renameTo(File f) {
- weak.renameTo(f);
- }
-
- /**
- * Write data to the file
- *
- * @param data that needs to written to a file
- * @param offset start offset in the data
- * @param length no bytes to write
- * @return file pointer before the write operation(or at which the
- * data is written)
- */
- synchronized long writeTo(byte[] data, int offset, int length) {
- long temp = writePointer;
- writePointer = weak.writeTo(writePointer, data, offset, length);
- return temp;
- }
-
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataHead.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataHead.java
deleted file mode 100644
index 65d34f81c58..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/DataHead.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.*;
-import java.nio.ByteBuffer;
-
-/**
- * Represents an attachment part in a MIME message. MIME message parsing is done
- * lazily using a pull parser, so the part may not have all the data. {@link #read}
- * and {@link #readOnce} may trigger the actual parsing the message. In fact,
- * parsing of an attachment part may be triggered by calling {@link #read} methods
- * on some other attachemnt parts. All this happens behind the scenes so the
- * application developer need not worry about these details.
- *
- * @author Jitendra Kotamraju
- */
-final class DataHead {
-
- /**
- * Linked list to keep the part's content
- */
- volatile Chunk head, tail;
-
- /**
- * If the part is stored in a file, non-null.
- */
- DataFile dataFile;
-
- private final MIMEPart part;
-
- boolean readOnce;
- volatile long inMemory;
-
- /**
- * Used only for debugging. This records where readOnce() is called.
- */
- private Throwable consumedAt;
-
- DataHead(MIMEPart part) {
- this.part = part;
- }
-
- void addBody(ByteBuffer buf) {
- synchronized(this) {
- inMemory += buf.limit();
- }
- if (tail != null) {
- tail = tail.createNext(this, buf);
- } else {
- head = tail = new Chunk(new MemoryData(buf, part.msg.config));
- }
- }
-
- void doneParsing() {
- }
-
- void moveTo(File f) {
- if (dataFile != null) {
- dataFile.renameTo(f);
- } else {
- try {
- OutputStream os = new FileOutputStream(f);
- InputStream in = readOnce();
- byte[] buf = new byte[8192];
- int len;
- while((len=in.read(buf)) != -1) {
- os.write(buf, 0, len);
- }
- os.close();
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- }
- }
-
- void close() {
- if (dataFile != null) {
- head = tail = null;
- dataFile.close();
- }
- }
-
-
- /**
- * Can get the attachment part's content multiple times. That means
- * the full content needs to be there in memory or on the file system.
- * Calling this method would trigger parsing for the part's data. So
- * do not call this unless it is required(otherwise, just wrap MIMEPart
- * into a object that returns InputStream for e.g DataHandler)
- *
- * @return data for the part's content
- */
- public InputStream read() {
- if (readOnce) {
- throw new IllegalStateException("readOnce() is called before, read() cannot be called later.");
- }
-
- // Trigger parsing for the part
- while(tail == null) {
- if (!part.msg.makeProgress()) {
- throw new IllegalStateException("No such MIME Part: "+part);
- }
- }
-
- if (head == null) {
- throw new IllegalStateException("Already read. Probably readOnce() is called before.");
- }
- return new ReadMultiStream();
- }
-
- /**
- * Used for an assertion. Returns true when readOnce() is not already called.
- * or otherwise throw an exception.
- *
- * <p>
- * Calling this method also marks the stream as 'consumed'
- *
- * @return true if readOnce() is not called before
- */
- private boolean unconsumed() {
- if (consumedAt != null) {
- AssertionError error = new AssertionError("readOnce() is already called before. See the nested exception from where it's called.");
- error.initCause(consumedAt);
- throw error;
- }
- consumedAt = new Exception().fillInStackTrace();
- return true;
- }
-
- /**
- * Can get the attachment part's content only once. The content
- * will be lost after the method. Content data is not be stored
- * on the file system or is not kept in the memory for the
- * following case:
- * - Attachement parts contents are accessed sequentially
- *
- * In general, take advantage of this when the data is used only
- * once.
- *
- * @return data for the part's content
- */
- public InputStream readOnce() {
- assert unconsumed();
- if (readOnce) {
- throw new IllegalStateException("readOnce() is called before. It can only be called once.");
- }
- readOnce = true;
- // Trigger parsing for the part
- while(tail == null) {
- if (!part.msg.makeProgress() && tail == null) {
- throw new IllegalStateException("No such Part: "+part);
- }
- }
- InputStream in = new ReadOnceStream();
- head = null;
- return in;
- }
-
- class ReadMultiStream extends InputStream {
- Chunk current;
- int offset;
- int len;
- byte[] buf;
-
- public ReadMultiStream() {
- this.current = head;
- len = current.data.size();
- buf = current.data.read();
- }
-
- @Override
- public int read(byte b[], int off, int sz) throws IOException {
- if(!fetch()) return -1;
-
- sz = Math.min(sz, len-offset);
- System.arraycopy(buf,offset,b,off,sz);
- offset += sz;
- return sz;
- }
-
- public int read() throws IOException {
- if (!fetch()) {
- return -1;
- }
- return (buf[offset++] & 0xff);
- }
-
- void adjustInMemoryUsage() {
- // Nothing to do in this case.
- }
-
- /**
- * Gets to the next chunk if we are done with the current one.
- * @return
- */
- private boolean fetch() {
- if (current == null) {
- throw new IllegalStateException("Stream already closed");
- }
- while(offset==len) {
- while(!part.parsed && current.next == null) {
- part.msg.makeProgress();
- }
- current = current.next;
-
- if (current == null) {
- return false;
- }
- adjustInMemoryUsage();
- this.offset = 0;
- this.buf = current.data.read();
- this.len = current.data.size();
- }
- return true;
- }
-
- public void close() throws IOException {
- super.close();
- current = null;
- }
- }
-
- final class ReadOnceStream extends ReadMultiStream {
-
- @Override
- void adjustInMemoryUsage() {
- synchronized(DataHead.this) {
- inMemory -= current.data.size(); // adjust current memory usage
- }
- }
-
- }
-
-
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FileData.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FileData.java
deleted file mode 100644
index 0e3da0f27a0..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FileData.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.nio.ByteBuffer;
-
-/**
- * Keeps the Part's partial content data in a file.
- *
- * @author Kohsuke Kawaguchi
- * @author Jitendra Kotamraju
- */
-final class FileData implements Data {
- private final DataFile file;
- private final long pointer; // read position
- private final int length;
-
- FileData(DataFile file, ByteBuffer buf) {
- this(file, file.writeTo(buf.array(), 0, buf.limit()), buf.limit());
- }
-
- FileData(DataFile file, long pointer, int length) {
- this.file = file;
- this.pointer = pointer;
- this.length = length;
- }
-
- public byte[] read() {
- byte[] buf = new byte[length];
- file.read(pointer, buf, 0, length);
- return buf;
- }
-
- /*
- * This shouldn't be called
- */
- public long writeTo(DataFile file) {
- throw new IllegalStateException();
- }
-
- public int size() {
- return length;
- }
-
- /*
- * Always create FileData
- */
- public Data createNext(DataHead dataHead, ByteBuffer buf) {
- return new FileData(file, buf);
- }
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FinalArrayList.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FinalArrayList.java
deleted file mode 100644
index d45fe32ef05..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/FinalArrayList.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-/**
- * {@link java.util.ArrayList} with the final keyword.
- *
- * <p>
- * This gives HotSpot a better hint that all methods can be inlined.
- *
- * @author Kohsuke Kawaguchi
- */
-final class FinalArrayList<T> extends ArrayList<T> {
- public FinalArrayList(int initialCapacity) {
- super(initialCapacity);
- }
-
- public FinalArrayList() {
- }
-
- public FinalArrayList(Collection<? extends T> ts) {
- super(ts);
- }
-}
-
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Header.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Header.java
deleted file mode 100644
index a4130841672..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/Header.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-/**
- * The Header class stores a name/value pair to represent headers.
- *
- * @author John Mani
- */
-
-public interface Header {
-
- /**
- * Returns the name of this header.
- *
- * @return name of the header
- */
- String getName();
-
- /**
- * Returns the value of this header.
- *
- * @return value of the header
- */
- String getValue();
-}
-
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/InternetHeaders.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/InternetHeaders.java
deleted file mode 100644
index 3b0f868e1b3..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/InternetHeaders.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.IOException;
-import java.util.NoSuchElementException;
-import java.util.List;
-
-/**
- * InternetHeaders is a utility class that manages RFC822 style
- * headers. Given an RFC822 format message stream, it reads lines
- * until the blank line that indicates end of header. The input stream
- * is positioned at the start of the body. The lines are stored
- * within the object and can be extracted as either Strings or
- * {@link Header} objects. <p>
- * <p/>
- * This class is mostly intended for service providers. MimeMessage
- * and MimeBody use this class for holding their headers. <p>
- * <p/>
- * <hr> <strong>A note on RFC822 and MIME headers</strong><p>
- * <p/>
- * RFC822 and MIME header fields <strong>must</strong> contain only
- * US-ASCII characters. If a header contains non US-ASCII characters,
- * it must be encoded as per the rules in RFC 2047. The MimeUtility
- * class provided in this package can be used to to achieve this.
- * Callers of the <code>setHeader</code>, <code>addHeader</code>, and
- * <code>addHeaderLine</code> methods are responsible for enforcing
- * the MIME requirements for the specified headers. In addition, these
- * header fields must be folded (wrapped) before being sent if they
- * exceed the line length limitation for the transport (1000 bytes for
- * SMTP). Received headers may have been folded. The application is
- * responsible for folding and unfolding headers as appropriate. <p>
- *
- * @author John Mani
- * @author Bill Shannon
- */
-final class InternetHeaders {
-
- private final FinalArrayList<hdr> headers = new FinalArrayList<hdr>();
-
- /**
- * Read and parse the given RFC822 message stream till the
- * blank line separating the header from the body. Store the
- * header lines inside this InternetHeaders object. <p>
- * <p/>
- * Note that the header lines are added into this InternetHeaders
- * object, so any existing headers in this object will not be
- * affected.
- *
- * @param lis RFC822 input stream
- */
- InternetHeaders(MIMEParser.LineInputStream lis) {
- // Read header lines until a blank line. It is valid
- // to have BodyParts with no header lines.
- String line;
- String prevline = null; // the previous header line, as a string
- // a buffer to accumulate the header in, when we know it's needed
- StringBuffer lineBuffer = new StringBuffer();
-
- try {
- //while ((line = lis.readLine()) != null) {
- do {
- line = lis.readLine();
- if (line != null &&
- (line.startsWith(" ") || line.startsWith("\t"))) {
- // continuation of header
- if (prevline != null) {
- lineBuffer.append(prevline);
- prevline = null;
- }
- lineBuffer.append("\r\n");
- lineBuffer.append(line);
- } else {
- // new header
- if (prevline != null)
- addHeaderLine(prevline);
- else if (lineBuffer.length() > 0) {
- // store previous header first
- addHeaderLine(lineBuffer.toString());
- lineBuffer.setLength(0);
- }
- prevline = line;
- }
- } while (line != null && line.length() > 0);
- } catch (IOException ioex) {
- throw new MIMEParsingException("Error in input stream", ioex);
- }
- }
-
- /**
- * Return all the values for the specified header. The
- * values are String objects. Returns <code>null</code>
- * if no headers with the specified name exist.
- *
- * @param name header name
- * @return array of header values, or null if none
- */
- List<String> getHeader(String name) {
- // XXX - should we just step through in index order?
- FinalArrayList<String> v = new FinalArrayList<String>(); // accumulate return values
-
- int len = headers.size();
- for( int i=0; i<len; i++ ) {
- hdr h = (hdr) headers.get(i);
- if (name.equalsIgnoreCase(h.name)) {
- v.add(h.getValue());
- }
- }
- return (v.size() == 0) ? null : v;
- }
-
- /**
- * Return all the headers as an Enumeration of
- * {@link Header} objects.
- *
- * @return Header objects
- */
- FinalArrayList<? extends Header> getAllHeaders() {
- return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here
- }
-
- /**
- * Add an RFC822 header line to the header store.
- * If the line starts with a space or tab (a continuation line),
- * add it to the last header line in the list. <p>
- * <p/>
- * Note that RFC822 headers can only contain US-ASCII characters
- *
- * @param line raw RFC822 header line
- */
- void addHeaderLine(String line) {
- try {
- char c = line.charAt(0);
- if (c == ' ' || c == '\t') {
- hdr h = (hdr) headers.get(headers.size() - 1);
- h.line += "\r\n" + line;
- } else
- headers.add(new hdr(line));
- } catch (StringIndexOutOfBoundsException e) {
- // line is empty, ignore it
- return;
- } catch (NoSuchElementException e) {
- // XXX - vector is empty?
- }
- }
-
-}
-
-/*
- * A private utility class to represent an individual header.
- */
-
-class hdr implements Header {
-
- String name; // the canonicalized (trimmed) name of this header
- // XXX - should name be stored in lower case?
- String line; // the entire RFC822 header "line"
-
- /*
- * Constructor that takes a line and splits out
- * the header name.
- */
- hdr(String l) {
- int i = l.indexOf(':');
- if (i < 0) {
- // should never happen
- name = l.trim();
- } else {
- name = l.substring(0, i).trim();
- }
- line = l;
- }
-
- /*
- * Constructor that takes a header name and value.
- */
- hdr(String n, String v) {
- name = n;
- line = n + ": " + v;
- }
-
- /*
- * Return the "name" part of the header line.
- */
- public String getName() {
- return name;
- }
-
- /*
- * Return the "value" part of the header line.
- */
- public String getValue() {
- int i = line.indexOf(':');
- if (i < 0)
- return line;
-
- int j;
- if (name.equalsIgnoreCase("Content-Description")) {
- // Content-Description should retain the folded whitespace after header unfolding -
- // rf. RFC2822 section 2.2.3, rf. RFC2822 section 3.2.3
- for (j = i + 1; j < line.length(); j++) {
- char c = line.charAt(j);
- if (!(/*c == ' ' ||*/c == '\t' || c == '\r' || c == '\n'))
- break;
- }
- } else {
- // skip whitespace after ':'
- for (j = i + 1; j < line.length(); j++) {
- char c = line.charAt(j);
- if (!(c == ' ' || c == '\t' || c == '\r' || c == '\n'))
- break;
- }
- }
- return line.substring(j);
- }
-}
-
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEConfig.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEConfig.java
deleted file mode 100644
index 9a8fed5a348..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEConfig.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * Configuration for MIME message parsing and storing.
- *
- * @author Jitendra Kotamraju
- */
-public class MIMEConfig {
-
- private static final int DEFAULT_CHUNK_SIZE = 8192;
- private static final long DEFAULT_MEMORY_THRESHOLD = 1048576L;
- private static final String DEFAULT_FILE_PREFIX = "MIME";
-
- // Parses the entire message eagerly
- boolean parseEagerly;
-
- // Approximate Chunk size
- int chunkSize;
-
- // Maximum in-memory data per attachment
- long memoryThreshold;
-
- // Do not store to disk
- boolean onlyMemory;
-
- // temp Dir to store large files
- File tempDir;
- String prefix;
- String suffix;
-
-
- private MIMEConfig(boolean parseEagerly, int chunkSize,
- long inMemoryThreshold, String dir, String prefix, String suffix) {
- this.parseEagerly = parseEagerly;
- this.chunkSize = chunkSize;
- this.memoryThreshold = inMemoryThreshold;
- this.prefix = prefix;
- this.suffix = suffix;
- setDir(dir);
- }
-
- public MIMEConfig() {
- this(false, DEFAULT_CHUNK_SIZE, DEFAULT_MEMORY_THRESHOLD, null,
- DEFAULT_FILE_PREFIX, null);
- }
-
- boolean isParseEagerly() {
- return parseEagerly;
- }
-
- public void setParseEagerly(boolean parseEagerly) {
- this.parseEagerly = parseEagerly;
- }
-
- int getChunkSize() {
- return chunkSize;
- }
-
- void setChunkSize(int chunkSize) {
- this.chunkSize = chunkSize;
- }
-
- long getMemoryThreshold() {
- return memoryThreshold;
- }
-
- /**
- * If the attachment is greater than the threshold, it is
- * written to the disk.
- *
- * @param memoryThreshold no of bytes per attachment
- * if -1, then the whole attachment is kept in memory
- */
- public void setMemoryThreshold(long memoryThreshold) {
- this.memoryThreshold = memoryThreshold;
- }
-
- boolean isOnlyMemory() {
- return memoryThreshold == -1L;
- }
-
- File getTempDir() {
- return tempDir;
- }
-
- String getTempFilePrefix() {
- return prefix;
- }
-
- String getTempFileSuffix() {
- return suffix;
- }
-
- /**
- * @param dir
- */
- public void setDir(String dir) {
- if (tempDir == null && dir != null && !dir.equals("")) {
- tempDir = new File(dir);
- }
- }
-
- /**
- * Validates if it can create temporary files. Otherwise, it stores
- * attachment contents in memory.
- */
- public void validate() {
- if (!isOnlyMemory()) {
- try {
- File tempFile = (tempDir == null)
- ? File.createTempFile(prefix, suffix)
- : File.createTempFile(prefix, suffix, tempDir);
- tempFile.delete();
- } catch(Exception ioe) {
- memoryThreshold = -1L; // whole attachment will be in-memory
- }
- }
- }
-
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEEvent.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEEvent.java
deleted file mode 100644
index 1b468844f5b..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEEvent.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.nio.ByteBuffer;
-
-/**
- * @author Jitendra Kotamraju
- */
-abstract class MIMEEvent {
-
- enum EVENT_TYPE {START_MESSAGE, START_PART, HEADERS, CONTENT, END_PART, END_MESSAGE}
-
- /**
- * Returns a event for parser's current cursor location in the MIME message.
- *
- * <p>
- * {@link EVENT_TYPE#START_MESSAGE} and {@link EVENT_TYPE#START_MESSAGE} events
- * are generated only once.
- *
- * <p>
- * {@link EVENT_TYPE#START_PART}, {@link EVENT_TYPE#END_PART}, {@link EVENT_TYPE#HEADERS}
- * events are generated only once for each attachment part.
- *
- * <p>
- * {@link EVENT_TYPE#CONTENT} event may be generated more than once for an attachment
- * part.
- *
- * @return event type
- */
- abstract EVENT_TYPE getEventType();
-
- static final StartMessage START_MESSAGE = new StartMessage();
- static final StartPart START_PART = new StartPart();
- static final EndPart END_PART = new EndPart();
- static final EndMessage END_MESSAGE = new EndMessage();
-
- static final class StartMessage extends MIMEEvent {
- EVENT_TYPE getEventType() {
- return EVENT_TYPE.START_MESSAGE;
- }
- }
-
- static final class StartPart extends MIMEEvent {
- EVENT_TYPE getEventType() {
- return EVENT_TYPE.START_PART;
- }
- }
-
- static final class EndPart extends MIMEEvent {
- EVENT_TYPE getEventType () {
- return EVENT_TYPE.END_PART;
- }
- }
-
- static final class Headers extends MIMEEvent {
- InternetHeaders ih;
-
- Headers(InternetHeaders ih) {
- this.ih = ih;
- }
-
- EVENT_TYPE getEventType() {
- return EVENT_TYPE.HEADERS;
- }
-
- InternetHeaders getHeaders() {
- return ih;
- }
- }
-
- static final class Content extends MIMEEvent {
- private final ByteBuffer buf;
-
- Content(ByteBuffer buf) {
- this.buf = buf;
- }
-
- EVENT_TYPE getEventType() {
- return EVENT_TYPE.CONTENT;
- }
-
- ByteBuffer getData() {
- return buf;
- }
- }
-
- static final class EndMessage extends MIMEEvent {
- EVENT_TYPE getEventType() {
- return EVENT_TYPE.END_MESSAGE;
- }
- }
-
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEMessage.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEMessage.java
deleted file mode 100644
index 9b903f47f58..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEMessage.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.nio.ByteBuffer;
-import java.util.*;
-import java.util.logging.Logger;
-
-/**
- * Represents MIME message. MIME message parsing is done lazily using a
- * pull parser.
- *
- * @author Jitendra Kotamraju
- */
-public class MIMEMessage {
- private static final Logger LOGGER = Logger.getLogger(MIMEMessage.class.getName());
-
- MIMEConfig config;
-
- private final InputStream in;
- private final List<MIMEPart> partsList;
- private final Map<String, MIMEPart> partsMap;
- private final Iterator<MIMEEvent> it;
- private boolean parsed; // true when entire message is parsed
- private MIMEPart currentPart;
- private int currentIndex;
-
- /**
- * @see MIMEMessage(InputStream, String, MIMEConfig)
- */
- public MIMEMessage(InputStream in, String boundary) {
- this(in, boundary, new MIMEConfig());
- }
-
- /**
- * Creates a MIME message from the content's stream. The content stream
- * is closed when EOF is reached.
- *
- * @param in MIME message stream
- * @param boundary the separator for parts(pass it without --)
- * @param config various configuration parameters
- */
- public MIMEMessage(InputStream in, String boundary, MIMEConfig config) {
- this.in = in;
- this.config = config;
- MIMEParser parser = new MIMEParser(in, boundary, config);
- it = parser.iterator();
-
- partsList = new ArrayList<MIMEPart>();
- partsMap = new HashMap<String, MIMEPart>();
- if (config.isParseEagerly()) {
- parseAll();
- }
- }
-
- /**
- * Gets all the attachments by parsing the entire MIME message. Avoid
- * this if possible since it is an expensive operation.
- *
- * @return list of attachments.
- */
- public List<MIMEPart> getAttachments() {
- if (!parsed) {
- parseAll();
- }
- return partsList;
- }
-
- /**
- * Creates nth attachment lazily. It doesn't validate
- * if the message has so many attachments. To
- * do the validation, the message needs to be parsed.
- * The parsing of the message is done lazily and is done
- * while reading the bytes of the part.
- *
- * @param index sequential order of the part. starts with zero.
- * @return attachemnt part
- */
- public MIMEPart getPart(int index) {
- LOGGER.fine("index="+index);
- MIMEPart part = (index < partsList.size()) ? partsList.get(index) : null;
- if (parsed && part == null) {
- throw new MIMEParsingException("There is no "+index+" attachment part ");
- }
- if (part == null) {
- // Parsing will done lazily and will be driven by reading the part
- part = new MIMEPart(this);
- partsList.add(index, part);
- }
- LOGGER.fine("Got attachment at index="+index+" attachment="+part);
- return part;
- }
-
- /**
- * Creates a lazy attachment for a given Content-ID. It doesn't validate
- * if the message contains an attachment with the given Content-ID. To
- * do the validation, the message needs to be parsed. The parsing of the
- * message is done lazily and is done while reading the bytes of the part.
- *
- * @param contentId Content-ID of the part, expects Content-ID without <, >
- * @return attachemnt part
- */
- public MIMEPart getPart(String contentId) {
- LOGGER.fine("Content-ID="+contentId);
- MIMEPart part = getDecodedCidPart(contentId);
- if (parsed && part == null) {
- throw new MIMEParsingException("There is no attachment part with Content-ID = "+contentId);
- }
- if (part == null) {
- // Parsing is done lazily and is driven by reading the part
- part = new MIMEPart(this, contentId);
- partsMap.put(contentId, part);
- }
- LOGGER.fine("Got attachment for Content-ID="+contentId+" attachment="+part);
- return part;
- }
-
- // this is required for Indigo interop, it writes content-id without escaping
- private MIMEPart getDecodedCidPart(String cid) {
- MIMEPart part = partsMap.get(cid);
- if (part == null) {
- if (cid.indexOf('%') != -1) {
- try {
- String tempCid = URLDecoder.decode(cid, "utf-8");
- part = partsMap.get(tempCid);
- } catch(UnsupportedEncodingException ue) {
- // Ignore it
- }
- }
- }
- return part;
- }
-
-
- /**
- * Parses the whole MIME message eagerly
- */
- public void parseAll() {
- while(makeProgress()) {
- // Nothing to do
- }
- }
-
-
- /**
- * Parses the MIME message in a pull fashion.
- *
- * @return
- * false if the parsing is completed.
- */
- public synchronized boolean makeProgress() {
- if (!it.hasNext()) {
- return false;
- }
-
- MIMEEvent event = it.next();
-
- switch(event.getEventType()) {
- case START_MESSAGE :
- LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.START_MESSAGE);
- break;
-
- case START_PART :
- LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.START_PART);
- break;
-
- case HEADERS :
- LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.HEADERS);
- MIMEEvent.Headers headers = (MIMEEvent.Headers)event;
- InternetHeaders ih = headers.getHeaders();
- List<String> cids = ih.getHeader("content-id");
- String cid = (cids != null) ? cids.get(0) : currentIndex+"";
- if (cid.length() > 2 && cid.charAt(0)=='<') {
- cid = cid.substring(1,cid.length()-1);
- }
- MIMEPart listPart = (currentIndex < partsList.size()) ? partsList.get(currentIndex) : null;
- MIMEPart mapPart = getDecodedCidPart(cid);
- if (listPart == null && mapPart == null) {
- currentPart = getPart(cid);
- partsList.add(currentIndex, currentPart);
- } else if (listPart == null) {
- currentPart = mapPart;
- partsList.add(currentIndex, mapPart);
- } else if (mapPart == null) {
- currentPart = listPart;
- currentPart.setContentId(cid);
- partsMap.put(cid, currentPart);
- } else if (listPart != mapPart) {
- throw new MIMEParsingException("Created two different attachments using Content-ID and index");
- }
- currentPart.setHeaders(ih);
- break;
-
- case CONTENT :
- LOGGER.finer("MIMEEvent="+MIMEEvent.EVENT_TYPE.CONTENT);
- MIMEEvent.Content content = (MIMEEvent.Content)event;
- ByteBuffer buf = content.getData();
- currentPart.addBody(buf);
- break;
-
- case END_PART :
- LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.END_PART);
- currentPart.doneParsing();
- ++currentIndex;
- break;
-
- case END_MESSAGE :
- LOGGER.fine("MIMEEvent="+MIMEEvent.EVENT_TYPE.END_MESSAGE);
- parsed = true;
- try {
- in.close();
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- break;
-
- default :
- throw new MIMEParsingException("Unknown Parser state = "+event.getEventType());
- }
- return true;
- }
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParser.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParser.java
deleted file mode 100644
index 4c78c3f4094..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParser.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.InputStream;
-import java.io.IOException;
-import java.util.*;
-import java.util.logging.Logger;
-import java.nio.ByteBuffer;
-
-/**
- * Pull parser for the MIME messages. Applications can use pull API to continue
- * the parsing MIME messages lazily.
- *
- * <pre>
- * for e.g.:
- * <p>
- *
- * MIMEParser parser = ...
- * Iterator<MIMEEvent> it = parser.iterator();
- * while(it.hasNext()) {
- * MIMEEvent event = it.next();
- * ...
- * }
- * </pre>
- *
- * @author Jitendra Kotamraju
- */
-class MIMEParser implements Iterable<MIMEEvent> {
-
- private static final Logger LOGGER = Logger.getLogger(MIMEParser.class.getName());
-
- // Actually, the grammar doesn't support whitespace characters
- // after boundary. But the mail implementation checks for it.
- // We will only check for these many whitespace characters after boundary
- private static final int NO_LWSP = 1000;
- private enum STATE {START_MESSAGE, SKIP_PREAMBLE, START_PART, HEADERS, BODY, END_PART, END_MESSAGE}
- private STATE state = STATE.START_MESSAGE;
-
- private final InputStream in;
- private final byte[] bndbytes;
- private final int bl;
- private final MIMEConfig config;
- private final int[] bcs = new int[128]; // BnM algo: Bad Character Shift table
- private final int[] gss; // BnM algo : Good Suffix Shift table
-
- /**
- * Have we parsed the data from our InputStream yet?
- */
- private boolean parsed;
-
- /*
- * Read and process body partsList until we see the
- * terminating boundary line (or EOF).
- */
- private boolean done = false;
-
- private boolean eof;
- private final int capacity;
- private byte[] buf;
- private int len;
- private boolean bol; // beginning of the line
-
- /*
- * Parses the MIME content. At the EOF, it also closes input stream
- */
- MIMEParser(InputStream in, String boundary, MIMEConfig config) {
- this.in = in;
- this.bndbytes = getBytes("--"+boundary);
- bl = bndbytes.length;
- this.config = config;
- gss = new int[bl];
- compileBoundaryPattern();
-
- // \r\n + boundary + "--\r\n" + lots of LWSP
- capacity = config.chunkSize+2+bl+4+NO_LWSP;
- createBuf(capacity);
- }
-
- /**
- * Returns iterator for the parsing events. Use the iterator to advance
- * the parsing.
- *
- * @return iterator for parsing events
- */
- public Iterator<MIMEEvent> iterator() {
- return new MIMEEventIterator();
- }
-
- class MIMEEventIterator implements Iterator<MIMEEvent> {
-
- public boolean hasNext() {
- return !parsed;
- }
-
- public MIMEEvent next() {
- switch(state) {
- case START_MESSAGE :
- LOGGER.finer("MIMEParser state="+STATE.START_MESSAGE);
- state = STATE.SKIP_PREAMBLE;
- return MIMEEvent.START_MESSAGE;
-
- case SKIP_PREAMBLE :
- LOGGER.finer("MIMEParser state="+STATE.SKIP_PREAMBLE);
- skipPreamble();
- // fall through
- case START_PART :
- LOGGER.finer("MIMEParser state="+STATE.START_PART);
- state = STATE.HEADERS;
- return MIMEEvent.START_PART;
-
- case HEADERS :
- LOGGER.finer("MIMEParser state="+STATE.HEADERS);
- InternetHeaders ih = readHeaders();
- state = STATE.BODY;
- bol = true;
- return new MIMEEvent.Headers(ih);
-
- case BODY :
- LOGGER.finer("MIMEParser state="+STATE.BODY);
- ByteBuffer buf = readBody();
- bol = false;
- return new MIMEEvent.Content(buf);
-
- case END_PART :
- LOGGER.finer("MIMEParser state="+STATE.END_PART);
- if (done) {
- state = STATE.END_MESSAGE;
- } else {
- state = STATE.START_PART;
- }
- return MIMEEvent.END_PART;
-
- case END_MESSAGE :
- LOGGER.finer("MIMEParser state="+STATE.END_MESSAGE);
- parsed = true;
- return MIMEEvent.END_MESSAGE;
-
- default :
- throw new MIMEParsingException("Unknown Parser state = "+state);
- }
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Collects the headers for the current part by parsing mesage stream.
- *
- * @return headers for the current part
- */
- private InternetHeaders readHeaders() {
- if (!eof) {
- fillBuf();
- }
- return new InternetHeaders(new LineInputStream());
- }
-
- /**
- * Reads and saves the part of the current attachment part's content.
- * At the end of this method, buf should have the remaining data
- * at index 0.
- *
- * @return a chunk of the part's content
- *
- */
- private ByteBuffer readBody() {
- if (!eof) {
- fillBuf();
- }
- int start = match(buf, 0, len); // matches boundary
- if (start == -1) {
- // No boundary is found
- assert eof || len >= config.chunkSize;
- int chunkSize = eof ? len : config.chunkSize;
- if (eof) {
- // Should we throw exception as there is no closing boundary ? But some impl
- // like SAAJ do not throw excpetion.
- // throw new MIMEParsingException("Reached EOF, but there is no closing MIME boundary.");
- done = true;
- state = STATE.END_PART;
- }
- return adjustBuf(chunkSize, len-chunkSize);
- }
- // Found boundary.
- // Is it at the start of a line ?
- int chunkLen = start;
- if (bol && start == 0) {
- // nothing to do
- } else if (start > 0 && (buf[start-1] == '\n' || buf[start-1] =='\r')) {
- --chunkLen;
- if (buf[start-1] == '\n' && start >1 && buf[start-2] == '\r') {
- --chunkLen;
- }
- } else {
- return adjustBuf(start+1, len-start-1); // boundary is not at beginning of a line
- }
-
- if (start+bl+1 < len && buf[start+bl] == '-' && buf[start+bl+1] == '-') {
- state = STATE.END_PART;
- done = true;
- return adjustBuf(chunkLen, 0);
- }
-
- // Consider all the whitespace in boundary+whitespace+"\r\n"
- int lwsp = 0;
- for(int i=start+bl; i < len && (buf[i] == ' ' || buf[i] == '\t'); i++) {
- ++lwsp;
- }
-
- // Check for \n or \r\n in boundary+whitespace+"\n" or boundary+whitespace+"\r\n"
- if (start+bl+lwsp < len && buf[start+bl+lwsp] == '\n') {
- state = STATE.END_PART;
- return adjustBuf(chunkLen, len-start-bl-lwsp-1);
- } else if (start+bl+lwsp+1 < len && buf[start+bl+lwsp] == '\r' && buf[start+bl+lwsp+1] == '\n') {
- state = STATE.END_PART;
- return adjustBuf(chunkLen, len-start-bl-lwsp-2);
- } else if (start+bl+lwsp+1 < len) {
- return adjustBuf(chunkLen+1, len-chunkLen-1); // boundary string in a part data
- } else if (eof) {
- done = true;
- state = STATE.END_PART;
- return adjustBuf(chunkLen, 0);
- // Should we throw exception as there is no closing boundary ? But some impl
- // like SAAJ do not throw excpetion.
- //throw new MIMEParsingException("Reached EOF, but there is no closing MIME boundary.");
- }
-
- // Some more data needed to determine if it is indeed a proper boundary
- return adjustBuf(chunkLen, len-chunkLen);
- }
-
- /**
- * Returns a chunk from the original buffer. A new buffer is
- * created with the remaining bytes.
- *
- * @param chunkSize create a chunk with these many bytes
- * @param remaining bytes from the end of the buffer that need to be copied to
- * the beginning of the new buffer
- * @return chunk
- */
- private ByteBuffer adjustBuf(int chunkSize, int remaining) {
- assert buf != null;
- assert chunkSize >= 0;
- assert remaining >= 0;
-
- byte[] temp = buf;
- // create a new buf and adjust it without this chunk
- createBuf(remaining);
- System.arraycopy(temp, len-remaining, buf, 0, remaining);
- len = remaining;
-
- return ByteBuffer.wrap(temp, 0, chunkSize);
- }
-
- private void createBuf(int min) {
- buf = new byte[min < capacity ? capacity : min];
- }
-
- /**
- * Skips the preamble to find the first attachment part
- */
- private void skipPreamble() {
-
- while(true) {
- if (!eof) {
- fillBuf();
- }
- int start = match(buf, 0, len); // matches boundary
- if (start == -1) {
- // No boundary is found
- if (eof) {
- throw new MIMEParsingException("Missing start boundary");
- } else {
- adjustBuf(len-bl+1, bl-1);
- continue;
- }
- }
-
- if (start > config.chunkSize) {
- adjustBuf(start, len-start);
- continue;
- }
- // Consider all the whitespace boundary+whitespace+"\r\n"
- int lwsp = 0;
- for(int i=start+bl; i < len && (buf[i] == ' ' || buf[i] == '\t'); i++) {
- ++lwsp;
- }
- // Check for \n or \r\n
- if (start+bl+lwsp < len && (buf[start+bl+lwsp] == '\n' || buf[start+bl+lwsp] == '\r') ) {
- if (buf[start+bl+lwsp] == '\n') {
- adjustBuf(start+bl+lwsp+1, len-start-bl-lwsp-1);
- break;
- } else if (start+bl+lwsp+1 < len && buf[start+bl+lwsp+1] == '\n') {
- adjustBuf(start+bl+lwsp+2, len-start-bl-lwsp-2);
- break;
- }
- }
- adjustBuf(start+1, len-start-1);
- }
- LOGGER.fine("Skipped the preamble. buffer len="+len);
- }
-
- private static byte[] getBytes(String s) {
- char [] chars= s.toCharArray();
- int size = chars.length;
- byte[] bytes = new byte[size];
-
- for (int i = 0; i < size;)
- bytes[i] = (byte) chars[i++];
- return bytes;
- }
-
- /**
- * Boyer-Moore search method. Copied from java.util.regex.Pattern.java
- *
- * Pre calculates arrays needed to generate the bad character
- * shift and the good suffix shift. Only the last seven bits
- * are used to see if chars match; This keeps the tables small
- * and covers the heavily used ASCII range, but occasionally
- * results in an aliased match for the bad character shift.
- */
- private void compileBoundaryPattern() {
- int i, j;
-
- // Precalculate part of the bad character shift
- // It is a table for where in the pattern each
- // lower 7-bit value occurs
- for (i = 0; i < bndbytes.length; i++) {
- bcs[bndbytes[i]&0x7F] = i + 1;
- }
-
- // Precalculate the good suffix shift
- // i is the shift amount being considered
-NEXT: for (i = bndbytes.length; i > 0; i--) {
- // j is the beginning index of suffix being considered
- for (j = bndbytes.length - 1; j >= i; j--) {
- // Testing for good suffix
- if (bndbytes[j] == bndbytes[j-i]) {
- // src[j..len] is a good suffix
- gss[j-1] = i;
- } else {
- // No match. The array has already been
- // filled up with correct values before.
- continue NEXT;
- }
- }
- // This fills up the remaining of optoSft
- // any suffix can not have larger shift amount
- // then its sub-suffix. Why???
- while (j > 0) {
- gss[--j] = i;
- }
- }
- // Set the guard value because of unicode compression
- gss[bndbytes.length -1] = 1;
- }
-
- /**
- * Finds the boundary in the given buffer using Boyer-Moore algo.
- * Copied from java.util.regex.Pattern.java
- *
- * @param mybuf boundary to be searched in this mybuf
- * @param off start index in mybuf
- * @param len number of bytes in mybuf
- *
- * @return -1 if there is no match or index where the match starts
- */
- private int match(byte[] mybuf, int off, int len) {
- int last = len - bndbytes.length;
-
- // Loop over all possible match positions in text
-NEXT: while (off <= last) {
- // Loop over pattern from right to left
- for (int j = bndbytes.length - 1; j >= 0; j--) {
- byte ch = mybuf[off+j];
- if (ch != bndbytes[j]) {
- // Shift search to the right by the maximum of the
- // bad character shift and the good suffix shift
- off += Math.max(j + 1 - bcs[ch&0x7F], gss[j]);
- continue NEXT;
- }
- }
- // Entire pattern matched starting at off
- return off;
- }
- return -1;
- }
-
- /**
- * Fills the remaining buf to the full capacity
- */
- private void fillBuf() {
- LOGGER.finer("Before fillBuf() buffer len="+len);
- assert !eof;
- while(len < buf.length) {
- int read;
- try {
- read = in.read(buf, len, buf.length-len);
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- if (read == -1) {
- eof = true;
- try {
- LOGGER.fine("Closing the input stream.");
- in.close();
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- break;
- } else {
- len += read;
- }
- }
- LOGGER.finer("After fillBuf() buffer len="+len);
- }
-
- private void doubleBuf() {
- byte[] temp = new byte[2*len];
- System.arraycopy(buf, 0, temp, 0, len);
- buf = temp;
- if (!eof) {
- fillBuf();
- }
- }
-
- class LineInputStream {
- private int offset;
-
- /*
- * Read a line containing only ASCII characters from the input
- * stream. A line is terminated by a CR or NL or CR-NL sequence.
- * A common error is a CR-CR-NL sequence, which will also terminate
- * a line.
- * The line terminator is not returned as part of the returned
- * String. Returns null if no data is available. <p>
- *
- * This class is similar to the deprecated
- * <code>DataInputStream.readLine()</code>
- */
- public String readLine() throws IOException {
-
- int hdrLen = 0;
- int lwsp = 0;
- while(offset+hdrLen < len) {
- if (buf[offset+hdrLen] == '\n') {
- lwsp = 1;
- break;
- }
- if (offset+hdrLen+1 == len) {
- doubleBuf();
- }
- if (offset+hdrLen+1 >= len) { // No more data in the stream
- assert eof;
- return null;
- }
- if (buf[offset+hdrLen] == '\r' && buf[offset+hdrLen+1] == '\n') {
- lwsp = 2;
- break;
- }
- ++hdrLen;
- }
- if (hdrLen == 0) {
- adjustBuf(offset+lwsp, len-offset-lwsp);
- return null;
- }
-
- String hdr = new String(buf, offset, hdrLen);
- offset += hdrLen+lwsp;
- return hdr;
- }
-
- }
-
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParsingException.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParsingException.java
deleted file mode 100644
index 8c5985408f6..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEParsingException.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-/**
- * @author Jitendra Kotamraju
- */
-
-/**
- * The <code>MIMEParsingException</code> class is the base
- * exception class for all MIME message parsing exceptions.
- *
- */
-
-public class MIMEParsingException extends java.lang.RuntimeException {
-
- /**
- * Constructs a new exception with <code>null</code> as its
- * detail message. The cause is not initialized.
- */
- public MIMEParsingException() {
- super();
- }
-
- /**
- * Constructs a new exception with the specified detail
- * message. The cause is not initialized.
- *
- * @param message The detail message which is later
- * retrieved using the getMessage method
- */
- public MIMEParsingException(String message) {
- super(message);
- }
-
- /**
- * Constructs a new exception with the specified detail
- * message and cause.
- *
- * @param message The detail message which is later retrieved
- * using the getMessage method
- * @param cause The cause which is saved for the later
- * retrieval throw by the getCause method
- */
- public MIMEParsingException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs a new WebServiceException with the specified cause
- * and a detail message of <tt>(cause==null ? null :
- * cause.toString())</tt> (which typically contains the
- * class and detail message of <tt>cause</tt>).
- *
- * @param cause The cause which is saved for the later
- * retrieval throw by the getCause method.
- * (A <tt>null</tt> value is permitted, and
- * indicates that the cause is nonexistent or
- * unknown.)
- */
- public MIMEParsingException(Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEPart.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEPart.java
deleted file mode 100644
index 890f2972caf..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MIMEPart.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.File;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.util.List;
-
-/**
- * Represents an attachment part in a MIME message. MIME message parsing is done
- * lazily using a pull parser, so the part may not have all the data. {@link #read}
- * and {@link #readOnce} may trigger the actual parsing the message. In fact,
- * parsing of an attachment part may be triggered by calling {@link #read} methods
- * on some other attachemnt parts. All this happens behind the scenes so the
- * application developer need not worry about these details.
- *
- * @author Jitendra Kotamraju
- */
-public class MIMEPart {
-
- private volatile InternetHeaders headers;
- private volatile String contentId;
- private String contentType;
- volatile boolean parsed; // part is parsed or not
- final MIMEMessage msg;
- private final DataHead dataHead;
-
- MIMEPart(MIMEMessage msg) {
- this.msg = msg;
- this.dataHead = new DataHead(this);
- }
-
- MIMEPart(MIMEMessage msg, String contentId) {
- this(msg);
- this.contentId = contentId;
- }
-
- /**
- * Can get the attachment part's content multiple times. That means
- * the full content needs to be there in memory or on the file system.
- * Calling this method would trigger parsing for the part's data. So
- * do not call this unless it is required(otherwise, just wrap MIMEPart
- * into a object that returns InputStream for e.g DataHandler)
- *
- * @return data for the part's content
- */
- public InputStream read() {
- return dataHead.read();
- }
-
- /**
- * Cleans up any resources that are held by this part (for e.g. deletes
- * the temp file that is used to serve this part's content). After
- * calling this, one shouldn't call {@link #read()} or {@link #readOnce()}
- */
- public void close() {
- dataHead.close();
- }
-
-
- /**
- * Can get the attachment part's content only once. The content
- * will be lost after the method. Content data is not be stored
- * on the file system or is not kept in the memory for the
- * following case:
- * - Attachement parts contents are accessed sequentially
- *
- * In general, take advantage of this when the data is used only
- * once.
- *
- * @return data for the part's content
- */
- public InputStream readOnce() {
- return dataHead.readOnce();
- }
-
- public void moveTo(File f) {
- dataHead.moveTo(f);
- }
-
- /**
- * Returns Content-ID MIME header for this attachment part
- *
- * @return Content-ID of the part
- */
- public String getContentId() {
- if (contentId == null) {
- getHeaders();
- }
- return contentId;
- }
-
- /**
- * Returns Content-Type MIME header for this attachment part
- *
- * @return Content-Type of the part
- */
- public String getContentType() {
- if (contentType == null) {
- getHeaders();
- }
- return contentType;
- }
-
- private void getHeaders() {
- // Trigger parsing for the part headers
- while(headers == null) {
- if (!msg.makeProgress()) {
- if (headers == null) {
- throw new IllegalStateException("Internal Error. Didn't get Headers even after complete parsing.");
- }
- }
- }
- }
-
- /**
- * Return all the values for the specified header.
- * Returns <code>null</code> if no headers with the
- * specified name exist.
- *
- * @param name header name
- * @return list of header values, or null if none
- */
- public List<String> getHeader(String name) {
- getHeaders();
- assert headers != null;
- return headers.getHeader(name);
- }
-
- /**
- * Return all the headers
- *
- * @return list of Header objects
- */
- public List<? extends Header> getAllHeaders() {
- getHeaders();
- assert headers != null;
- return headers.getAllHeaders();
- }
-
- /**
- * Callback to set headers
- *
- * @param headers MIME headers for the part
- */
- void setHeaders(InternetHeaders headers) {
- this.headers = headers;
- List<String> ct = getHeader("Content-Type");
- this.contentType = (ct == null) ? "application/octet-stream" : ct.get(0);
- }
-
- /**
- * Callback to notify that there is a partial content for the part
- *
- * @param buf content data for the part
- */
- void addBody(ByteBuffer buf) {
- dataHead.addBody(buf);
- }
-
- /**
- * Callback to indicate that parsing is done for this part
- * (no more update events for this part)
- */
- void doneParsing() {
- parsed = true;
- dataHead.doneParsing();
- }
-
- /**
- * Callback to set Content-ID for this part
- * @param cid Content-ID of the part
- */
- void setContentId(String cid) {
- this.contentId = cid;
- }
-
- @Override
- public String toString() {
- return "Part="+contentId;
- }
-
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MemoryData.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MemoryData.java
deleted file mode 100644
index de3282d4082..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/MemoryData.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.nio.ByteBuffer;
-import java.io.File;
-import java.io.IOException;
-import java.util.logging.Logger;
-
-/**
- * Keeps the Part's partial content data in memory.
- *
- * @author Kohsuke Kawaguchi
- * @author Jitendra Kotamraju
- */
-final class MemoryData implements Data {
- private static final Logger LOGGER = Logger.getLogger(MemoryData.class.getName());
-
- private final byte[] data;
- private final int len;
- private final MIMEConfig config;
-
- MemoryData(ByteBuffer buf, MIMEConfig config) {
- data = buf.array();
- len = buf.limit();
- this.config = config;
- }
-
- // size of the chunk given by the parser
- public int size() {
- return len;
- }
-
- public byte[] read() {
- return data;
- }
-
- public long writeTo(DataFile file) {
- return file.writeTo(data, 0, len);
- }
-
- /**
- *
- * @param dataHead
- * @param buf
- * @return
- */
- public Data createNext(DataHead dataHead, ByteBuffer buf) {
- if (!config.isOnlyMemory() && dataHead.inMemory >= config.memoryThreshold) {
- try {
- String prefix = config.getTempFilePrefix();
- String suffix = config.getTempFileSuffix();
- File dir = config.getTempDir();
- File tempFile = (dir == null)
- ? File.createTempFile(prefix, suffix)
- : File.createTempFile(prefix, suffix, dir);
- LOGGER.fine("Created temp file = "+tempFile);
- dataHead.dataFile = new DataFile(tempFile);
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
-
- if (dataHead.head != null) {
- for(Chunk c=dataHead.head; c != null; c=c.next) {
- long pointer = c.data.writeTo(dataHead.dataFile);
- c.data = new FileData(dataHead.dataFile, pointer, len);
- }
- }
- return new FileData(dataHead.dataFile, buf);
- } else {
- return new MemoryData(buf, config);
- }
- }
-}
diff --git a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/WeakDataFile.java b/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/WeakDataFile.java
deleted file mode 100644
index 7bab6116b44..00000000000
--- a/plugins/org.jvnet.mimepull.source/org/jvnet/mimepull/WeakDataFile.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
- *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package org.jvnet.mimepull;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-/**
- * Removing files based on this
- * <a href="http://java.sun.com/developer/technicalArticles/javase/finalization/">article</a>
- *
- * @author Jitendra Kotamraju
- */
-final class WeakDataFile extends WeakReference<DataFile> {
-
- private static final Logger LOGGER = Logger.getLogger(WeakDataFile.class.getName());
- private static final int MAX_ITERATIONS = 2;
- private static ReferenceQueue<DataFile> refQueue = new ReferenceQueue<DataFile>();
- private static List<WeakDataFile> refList = new ArrayList<WeakDataFile>();
- private final File file;
- private final RandomAccessFile raf;
-
- WeakDataFile(DataFile df, File file) {
- super(df, refQueue);
- refList.add(this);
- this.file = file;
- try {
- raf = new RandomAccessFile(file, "rw");
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- drainRefQueueBounded();
- }
-
- synchronized void read(long pointer, byte[] buf, int offset, int length ) {
- try {
- raf.seek(pointer);
- raf.readFully(buf, offset, length);
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- }
-
- synchronized long writeTo(long pointer, byte[] data, int offset, int length) {
- try {
- raf.seek(pointer);
- raf.write(data, offset, length);
- return raf.getFilePointer(); // Update pointer for next write
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- }
-
- void close() {
- LOGGER.fine("Deleting file = "+file.getName());
- refList.remove(this);
- try {
- raf.close();
- file.delete();
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
- }
-
- void renameTo(File f) {
- LOGGER.fine("Moving file="+file+" to="+f);
- refList.remove(this);
- try {
- raf.close();
- file.renameTo(f);
- } catch(IOException ioe) {
- throw new MIMEParsingException(ioe);
- }
-
- }
-
- static void drainRefQueueBounded() {
- int iterations = 0;
- WeakDataFile weak = (WeakDataFile) refQueue.poll();
- while (weak != null && iterations < MAX_ITERATIONS) {
- LOGGER.fine("Cleaning file = "+weak.file+" from reference queue.");
- weak.close();
- ++iterations;
- weak = (WeakDataFile) refQueue.poll();
- }
- }
-
-}
diff --git a/plugins/org.jvnet.mimepull/.classpath b/plugins/org.jvnet.mimepull/.classpath
deleted file mode 100644
index 14b8c6f6a4b..00000000000
--- a/plugins/org.jvnet.mimepull/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry exported="true" kind="lib" path="" sourcepath="/org.jvnet.mimepull.source"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.jvnet.mimepull/.project b/plugins/org.jvnet.mimepull/.project
deleted file mode 100644
index 9416a289479..00000000000
--- a/plugins/org.jvnet.mimepull/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.jvnet.mimepull</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.jvnet.mimepull/META-INF/MANIFEST.MF b/plugins/org.jvnet.mimepull/META-INF/MANIFEST.MF
deleted file mode 100644
index 06541693b5f..00000000000
--- a/plugins/org.jvnet.mimepull/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,8 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Mimepull
-Bundle-SymbolicName: org.jvnet.mimepull
-Bundle-Version: 1.5.0.qualifier
-Bundle-Vendor: mimepull.java.net
-Export-Package: org.jvnet.mimepull;version="1.5.0.qualifier"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.properties b/plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.properties
deleted file mode 100644
index cd137fba8fd..00000000000
--- a/plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-#Generated by Maven
-#Wed Nov 17 18:54:38 PST 2010
-version=1.5
-groupId=org.jvnet
-artifactId=mimepull
diff --git a/plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.xml b/plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.xml
deleted file mode 100644
index e8ba92d96e9..00000000000
--- a/plugins/org.jvnet.mimepull/META-INF/maven/org.jvnet/mimepull/pom.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jvnet</groupId>
- <artifactId>mimepull</artifactId>
- <version>1.5</version>
- <packaging>jar</packaging>
-
- <name>MIME streaming extension</name>
- <description>
- Provides a streaming API to access attachments parts in a MIME message.
- </description>
- <organization>
- <name>Oracle Corporation</name>
- <url>http://www.oracle.com/</url>
- </organization>
- <scm>
- <connection>scm:svn:https://svn.java.net/svn/mimepull~svn/tags/mimepull-1.5</connection>
- <developerConnection>scm:svn:https://svn.java.net/svn/mimepull~svn/tags/mimepull-1.5</developerConnection>
- <url>http://java.net/projects/mimepull/sources/svn/show/tags/mimepull-1.5</url>
- </scm>
- <issueManagement>
- <system>jira</system>
- <url>http://java.net/jira/browse/mimepull</url>
- </issueManagement>
- <mailingLists>
- <mailingList>
- <name>mimepull Users List</name>
- <archive>http://java.net/projects/mimepull/lists/users/archive</archive>
- <post>users@mimepull.java.net</post>
- </mailingList>
- <mailingList>
- <name>mimepull Developers List</name>
- <archive>http://java.net/projects/mimepull/lists/dev/archive</archive>
- <post>dev@mimepull.java.net</post>
- </mailingList>
- </mailingLists>
- <licenses>
- <license>
- <name>
- Dual license consisting of the CDDL v1.1 and GPL v2
- </name>
- <url>https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
- <repositories>
- <repository>
- <id>java.net</id>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- <repository>
- <id>java.net2</id>
- <url>http://download.java.net/maven/2</url>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>java.net2.plugin</id>
- <url>http://download.java.net/maven/2</url>
- </pluginRepository>
- <!--pluginRepository>
- <id>felix.repo</id>
- <url-->
- </pluginRepositories>
-
- <distributionManagement>
- <repository>
- <uniqueVersion>false</uniqueVersion>
- <id>java.net-maven2-repository</id>
- <url>java-net:/maven2-repository/trunk/repository</url>
- </repository>
- <site>
- <id>mimepull-www</id>
- <url>java-net:/mimepull/trunk/www/</url>
- </site>
- </distributionManagement>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-idea-plugin</artifactId>
- <configuration>
- <jdkName>JDK1.5</jdkName>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <descriptorRefs>
- <descriptorRef>src</descriptorRef>
- <descriptorRef>bin</descriptorRef>
- </descriptorRefs>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>2.0.0</version>
- <executions>
- <execution>
- <id>bundle-manifest</id>
- <phase>process-classes</phase>
- <goals>
- <goal>manifest</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <extensions>
- <extension>
- <groupId>org.jvnet.wagon-svn</groupId>
- <artifactId>wagon-svn</artifactId>
- <version>1.11</version>
- </extension>
- </extensions>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git a/plugins/org.jvnet.mimepull/build.properties b/plugins/org.jvnet.mimepull/build.properties
deleted file mode 100644
index 1ac73badbfe..00000000000
--- a/plugins/org.jvnet.mimepull/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-output.. = .
-bin.includes = META-INF/,\
- org/
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Chunk.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Chunk.class
deleted file mode 100644
index c4d6f23929a..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Chunk.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/ChunkInputStream.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/ChunkInputStream.class
deleted file mode 100644
index 6c402c853e6..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/ChunkInputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Data.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Data.class
deleted file mode 100644
index fb55aa2e4db..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Data.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataFile.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataFile.class
deleted file mode 100644
index 5a9fb356e2c..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataFile.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadMultiStream.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadMultiStream.class
deleted file mode 100644
index 2e3916b1553..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadMultiStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadOnceStream.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadOnceStream.class
deleted file mode 100644
index e3201d90138..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead$ReadOnceStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead.class
deleted file mode 100644
index 76d10f47fd8..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/DataHead.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/FileData.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/FileData.class
deleted file mode 100644
index f10c54431d3..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/FileData.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/FinalArrayList.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/FinalArrayList.class
deleted file mode 100644
index 743a3a7fc4a..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/FinalArrayList.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Header.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Header.class
deleted file mode 100644
index bde8863e200..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/Header.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/InternetHeaders.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/InternetHeaders.class
deleted file mode 100644
index fce054d52c8..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/InternetHeaders.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEConfig.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEConfig.class
deleted file mode 100644
index d0cbdca129a..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEConfig.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Content.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Content.class
deleted file mode 100644
index 69396ac599b..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Content.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EVENT_TYPE.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EVENT_TYPE.class
deleted file mode 100644
index 049105c8c6a..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EVENT_TYPE.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndMessage.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndMessage.class
deleted file mode 100644
index 43146fcef44..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndMessage.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndPart.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndPart.class
deleted file mode 100644
index 21be7d2d1b3..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$EndPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Headers.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Headers.class
deleted file mode 100644
index 5a82e6e1bdf..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$Headers.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartMessage.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartMessage.class
deleted file mode 100644
index 56065396c35..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartMessage.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartPart.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartPart.class
deleted file mode 100644
index 9d717043bf8..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent$StartPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent.class
deleted file mode 100644
index 8e719f206db..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEEvent.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage$1.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage$1.class
deleted file mode 100644
index 2af2d8d019f..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage.class
deleted file mode 100644
index 32bfe6e1d68..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEMessage.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$1.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$1.class
deleted file mode 100644
index 70a00e500bd..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$1.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$LineInputStream.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$LineInputStream.class
deleted file mode 100644
index cf083ec29e9..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$LineInputStream.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$MIMEEventIterator.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$MIMEEventIterator.class
deleted file mode 100644
index 1c1e378515f..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$MIMEEventIterator.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$STATE.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$STATE.class
deleted file mode 100644
index e50629667cb..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser$STATE.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser.class
deleted file mode 100644
index cb0065ef0c6..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParser.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParsingException.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParsingException.class
deleted file mode 100644
index a631b2102e4..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEParsingException.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEPart.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEPart.class
deleted file mode 100644
index 45703cbcec1..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MIMEPart.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MemoryData.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MemoryData.class
deleted file mode 100644
index 25bd8fbcb78..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/MemoryData.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/WeakDataFile.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/WeakDataFile.class
deleted file mode 100644
index b25e1f209a0..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/WeakDataFile.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/hdr.class b/plugins/org.jvnet.mimepull/org/jvnet/mimepull/hdr.class
deleted file mode 100644
index c87fd3f5c06..00000000000
--- a/plugins/org.jvnet.mimepull/org/jvnet/mimepull/hdr.class
+++ /dev/null
Binary files differ
diff --git a/plugins/org.jvnet.mimepull/pom.xml b/plugins/org.jvnet.mimepull/pom.xml
deleted file mode 100644
index 70d7ec72a63..00000000000
--- a/plugins/org.jvnet.mimepull/pom.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.x.core.parent</artifactId>
- <version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.x.core.parent</relativePath>
- </parent>
-
- <artifactId>org.jvnet.mimepull</artifactId>
- <packaging>eclipse-plugin</packaging>
- <name>org.jvnet.mimepull</name>
- <version>1.5.0-SNAPSHOT</version>
-</project> \ No newline at end of file

Back to the top