You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/06/30 16:58:18 UTC
[48/51] [abbrv] [partial] [OLINGO-328] code cleanup and checkstyle
issues
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/V4Services.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V4Services.java b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
index 27634b2..978bf5a 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V4Services.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -113,9 +113,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/redirect/{name}({id})")
public Response conformanceRedirect(
- @Context UriInfo uriInfo,
- @PathParam("name") String name,
- @PathParam("id") String id) {
+ @Context final UriInfo uriInfo,
+ @PathParam("name") final String name,
+ @PathParam("id") final String id) {
return Response.temporaryRedirect(
URI.create(uriInfo.getRequestUri().toASCIIString().replace("/redirect", ""))).build();
}
@@ -123,8 +123,8 @@ public class V4Services extends AbstractServices {
@GET
@Path("/$crossjoin({elements:.*})")
public Response crossjoin(
- @PathParam("elements") String elements,
- @QueryParam("$filter") String filter) {
+ @PathParam("elements") final String elements,
+ @QueryParam("$filter") final String filter) {
try {
if (CROSSJOIN_PATTERN.matcher("$crossjoin(" + elements + ")?$filter=" + filter).matches()) {
@@ -142,8 +142,8 @@ public class V4Services extends AbstractServices {
@GET
@Path("/relatedEntitySelect/{path:.*}")
public Response relatedEntitySelect(
- @PathParam("path") String path,
- @QueryParam("$expand") String expand) {
+ @PathParam("path") final String path,
+ @QueryParam("$expand") final String expand) {
if (RELENTITY_SELECT_PATTERN.matcher(expand).matches()) {
return xml.createResponse(null, null, Accept.JSON_FULLMETA);
@@ -356,17 +356,17 @@ public class V4Services extends AbstractServices {
@GET
@Path("/People/{type:.*}")
public Response getPeople(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
@PathParam("type") final String type,
- @QueryParam("$top") @DefaultValue(StringUtils.EMPTY) String top,
- @QueryParam("$skip") @DefaultValue(StringUtils.EMPTY) String skip,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
- @QueryParam("$inlinecount") @DefaultValue(StringUtils.EMPTY) String count,
- @QueryParam("$filter") @DefaultValue(StringUtils.EMPTY) String filter,
- @QueryParam("$search") @DefaultValue(StringUtils.EMPTY) String search,
- @QueryParam("$orderby") @DefaultValue(StringUtils.EMPTY) String orderby,
- @QueryParam("$skiptoken") @DefaultValue(StringUtils.EMPTY) String skiptoken) {
+ @QueryParam("$top") @DefaultValue(StringUtils.EMPTY) final String top,
+ @QueryParam("$skip") @DefaultValue(StringUtils.EMPTY) final String skip,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
+ @QueryParam("$inlinecount") @DefaultValue(StringUtils.EMPTY) final String count,
+ @QueryParam("$filter") @DefaultValue(StringUtils.EMPTY) final String filter,
+ @QueryParam("$search") @DefaultValue(StringUtils.EMPTY) final String search,
+ @QueryParam("$orderby") @DefaultValue(StringUtils.EMPTY) final String orderby,
+ @QueryParam("$skiptoken") @DefaultValue(StringUtils.EMPTY) final String skiptoken) {
return StringUtils.isBlank(filter) && StringUtils.isBlank(search)
? NumberUtils.isNumber(type)
@@ -379,9 +379,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Boss")
public Response getSingletonBoss(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getEntityInternal(
uriInfo.getRequestUri().toASCIIString(), accept, "Boss", StringUtils.EMPTY, format, null, null, false);
@@ -390,9 +390,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Company")
public Response getSingletonCompany(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getEntityInternal(
uriInfo.getRequestUri().toASCIIString(), accept, "Company", StringUtils.EMPTY, format, null, null, false);
@@ -403,11 +403,11 @@ public class V4Services extends AbstractServices {
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON })
public Response patchSingletonCompany(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) String prefer,
- @HeaderParam("If-Match") @DefaultValue(StringUtils.EMPTY) String ifMatch,
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) final String prefer,
+ @HeaderParam("If-Match") @DefaultValue(StringUtils.EMPTY) final String ifMatch,
final String changes) {
return super.patchEntity(uriInfo, accept, contentType, prefer, ifMatch, "Company", StringUtils.EMPTY, changes);
@@ -416,11 +416,11 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Customers")
public Response getCustomers(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
- @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) String prefer,
- @QueryParam("$deltatoken") @DefaultValue(StringUtils.EMPTY) String deltatoken) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
+ @HeaderParam("Prefer") @DefaultValue(StringUtils.EMPTY) final String prefer,
+ @QueryParam("$deltatoken") @DefaultValue(StringUtils.EMPTY) final String deltatoken) {
try {
final Accept acceptType;
@@ -466,8 +466,8 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Company/Microsoft.Test.OData.Services.ODataWCFService.GetEmployeesCount{paren:[\\(\\)]*}")
public Response functionGetEmployeesCount(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Accept acceptType;
@@ -497,9 +497,9 @@ public class V4Services extends AbstractServices {
@POST
@Path("/Company/Microsoft.Test.OData.Services.ODataWCFService.IncreaseRevenue{paren:[\\(\\)]*}")
public Response actionIncreaseRevenue(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String param) {
try {
@@ -526,9 +526,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Products({entityId})/Microsoft.Test.OData.Services.ODataWCFService.GetProductDetails({param:.*})")
public Response functionGetProductDetails(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("entityId") String entityId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Accept acceptType;
@@ -571,9 +571,9 @@ public class V4Services extends AbstractServices {
@POST
@Path("/Products({entityId})/Microsoft.Test.OData.Services.ODataWCFService.AddAccessRight{paren:[\\(\\)]*}")
public Response actionAddAccessRight(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String param) {
try {
@@ -610,11 +610,11 @@ public class V4Services extends AbstractServices {
@POST
@Path("/Customers(PersonID={personId})/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress{paren:[\\(\\)]*}")
public Response actionResetAddress(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("personId") String personId,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("personId") final String personId,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String param) {
try {
@@ -636,10 +636,10 @@ public class V4Services extends AbstractServices {
@Path("/ProductDetails(ProductID={productId},ProductDetailID={productDetailId})"
+ "/Microsoft.Test.OData.Services.ODataWCFService.GetRelatedProduct{paren:[\\(\\)]*}")
public Response functionGetRelatedProduct(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("productId") String productId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("productId") final String productId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getEntityInternal(
uriInfo.getRequestUri().toASCIIString(), accept, "Products", productId, format, null, null, false);
@@ -648,11 +648,11 @@ public class V4Services extends AbstractServices {
@POST
@Path("/Accounts({entityId})/Microsoft.Test.OData.Services.ODataWCFService.RefreshDefaultPI{paren:[\\(\\)]*}")
public Response actionRefreshDefaultPI(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @PathParam("entityId") String entityId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String param) {
try {
@@ -671,9 +671,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Accounts({entityId})/Microsoft.Test.OData.Services.ODataWCFService.GetDefaultPI{paren:[\\(\\)]*}")
public Response functionGetDefaultPI(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("entityId") String entityId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getContainedEntity(accept, entityId, "MyPaymentInstruments", entityId + "901", format);
}
@@ -681,9 +681,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Accounts({entityId})/Microsoft.Test.OData.Services.ODataWCFService.GetAccountInfo{paren:[\\(\\)]*}")
public Response functionGetAccountInfo(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("entityId") String entityId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getPath(accept, "Accounts", entityId, "AccountInfo", format);
}
@@ -691,9 +691,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Accounts({entityId})/MyGiftCard/Microsoft.Test.OData.Services.ODataWCFService.GetActualAmount({param:.*})")
public Response functionGetActualAmount(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("entityId") String entityId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Accept acceptType;
@@ -721,7 +721,7 @@ public class V4Services extends AbstractServices {
/**
* Retrieve entity reference sample.
- *
+ *
* @param accept Accept header.
* @param path path.
* @param format format query option.
@@ -730,9 +730,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/{path:.*}/$ref")
public Response getEntityReference(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("path") String path,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("path") final String path,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
@@ -802,11 +802,11 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Accounts({entityId})/{containedEntitySetName}({containedEntityId})")
public Response getContainedEntity(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("entityId") String entityId,
- @PathParam("containedEntitySetName") String containedEntitySetName,
- @PathParam("containedEntityId") String containedEntityId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @PathParam("containedEntitySetName") final String containedEntitySetName,
+ @PathParam("containedEntityId") final String containedEntityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Accept acceptType;
@@ -840,11 +840,11 @@ public class V4Services extends AbstractServices {
@POST
@Path("/Accounts({entityId})/{containedEntitySetName:.*}")
public Response postContainedEntity(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @PathParam("entityId") String entityId,
- @PathParam("containedEntitySetName") String containedEntitySetName,
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @PathParam("entityId") final String entityId,
+ @PathParam("containedEntitySetName") final String containedEntitySetName,
final String entity) {
try {
@@ -917,13 +917,13 @@ public class V4Services extends AbstractServices {
@PATCH
@Path("/{entitySetName}({entityId})/{containedEntitySetName}({containedEntityId})")
public Response patchContainedEntity(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @PathParam("entitySetName") String entitySetName,
- @PathParam("entityId") String entityId,
- @PathParam("containedEntitySetName") String containedEntitySetName,
- @PathParam("containedEntityId") String containedEntityId,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @PathParam("entitySetName") final String entitySetName,
+ @PathParam("entityId") final String entityId,
+ @PathParam("containedEntitySetName") final String containedEntitySetName,
+ @PathParam("containedEntityId") final String containedEntityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String changes) {
try {
@@ -985,9 +985,9 @@ public class V4Services extends AbstractServices {
@DELETE
@Path("/Accounts({entityId})/{containedEntitySetName}({containedEntityId})")
public Response removeContainedEntity(
- @PathParam("entityId") String entityId,
- @PathParam("containedEntitySetName") String containedEntitySetName,
- @PathParam("containedEntityId") String containedEntityId) {
+ @PathParam("entityId") final String entityId,
+ @PathParam("containedEntitySetName") final String containedEntitySetName,
+ @PathParam("containedEntityId") final String containedEntityId) {
try {
// 1. Fetch the contained entity to be removed
@@ -1026,10 +1026,10 @@ public class V4Services extends AbstractServices {
@GET
@Path("/Accounts({entityId})/{containedEntitySetName:.*}")
public Response getContainedEntitySet(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @PathParam("entityId") String entityId,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
@PathParam("containedEntitySetName") String containedEntitySetName,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
if ("MyGiftCard".equals(containedEntitySetName)) {
return getContainedEntity(accept, entityId, containedEntitySetName, null, format);
@@ -1081,8 +1081,8 @@ public class V4Services extends AbstractServices {
@GET
@Path("/GetDefaultColor()")
public Response functionGetDefaultColor(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Accept acceptType;
@@ -1112,9 +1112,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/GetPerson2({param:.*})")
public Response functionGetPerson2(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getEntityInternal(
uriInfo.getRequestUri().toASCIIString(), accept, "Customers", "1", format, null, null, false);
@@ -1123,9 +1123,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/GetPerson({param:.*})")
public Response functionGetPerson(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getEntityInternal(
uriInfo.getRequestUri().toASCIIString(), accept, "Customers", "1", format, null, null, false);
@@ -1134,9 +1134,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/GetAllProducts()")
public Response functionGetAllProducts(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
return getEntitySet(uriInfo, accept, "Products", null, null, format, null, null, null, null);
}
@@ -1144,9 +1144,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/GetProductsByAccessLevel({param:.*})")
public Response functionGetProductsByAccessLevel(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Accept acceptType;
@@ -1177,9 +1177,9 @@ public class V4Services extends AbstractServices {
@GET
@Path("/GetBossEmails({param:.*})")
public Response functionGetBossEmails(
- @Context UriInfo uriInfo,
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+ @Context final UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
try {
final Accept acceptType;
@@ -1206,9 +1206,9 @@ public class V4Services extends AbstractServices {
@POST
@Path("/Discount()")
public Response actionDiscount(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String param) {
try {
@@ -1246,9 +1246,9 @@ public class V4Services extends AbstractServices {
@POST
@Path("/ResetBossAddress()")
public Response actionResetBossAddress(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String param) {
try {
@@ -1284,9 +1284,9 @@ public class V4Services extends AbstractServices {
@POST
@Path("/ResetBossEmail()")
public Response actionResetBossEmail(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String param) {
try {
@@ -1317,9 +1317,9 @@ public class V4Services extends AbstractServices {
@POST
@Path("/Products({productId})/Categories/$ref")
public Response createLinked(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String entity) {
return xml.createResponse(null, null, null, Status.NO_CONTENT);
@@ -1328,9 +1328,9 @@ public class V4Services extends AbstractServices {
@DELETE
@Path("/Products({productId})/Categories({categoryId})/$ref")
public Response deleteLinked(
- @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
- @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) String contentType,
- @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @HeaderParam("Content-Type") @DefaultValue(StringUtils.EMPTY) final String contentType,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
final String entity) {
return xml.createResponse(null, null, null, Status.NO_CONTENT);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/V4Vocabularies.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V4Vocabularies.java b/fit/src/main/java/org/apache/olingo/fit/V4Vocabularies.java
index 5d64457..cf20fba 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V4Vocabularies.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V4Vocabularies.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -24,6 +24,7 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.fit.metadata.Metadata;
import org.apache.olingo.fit.utils.Accept;
@@ -42,10 +43,10 @@ public class V4Vocabularies {
private final XMLUtilities xml;
public V4Vocabularies() throws Exception {
- this.metadata = new Metadata(FSManager.instance(ODataServiceVersion.V40).readRes(
- "vocabularies-" + Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA), Accept.XML),
- ODataServiceVersion.V40);
- this.xml = new XMLUtilities(ODataServiceVersion.V40, metadata);
+ metadata = new Metadata(FSManager.instance(ODataServiceVersion.V40).readRes(
+ "vocabularies-" + Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA), Accept.XML),
+ ODataServiceVersion.V40);
+ xml = new XMLUtilities(ODataServiceVersion.V40, metadata);
}
@GET
@@ -54,11 +55,11 @@ public class V4Vocabularies {
public Response getMetadata() {
try {
return xml.createResponse(
- null,
- FSManager.instance(ODataServiceVersion.V40).readRes(
- "vocabularies-" + Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA), Accept.XML),
- null,
- Accept.XML);
+ null,
+ FSManager.instance(ODataServiceVersion.V40).readRes(
+ "vocabularies-" + Constants.get(ODataServiceVersion.V40, ConstantKey.METADATA), Accept.XML),
+ null,
+ Accept.XML);
} catch (Exception e) {
return xml.createFaultResponse(Accept.XML.toString(ODataServiceVersion.V40), e);
}
@@ -70,10 +71,10 @@ public class V4Vocabularies {
public Response getVocabulary(@PathParam("vocabulary") final String vocabulary) {
try {
return xml.createResponse(
- null,
- FSManager.instance(ODataServiceVersion.V40).readFile(vocabulary, null),
- null,
- Accept.XML);
+ null,
+ FSManager.instance(ODataServiceVersion.V40).readFile(vocabulary, null),
+ null,
+ Accept.XML);
} catch (Exception e) {
return xml.createFaultResponse(Accept.XML.toString(ODataServiceVersion.V40), e);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/AbstractMetadataElement.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/AbstractMetadataElement.java b/fit/src/main/java/org/apache/olingo/fit/metadata/AbstractMetadataElement.java
index 9a83a76..8a94814 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/AbstractMetadataElement.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/AbstractMetadataElement.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java
index f750d2c..5277f23 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Association.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java b/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java
index 3d381d7..f94a62f 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/AssociationSet.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
index 37d3f92..fefdea1 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Container.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/EntitySet.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/EntitySet.java b/fit/src/main/java/org/apache/olingo/fit/metadata/EntitySet.java
index b127861..d35dfc0 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/EntitySet.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/EntitySet.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -33,12 +33,13 @@ public class EntitySet extends AbstractMetadataElement {
// V4 only
// --------------------------
private final Map<String, String> binding;
+
// --------------------------
public EntitySet(final String name, final boolean singleton) {
this.name = name;
this.singleton = singleton;
- this.binding = new LinkedHashMap<String, String>();
+ binding = new LinkedHashMap<String, String>();
}
public EntitySet(final String name) {
@@ -53,7 +54,7 @@ public class EntitySet extends AbstractMetadataElement {
return type;
}
- public void setType(String type) {
+ public void setType(final String type) {
this.type = type;
}
@@ -62,11 +63,11 @@ public class EntitySet extends AbstractMetadataElement {
}
public EntitySet addBinding(final String path, final String target) {
- this.binding.put(path, target);
+ binding.put(path, target);
return this;
}
public String getTarget(final String path) {
- return this.binding.get(path);
+ return binding.get(path);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/EntityType.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/EntityType.java b/fit/src/main/java/org/apache/olingo/fit/metadata/EntityType.java
index 90f51d5..46d9c41 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/EntityType.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/EntityType.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -37,8 +37,8 @@ public class EntityType extends AbstractMetadataElement {
public EntityType(final String name) {
this.name = name;
- this.properties = new HashMap<String, Property>();
- this.navigationProperties = new HashMap<String, NavigationProperty>();
+ properties = new HashMap<String, Property>();
+ navigationProperties = new HashMap<String, NavigationProperty>();
}
public String getName() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
index 543fae7..64c20a4 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Metadata.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -23,6 +23,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
@@ -30,6 +31,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.Attribute;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;
+
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
@@ -54,8 +56,8 @@ public class Metadata extends AbstractMetadataElement {
public Metadata(final InputStream is, final ODataServiceVersion version) {
this.version = version;
- this.DEF_NS = Constants.get(version, ConstantKey.EDM_NS);
- this.schemas = new HashMap<String, Schema>();
+ DEF_NS = Constants.get(version, ConstantKey.EDM_NS);
+ schemas = new HashMap<String, Schema>();
try {
final XMLInputFactory ifactory = XMLInputFactory.newInstance();
@@ -87,14 +89,14 @@ public class Metadata extends AbstractMetadataElement {
if (StringUtils.isNotBlank(property.getReleationship())) {
// V3 ...
final Association association = schemaEntry.getValue().getAssociation(
- property.getReleationship().replaceAll(schemaEntry.getKey() + "\\.", ""));
+ property.getReleationship().replaceAll(schemaEntry.getKey() + "\\.", ""));
final Association.Role role = association.getRole(property.getToRole());
property.setFeed(role.getMultiplicity().equals("*"));
property.setType(property.isEntitySet() ? "Collection(" + role.getType() + ")" : role.getType());
// let me assume that it will be just a single container
final AssociationSet associationSet = schemaEntry.getValue().getContainers().iterator().next().
- getAssociationSet(property.getReleationship());
+ getAssociationSet(property.getReleationship());
final AssociationSet.Role associationSetRole = associationSet.getRole(property.getToRole());
property.setTarget(associationSetRole.getEntitySet());
@@ -103,7 +105,7 @@ public class Metadata extends AbstractMetadataElement {
property.setFeed(property.getType().startsWith("Collection("));
final Collection<EntitySet> entitySets = schemaEntry.getValue().getContainers().iterator().next().
- getEntitySets(schemaEntry.getKey(), entityType.getName());
+ getEntitySets(schemaEntry.getKey(), entityType.getName());
final Iterator<EntitySet> iter = entitySets.iterator();
boolean found = false;
@@ -204,11 +206,11 @@ public class Metadata extends AbstractMetadataElement {
XMLEvent event = reader.nextEvent();
if (event.isStartElement() && event.asStartElement().getName().equals(new QName(DEF_NS, "EntityType"))
- || event.isStartElement() && event.asStartElement().getName().equals(new QName(DEF_NS, "ComplexType"))) {
+ || event.isStartElement() && event.asStartElement().getName().equals(new QName(DEF_NS, "ComplexType"))) {
final EntityType entityType = getEntityType(event.asStartElement(), reader);
schema.addEntityType(entityType.getName(), entityType);
} else if (event.isStartElement()
- && event.asStartElement().getName().equals(new QName(DEF_NS, "EntityContainer"))) {
+ && event.asStartElement().getName().equals(new QName(DEF_NS, "EntityContainer"))) {
final org.apache.olingo.fit.metadata.Container container = getContainer(event.asStartElement(), reader);
schema.addContainer(container.getName(), container);
} else if (event.isStartElement() && event.asStartElement().getName().equals(new QName(DEF_NS, "Association"))) {
@@ -224,9 +226,9 @@ public class Metadata extends AbstractMetadataElement {
}
private org.apache.olingo.fit.metadata.Container getContainer(
- final StartElement start, final XMLEventReader reader) throws XMLStreamException {
+ final StartElement start, final XMLEventReader reader) throws XMLStreamException {
final org.apache.olingo.fit.metadata.Container container =
- new org.apache.olingo.fit.metadata.Container(start.getAttributeByName(new QName("Name")).getValue());
+ new org.apache.olingo.fit.metadata.Container(start.getAttributeByName(new QName("Name")).getValue());
boolean completed = false;
@@ -234,12 +236,12 @@ public class Metadata extends AbstractMetadataElement {
XMLEvent event = reader.nextEvent();
if (event.isStartElement()
- && (event.asStartElement().getName().equals(new QName(DEF_NS, "EntitySet"))
- || event.asStartElement().getName().equals(new QName(DEF_NS, "Singleton")))) {
+ && (event.asStartElement().getName().equals(new QName(DEF_NS, "EntitySet"))
+ || event.asStartElement().getName().equals(new QName(DEF_NS, "Singleton")))) {
final EntitySet entitySet = getEntitySet(event.asStartElement(), reader);
container.addEntitySet(entitySet.getName(), entitySet);
} else if (event.isStartElement()
- && event.asStartElement().getName().equals(new QName(DEF_NS, "AssociationSet"))) {
+ && event.asStartElement().getName().equals(new QName(DEF_NS, "AssociationSet"))) {
// just for V3
final AssociationSet associationSet = getAssociationSet(event.asStartElement(), reader);
container.addAssociationSet(associationSet.getAssociation(), associationSet);
@@ -252,7 +254,7 @@ public class Metadata extends AbstractMetadataElement {
}
private Association getAssociation(
- final StartElement start, final XMLEventReader reader) throws XMLStreamException {
+ final StartElement start, final XMLEventReader reader) throws XMLStreamException {
final Association association = new Association(start.getAttributeByName(new QName("Name")).getValue());
boolean completed = false;
@@ -264,7 +266,7 @@ public class Metadata extends AbstractMetadataElement {
final String role = event.asStartElement().getAttributeByName(new QName("Role")).getValue();
final String type = event.asStartElement().getAttributeByName(new QName("Type")).getValue();
final String multiplicity =
- event.asStartElement().getAttributeByName(new QName("Multiplicity")).getValue();
+ event.asStartElement().getAttributeByName(new QName("Multiplicity")).getValue();
association.addRole(role, type, multiplicity);
} else if (event.isEndElement() && event.asEndElement().getName().equals(start.getName())) {
completed = true;
@@ -275,10 +277,10 @@ public class Metadata extends AbstractMetadataElement {
}
private AssociationSet getAssociationSet(
- final StartElement start, final XMLEventReader reader) throws XMLStreamException {
+ final StartElement start, final XMLEventReader reader) throws XMLStreamException {
final AssociationSet associationSet = new AssociationSet(
- start.getAttributeByName(new QName("Name")).getValue(),
- start.getAttributeByName(new QName("Association")).getValue());
+ start.getAttributeByName(new QName("Name")).getValue(),
+ start.getAttributeByName(new QName("Association")).getValue());
boolean completed = false;
@@ -317,7 +319,7 @@ public class Metadata extends AbstractMetadataElement {
final org.apache.olingo.fit.metadata.Property property = getProperty(event.asStartElement());
entityType.addProperty(property.getName(), property);
} else if (event.isStartElement()
- && event.asStartElement().getName().equals(new QName(DEF_NS, "NavigationProperty"))) {
+ && event.asStartElement().getName().equals(new QName(DEF_NS, "NavigationProperty"))) {
final NavigationProperty property = getNavigationProperty(event.asStartElement());
entityType.addNavigationProperty(property.getName(), property);
} else if (event.isEndElement() && event.asEndElement().getName().equals(start.getName())) {
@@ -330,7 +332,7 @@ public class Metadata extends AbstractMetadataElement {
private org.apache.olingo.fit.metadata.Property getProperty(final StartElement start) throws XMLStreamException {
final org.apache.olingo.fit.metadata.Property property =
- new org.apache.olingo.fit.metadata.Property(start.getAttributeByName(new QName("Name")).getValue());
+ new org.apache.olingo.fit.metadata.Property(start.getAttributeByName(new QName("Name")).getValue());
final Attribute type = start.getAttributeByName(new QName("Type"));
property.setType(type == null ? "Edm.String" : type.getValue());
@@ -343,7 +345,7 @@ public class Metadata extends AbstractMetadataElement {
private NavigationProperty getNavigationProperty(final StartElement start) throws XMLStreamException {
final NavigationProperty property =
- new NavigationProperty(start.getAttributeByName(new QName("Name")).getValue());
+ new NavigationProperty(start.getAttributeByName(new QName("Name")).getValue());
final Attribute type = start.getAttributeByName(new QName("Type"));
if (type != null) {
@@ -365,8 +367,8 @@ public class Metadata extends AbstractMetadataElement {
private EntitySet getEntitySet(final StartElement start, final XMLEventReader reader) throws XMLStreamException {
final EntitySet entitySet = "Singleton".equals(start.getName().getLocalPart())
- ? new EntitySet(start.getAttributeByName(new QName("Name")).getValue(), true)
- : new EntitySet(start.getAttributeByName(new QName("Name")).getValue());
+ ? new EntitySet(start.getAttributeByName(new QName("Name")).getValue(), true)
+ : new EntitySet(start.getAttributeByName(new QName("Name")).getValue());
Attribute type = start.getAttributeByName(new QName("EntityType"));
if (type == null) {
@@ -382,7 +384,7 @@ public class Metadata extends AbstractMetadataElement {
XMLEvent event = reader.nextEvent();
if (event.isStartElement()
- && event.asStartElement().getName().equals(new QName(DEF_NS, "NavigationPropertyBinding"))) {
+ && event.asStartElement().getName().equals(new QName(DEF_NS, "NavigationPropertyBinding"))) {
final String path = event.asStartElement().getAttributeByName(new QName("Path")).getValue();
final String target = event.asStartElement().getAttributeByName(new QName("Target")).getValue();
entitySet.addBinding(path, target);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java b/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
index ab3a88b..b506279 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/NavigationProperty.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -48,7 +48,7 @@ public class NavigationProperty extends AbstractMetadataElement {
return releationship;
}
- public void setReleationship(String releationship) {
+ public void setReleationship(final String releationship) {
this.releationship = releationship;
}
@@ -56,7 +56,7 @@ public class NavigationProperty extends AbstractMetadataElement {
return toRole;
}
- public void setToRole(String toRole) {
+ public void setToRole(final String toRole) {
this.toRole = toRole;
}
@@ -64,7 +64,7 @@ public class NavigationProperty extends AbstractMetadataElement {
return type;
}
- public void setType(String type) {
+ public void setType(final String type) {
this.type = type;
}
@@ -72,7 +72,7 @@ public class NavigationProperty extends AbstractMetadataElement {
return target;
}
- public void setTarget(String target) {
+ public void setTarget(final String target) {
this.target = target;
}
@@ -80,7 +80,7 @@ public class NavigationProperty extends AbstractMetadataElement {
return entitySet;
}
- public void setFeed(boolean entitySet) {
+ public void setFeed(final boolean entitySet) {
this.entitySet = entitySet;
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/Property.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Property.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Property.java
index 0ce180b..5716fcb 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Property.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Property.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -26,7 +26,7 @@ public class Property extends AbstractMetadataElement {
private boolean nullable;
- public Property(String name) {
+ public Property(final String name) {
this.name = name;
}
@@ -38,7 +38,7 @@ public class Property extends AbstractMetadataElement {
return type;
}
- public void setType(String type) {
+ public void setType(final String type) {
this.type = type;
}
@@ -46,7 +46,7 @@ public class Property extends AbstractMetadataElement {
return nullable;
}
- public void setNullable(boolean nullable) {
+ public void setNullable(final boolean nullable) {
this.nullable = nullable;
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java b/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
index 04cf75a..7df5d38 100644
--- a/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
+++ b/fit/src/main/java/org/apache/olingo/fit/metadata/Schema.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -35,8 +35,8 @@ public class Schema extends AbstractMetadataElement {
public Schema(final String namespace) {
this.namespace = namespace;
entityTypes = new HashMap<String, EntityType>();
- this.containers = new HashMap<String, Container>();
- this.associations = new HashMap<String, Association>();
+ containers = new HashMap<String, Container>();
+ associations = new HashMap<String, Association>();
}
public String getNamespace() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java b/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java
index 2966c11..f70eb43 100644
--- a/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java
+++ b/fit/src/main/java/org/apache/olingo/fit/methods/MERGE.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -22,10 +22,10 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import javax.ws.rs.HttpMethod;
-@Target({ElementType.METHOD})
+@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("MERGE")
-public @interface MERGE {
-}
+public @interface MERGE {}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java b/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java
index 6fd07b8..d4e6404 100644
--- a/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java
+++ b/fit/src/main/java/org/apache/olingo/fit/methods/PATCH.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -22,10 +22,10 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import javax.ws.rs.HttpMethod;
-@Target({ElementType.METHOD})
+@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("PATCH")
-public @interface PATCH {
-}
+public @interface PATCH {}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewrite.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewrite.java b/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewrite.java
index 082708f..af477b3 100644
--- a/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewrite.java
+++ b/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewrite.java
@@ -1,24 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.rproxy;
import java.util.Properties;
+
import org.esigate.Driver;
import org.esigate.DriverConfiguration;
import org.esigate.events.Event;
@@ -35,7 +36,7 @@ public class LinkRewrite implements Extension, IEventListener {
@Override
public void init(final Driver driver, final Properties properties) {
- this.config = driver.getConfiguration();
+ config = driver.getConfiguration();
driver.getEventManager().register(EventManager.EVENT_RENDER_PRE, this);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewriteRenderer.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewriteRenderer.java b/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewriteRenderer.java
index f3447ac..f0dd762 100644
--- a/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewriteRenderer.java
+++ b/fit/src/main/java/org/apache/olingo/fit/rproxy/LinkRewriteRenderer.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -20,6 +20,7 @@ package org.apache.olingo.fit.rproxy;
import java.io.IOException;
import java.io.Writer;
+
import org.apache.http.HttpEntityEnclosingRequest;
import org.esigate.Renderer;
@@ -37,19 +38,19 @@ public class LinkRewriteRenderer implements Renderer {
}
this.baseUrl = removeLeadingSlash(baseUrl);
- this.replacementUrl = removeLeadingSlash(visibleBaseUrl);
+ replacementUrl = removeLeadingSlash(visibleBaseUrl);
}
private String removeLeadingSlash(final String src) {
final int lastCharPosition = src.length() - 1;
return src.charAt(lastCharPosition) == SLASH
- ? src.substring(0, lastCharPosition)
- : src;
+ ? src.substring(0, lastCharPosition)
+ : src;
}
@Override
public void render(final HttpEntityEnclosingRequest httpRequest, final String src, final Writer out)
- throws IOException {
+ throws IOException {
out.write(src.replaceAll(baseUrl, replacementUrl));
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/serializer/FITAtomDeserializer.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/serializer/FITAtomDeserializer.java b/fit/src/main/java/org/apache/olingo/fit/serializer/FITAtomDeserializer.java
index 901cc3c..447e632 100644
--- a/fit/src/main/java/org/apache/olingo/fit/serializer/FITAtomDeserializer.java
+++ b/fit/src/main/java/org/apache/olingo/fit/serializer/FITAtomDeserializer.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
index 779c531..d2e6d1f 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/AbstractUtilities.java
@@ -1,18 +1,18 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
@@ -38,6 +38,7 @@ import java.util.regex.Pattern;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.core.Response;
+import javax.xml.stream.XMLStreamException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@@ -97,7 +98,7 @@ public abstract class AbstractUtilities {
public AbstractUtilities(final ODataServiceVersion version, final Metadata metadata) throws Exception {
this.version = version;
this.metadata = metadata;
- this.fsManager = FSManager.instance(version);
+ fsManager = FSManager.instance(version);
atomDeserializer = new FITAtomDeserializer(version);
jsonDeserializer = new JsonDeserializer(version, true);
atomSerializer = new AtomSerializer(version, true);
@@ -110,7 +111,7 @@ public abstract class AbstractUtilities {
/**
* Add links to the given entity.
- *
+ *
* @param entitySetName
* @param entitykey
* @param is
@@ -123,17 +124,17 @@ public abstract class AbstractUtilities {
/**
* Retrieve all entity link names.
- *
+ *
* @param is
* @return
* @throws IOException
- * @throws XMLStreamException
+ * @throws XMLStreamException
*/
protected abstract Set<String> retrieveAllLinkNames(final InputStream is) throws Exception;
/**
* Retrieve entity links and inlines.
- *
+ *
* @param entitySetName
* @param is
* @return
@@ -143,7 +144,7 @@ public abstract class AbstractUtilities {
/**
* Normalize navigation info and add edit link if missing.
- *
+ *
* @param entitySetName
* @param entityKey
* @param is
@@ -276,7 +277,7 @@ public abstract class AbstractUtilities {
// -----------------------------------------
// 4. Create links file and provided inlines
- // -----------------------------------------
+ // -----------------------------------------
for (Map.Entry<String, List<String>> link : links.getLinks()) {
putLinksInMemory(path, entitySetName, entityKey, link.getKey(), link.getValue());
}
@@ -727,7 +728,7 @@ public abstract class AbstractUtilities {
/**
* Retrieves entity links about the given link name.
- *
+ *
* @param entitySetName entity set name.
* @param entityId entity id.
* @param linkName link name.
@@ -736,7 +737,7 @@ public abstract class AbstractUtilities {
*/
public LinkInfo readLinks(
final String entitySetName, final String entityId, final String linkName, final Accept accept)
- throws Exception {
+ throws Exception {
final String basePath = getLinksBasePath(entitySetName, entityId);
@@ -795,7 +796,7 @@ public abstract class AbstractUtilities {
throws Exception {
// --------------------------------
- // 0. Retrieve all 'linkName' navigation link uris (NotFoundException if missing)
+ // 0. Retrieve all 'linkName' navigation link uris (NotFoundException if missing)
// --------------------------------
final Map.Entry<String, List<String>> links = extractLinkURIs(entitySetName, entityId, linkName);
// --------------------------------
@@ -854,7 +855,7 @@ public abstract class AbstractUtilities {
protected abstract InputStream replaceLink(
final InputStream toBeChanged, final String linkName, final InputStream replacement)
- throws Exception;
+ throws Exception;
public abstract InputStream selectEntity(final InputStream entity, final String[] propertyNames)
throws Exception;
@@ -882,5 +883,5 @@ public abstract class AbstractUtilities {
public abstract Map.Entry<String, List<String>> extractLinkURIs(
final String entitySetName, final String entityId, final String linkName)
- throws Exception;
+ throws Exception;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/2ab4b2fd/fit/src/main/java/org/apache/olingo/fit/utils/Accept.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/Accept.java b/fit/src/main/java/org/apache/olingo/fit/utils/Accept.java
index ab3b680..67f10bc 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/Accept.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/Accept.java
@@ -1,24 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
+ * 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
- *
+ * 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
+ * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.olingo.fit.utils;
import java.util.regex.Pattern;
+
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
@@ -30,11 +31,11 @@ public enum Accept {
XML(ContentType.APPLICATION_XML.getMimeType(), ".xml"),
ATOM(ContentType.APPLICATION_ATOM_XML.getMimeType(), ".xml"),
JSON(ContentType.APPLICATION_JSON.getMimeType() + ";odata=minimalmetadata",
- ContentType.APPLICATION_JSON.getMimeType() + ";odata.metadata=minimal", ".full.json"),
+ ContentType.APPLICATION_JSON.getMimeType() + ";odata.metadata=minimal", ".full.json"),
JSON_NOMETA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=nometadata",
- ContentType.APPLICATION_JSON.getMimeType() + ";odata.metadata=none", ".full.json"),
+ ContentType.APPLICATION_JSON.getMimeType() + ";odata.metadata=none", ".full.json"),
JSON_FULLMETA(ContentType.APPLICATION_JSON.getMimeType() + ";odata=fullmetadata",
- ContentType.APPLICATION_JSON.getMimeType() + ";odata.metadata=full", ".full.json");
+ ContentType.APPLICATION_JSON.getMimeType() + ";odata.metadata=full", ".full.json");
private final String contentTypeV3;
@@ -46,7 +47,7 @@ public enum Accept {
Accept(final String contentTypeV3, final String fileExtension) {
this.contentTypeV3 = contentTypeV3;
- this.contentTypeV4 = contentTypeV3;
+ contentTypeV4 = contentTypeV3;
this.fileExtension = fileExtension;
}
@@ -83,7 +84,7 @@ public enum Accept {
} else if (contentType.startsWith(JSON_FULLMETA.toString(version))) {
return JSON_FULLMETA;
} else if (contentType.startsWith(JSON.toString(version))
- || contentType.startsWith(ContentType.APPLICATION_JSON.getMimeType())) {
+ || contentType.startsWith(ContentType.APPLICATION_JSON.getMimeType())) {
return JSON;
} else if (contentType.startsWith(XML.toString(version))) {