-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of EntityPart API (#4859)
* Implementation of EntityPart API Signed-off-by: jansupol <[email protected]>
- Loading branch information
Showing
29 changed files
with
1,275 additions
and
63 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
core-common/src/main/java/org/glassfish/jersey/innate/multipart/JerseyEntityPart.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
package org.glassfish.jersey.innate.multipart; | ||
|
||
import jakarta.ws.rs.core.EntityPart; | ||
|
||
import java.lang.reflect.Type; | ||
|
||
/** | ||
* Jersey extended {@code EntityPart}. Contains arbitrary useful methods. | ||
* | ||
* @since 3.1.0 | ||
*/ | ||
public interface JerseyEntityPart extends EntityPart { | ||
/** | ||
* Converts the content stream for this part to the specified class and returns | ||
* it. | ||
* | ||
* Subsequent invocations will result in an {@code IllegalStateException}. | ||
* Likewise this method will throw an {@code IllegalStateException} if it is called after calling | ||
* {@link #getContent} or similar {@code getContent} method. | ||
* | ||
* @param <T> type parameter of the value returned | ||
* @param type the {@code Class} that the implementation should convert this | ||
* part to | ||
* @param <T> the entity type | ||
* @return an instance of the specified {@code Class} representing the content | ||
* of this part | ||
* @throws IllegalStateException if this method or any of the other | ||
* {@code getContent} methods has already been | ||
* invoked | ||
*/ | ||
<T> T getContent(Class<T> type, Type genericType); | ||
} |
20 changes: 20 additions & 0 deletions
20
core-common/src/main/java/org/glassfish/jersey/innate/multipart/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/** | ||
* Multipart Jersey innate classes. This innate package will be opened by JPMS only to Jersey-media-multipart. | ||
*/ | ||
package org.glassfish.jersey.innate.multipart; |
20 changes: 20 additions & 0 deletions
20
core-common/src/main/java/org/glassfish/jersey/innate/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/** | ||
* Jersey innate packages. The innate packages will not be opened by JPMS outside of Jersey. | ||
*/ | ||
package org.glassfish.jersey.innate; |
34 changes: 34 additions & 0 deletions
34
core-common/src/main/java/org/glassfish/jersey/innate/spi/EntityPartBuilderProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.innate.spi; | ||
|
||
import jakarta.ws.rs.core.EntityPart; | ||
|
||
/** | ||
* Jersey extension of provider of EntityPart.Builder. | ||
* A service meant to be implemented solely by Jersey. | ||
* | ||
* @since 3.1.0 | ||
*/ | ||
public interface EntityPartBuilderProvider { | ||
|
||
/** | ||
* @param partName name of the part to create within the multipart entity. | ||
* @return {@link EntityPart.Builder} for building new {@link EntityPart} instances. | ||
*/ | ||
public EntityPart.Builder withName(String partName); | ||
} |
20 changes: 20 additions & 0 deletions
20
core-common/src/main/java/org/glassfish/jersey/innate/spi/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
/** | ||
* Common Jersey innate SPI classes. The innate package will not be opened by JPMS. | ||
*/ | ||
package org.glassfish.jersey.innate.spi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.