Skip to content
This repository was archived by the owner on May 28, 2018. It is now read-only.

Commit 7d50683

Browse files
pavelbucekstepanv
authored andcommitted
JERSEY-3047: FormDataException shouldn't be declared private
Change-Id: I68dff268a9e6718e5dadb5c8cfc698249eddea88
1 parent 11769fb commit 7d50683

File tree

2 files changed

+66
-10
lines changed

2 files changed

+66
-10
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* http://glassfish.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
41+
package org.glassfish.jersey.media.multipart;
42+
43+
import javax.ws.rs.core.Response;
44+
45+
import org.glassfish.jersey.server.ParamException;
46+
47+
/**
48+
* * A parameter-based exception for errors with {@link FormDataParam}.
49+
*
50+
* @author Pavel Bucek (pavel.bucek at oracle.com)
51+
*/
52+
public final class FormDataParamException extends ParamException {
53+
54+
/**
55+
* Create new {@link FormDataParam} exception.
56+
*
57+
* @param cause real cause.
58+
* @param name parameter name.
59+
* @param defaultStringValue default value.
60+
*/
61+
public FormDataParamException(final Throwable cause, final String name, final String defaultStringValue) {
62+
super(cause, Response.Status.BAD_REQUEST, FormDataParam.class, name, defaultStringValue);
63+
}
64+
}

media/multipart/src/main/java/org/glassfish/jersey/media/multipart/internal/FormDataParamValueFactoryProvider.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33
*
4-
* Copyright (c) 2012-2015 Oracle and/or its affiliates. All rights reserved.
4+
* Copyright (c) 2012-2016 Oracle and/or its affiliates. All rights reserved.
55
*
66
* The contents of this file are subject to the terms of either the GNU
77
* General Public License Version 2 only ("GPL") or the Common Development
@@ -53,7 +53,6 @@
5353
import javax.ws.rs.BadRequestException;
5454
import javax.ws.rs.core.MediaType;
5555
import javax.ws.rs.core.MultivaluedMap;
56-
import javax.ws.rs.core.Response;
5756
import javax.ws.rs.ext.MessageBodyReader;
5857

5958
import javax.inject.Inject;
@@ -66,11 +65,11 @@
6665
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
6766
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
6867
import org.glassfish.jersey.media.multipart.FormDataParam;
68+
import org.glassfish.jersey.media.multipart.FormDataParamException;
6969
import org.glassfish.jersey.message.MessageBodyWorkers;
7070
import org.glassfish.jersey.message.MessageUtils;
7171
import org.glassfish.jersey.message.internal.Utils;
7272
import org.glassfish.jersey.server.ContainerRequest;
73-
import org.glassfish.jersey.server.ParamException;
7473
import org.glassfish.jersey.server.internal.inject.AbstractContainerRequestValueFactory;
7574
import org.glassfish.jersey.server.internal.inject.AbstractValueFactoryProvider;
7675
import org.glassfish.jersey.server.internal.inject.MultivaluedParameterExtractor;
@@ -98,13 +97,6 @@ final class FormDataParamValueFactoryProvider extends AbstractValueFactoryProvid
9897

9998
private static final Logger LOGGER = Logger.getLogger(FormDataParamValueFactoryProvider.class.getName());
10099

101-
private static final class FormDataParamException extends ParamException {
102-
103-
protected FormDataParamException(final Throwable cause, final String name, final String defaultStringValue) {
104-
super(cause, Response.Status.BAD_REQUEST, FormDataParam.class, name, defaultStringValue);
105-
}
106-
}
107-
108100
/**
109101
* {@link FormDataParam} injection resolver.
110102
*/

0 commit comments

Comments
 (0)