Skip to content

Commit

Permalink
Pacify checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
claussni committed Jun 9, 2015
1 parent c8ea0c7 commit f90ab30
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/fcrepo/sword/http/SWORDServiceResource.java
@@ -1,12 +1,12 @@
/**
* Copyright 2015 DuraSpace, Inc.
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.
Expand Down
@@ -1,12 +1,12 @@
/**
* Copyright 2015 DuraSpace, Inc.
* <p>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
*
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
*
* 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.
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/org/fcrepo/sword/service/SWORDProviderService.java
@@ -1,3 +1,18 @@
/**
* Copyright 2015 DuraSpace, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.fcrepo.sword.service;

import org.apache.abdera.Abdera;
Expand All @@ -24,6 +39,9 @@ public class SWORDProviderService {
@Autowired
private SessionFactory sessionFactory;

/**
*
*/
public SWORDProviderService() {
abdera = new Abdera();
}
Expand All @@ -47,6 +65,10 @@ public void init() throws RepositoryException {
}
}

/**
*
* @return
*/
public Service serviceDocument() {
final Service service = abdera.newService();
service.addSimpleExtension(
Expand Down
Expand Up @@ -80,18 +80,16 @@ public void hasSwordVersion2() throws IOException {
final HttpGet get = new HttpGet(serverAddress);
get.setHeader("Content-Type", "application/svc+xml");
final HttpResponse response = httpClient.execute(get);

Service service = serviceDocumentFromStream(response.getEntity().getContent());

final Service service = serviceDocumentFromStream(response.getEntity().getContent());
assertEquals("2.0", service.getSimpleExtension(
"http://purl.org/net/sword/terms/",
"version",
"sword"));
}

private Service serviceDocumentFromStream(final InputStream content) {
Abdera abdera = new Abdera();
Document<Service> serviceDocument = abdera.getParser().parse(content);
final Abdera abdera = new Abdera();
final Document<Service> serviceDocument = abdera.getParser().parse(content);
return serviceDocument.getRoot();
}

Expand Down

0 comments on commit f90ab30

Please sign in to comment.