Added the Apache License, Version 2.0 to all of the code.
git-svn-id: https://oai4j-client.svn.sourceforge.net/svnroot/oai4j-client/trunk@3 201c9376-5148-0410-b534-98494c770f31
This commit is contained in:
parent
84e9547784
commit
d2661f445c
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<groupId>se.kb</groupId>
|
<groupId>se.kb</groupId>
|
||||||
<artifactId>oai4j</artifactId>
|
<artifactId>oai4j</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.0</version>
|
<version>0.6-SNAPSHOT</version>
|
||||||
<name>oai4j</name>
|
<name>oai4j</name>
|
||||||
<url>http://maven.apache.org</url>
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai;
|
package se.kb.oai;
|
||||||
|
|
||||||
public class OAIException extends Exception {
|
public class OAIException extends Exception {
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import static se.kb.oai.ore.OREConstants.*;
|
import static se.kb.oai.ore.OREConstants.*;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import org.dom4j.Namespace;
|
import org.dom4j.Namespace;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore;
|
package se.kb.oai.ore;
|
||||||
|
|
||||||
public class Type {
|
public class Type {
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore.impl;
|
package se.kb.oai.ore.impl;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore.impl;
|
package se.kb.oai.ore.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore.impl;
|
package se.kb.oai.ore.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore.impl;
|
package se.kb.oai.ore.impl;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.ore.impl;
|
package se.kb.oai.ore.impl;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
|
@ -1,8 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import se.kb.oai.OAIException;
|
import se.kb.oai.OAIException;
|
||||||
|
|
||||||
public class PMHErrorResponseException extends OAIException {
|
public class ErrorResponseException extends OAIException {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2010182612617642664L;
|
private static final long serialVersionUID = -2010182612617642664L;
|
||||||
|
|
||||||
|
@ -18,7 +34,7 @@ public class PMHErrorResponseException extends OAIException {
|
||||||
private String code;
|
private String code;
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
public PMHErrorResponseException(String code, String message) {
|
public ErrorResponseException(String code, String message) {
|
||||||
super();
|
super();
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.message = message;
|
this.message = message;
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -48,7 +45,7 @@ public class Identification extends ResponseBase {
|
||||||
private List<Element> descriptions;
|
private List<Element> descriptions;
|
||||||
private List<String> adminEmails;
|
private List<String> adminEmails;
|
||||||
|
|
||||||
public Identification(Document document) throws PMHErrorResponseException {
|
public Identification(Document document) throws ErrorResponseException {
|
||||||
super(document);
|
super(document);
|
||||||
|
|
||||||
this.repositoryName = xpath.valueOf(REPOSITORYNAME_XPATH);
|
this.repositoryName = xpath.valueOf(REPOSITORYNAME_XPATH);
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -12,7 +28,7 @@ public class IdentifiersList extends ResponseBase {
|
||||||
|
|
||||||
private List<Header> headers;
|
private List<Header> headers;
|
||||||
|
|
||||||
public IdentifiersList(Document document) throws PMHErrorResponseException {
|
public IdentifiersList(Document document) throws ErrorResponseException {
|
||||||
super(document);
|
super(document);
|
||||||
|
|
||||||
this.headers = new LinkedList<Header>();
|
this.headers = new LinkedList<Header>();
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import static se.kb.oai.pmh.ResponseBase.*;
|
import static se.kb.oai.pmh.ResponseBase.*;
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -31,7 +28,7 @@ public class MetadataFormatsList extends ResponseBase {
|
||||||
|
|
||||||
private List<MetadataFormat> metadataFormats;
|
private List<MetadataFormat> metadataFormats;
|
||||||
|
|
||||||
public MetadataFormatsList(Document document) throws PMHErrorResponseException {
|
public MetadataFormatsList(Document document) throws ErrorResponseException {
|
||||||
super(document);
|
super(document);
|
||||||
|
|
||||||
this.metadataFormats = new LinkedList<MetadataFormat>();
|
this.metadataFormats = new LinkedList<MetadataFormat>();
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -50,7 +66,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
GetRecord getRecord = new GetRecord(baseurl, identifier, metadataPrefix);
|
GetRecord getRecord = new GetRecord(baseurl, identifier, metadataPrefix);
|
||||||
return new Record(getRecord.getDocument());
|
return new Record(getRecord.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
@ -61,7 +77,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
Identify identify = new Identify(baseurl);
|
Identify identify = new Identify(baseurl);
|
||||||
return new Identification(identify.getDocument());
|
return new Identification(identify.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
@ -76,7 +92,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
ListIdentifiers list = new ListIdentifiers(baseurl, from, until, set, metadataPrefix);
|
ListIdentifiers list = new ListIdentifiers(baseurl, from, until, set, metadataPrefix);
|
||||||
return new IdentifiersList(list.getDocument());
|
return new IdentifiersList(list.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
@ -87,7 +103,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
ListIdentifiers list = new ListIdentifiers(baseurl, resumptionToken.getId());
|
ListIdentifiers list = new ListIdentifiers(baseurl, resumptionToken.getId());
|
||||||
return new IdentifiersList(list.getDocument());
|
return new IdentifiersList(list.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
@ -102,7 +118,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
ListRecords list = new ListRecords(baseurl, from, until, set, metadataPrefix);
|
ListRecords list = new ListRecords(baseurl, from, until, set, metadataPrefix);
|
||||||
return new RecordsList(list.getDocument());
|
return new RecordsList(list.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
@ -113,7 +129,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
ListRecords list = new ListRecords(baseurl, resumptionToken.getId());
|
ListRecords list = new ListRecords(baseurl, resumptionToken.getId());
|
||||||
return new RecordsList(list.getDocument());
|
return new RecordsList(list.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
@ -128,7 +144,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
ListMetadataFormats list = new ListMetadataFormats(baseurl, identifier);
|
ListMetadataFormats list = new ListMetadataFormats(baseurl, identifier);
|
||||||
return new MetadataFormatsList(list.getDocument());
|
return new MetadataFormatsList(list.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
@ -139,7 +155,7 @@ public class OaiPmhServer {
|
||||||
try {
|
try {
|
||||||
ListSets list = new ListSets(baseurl);
|
ListSets list = new ListSets(baseurl);
|
||||||
return new SetsList(list.getDocument());
|
return new SetsList(list.getDocument());
|
||||||
} catch (PMHErrorResponseException e) {
|
} catch (ErrorResponseException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new OAIException(e);
|
throw new OAIException(e);
|
||||||
|
|
|
@ -39,11 +39,11 @@ public class Record extends ResponseBase {
|
||||||
private Element metadata;
|
private Element metadata;
|
||||||
private Element about;
|
private Element about;
|
||||||
|
|
||||||
public Record(Document document) throws PMHErrorResponseException {
|
public Record(Document document) throws ErrorResponseException {
|
||||||
this(document, null);
|
this(document, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Record(Document document, Node record) throws PMHErrorResponseException {
|
public Record(Document document, Node record) throws ErrorResponseException {
|
||||||
super(document);
|
super(document);
|
||||||
|
|
||||||
if (record == null)
|
if (record == null)
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class RecordsList extends ResponseBase {
|
||||||
|
|
||||||
private List<Record> records;
|
private List<Record> records;
|
||||||
|
|
||||||
public RecordsList(Document document) throws PMHErrorResponseException {
|
public RecordsList(Document document) throws ErrorResponseException {
|
||||||
super(document);
|
super(document);
|
||||||
|
|
||||||
this.records = new LinkedList<Record>();
|
this.records = new LinkedList<Record>();
|
||||||
|
|
|
@ -40,7 +40,7 @@ public abstract class ResponseBase {
|
||||||
protected String responseDate;
|
protected String responseDate;
|
||||||
protected ResumptionToken resumptionToken;
|
protected ResumptionToken resumptionToken;
|
||||||
|
|
||||||
public ResponseBase(Document document) throws PMHErrorResponseException {
|
public ResponseBase(Document document) throws ErrorResponseException {
|
||||||
DOMReader reader = new DOMReader();
|
DOMReader reader = new DOMReader();
|
||||||
Element root = reader.read(document).getRootElement();
|
Element root = reader.read(document).getRootElement();
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public abstract class ResponseBase {
|
||||||
|
|
||||||
Element error = xpath.selectSingleElement(ERROR_XPATH);
|
Element error = xpath.selectSingleElement(ERROR_XPATH);
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
throw new PMHErrorResponseException(error.attributeValue("code"), error.getTextTrim());
|
throw new ErrorResponseException(error.attributeValue("code"), error.getTextTrim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import static se.kb.oai.pmh.ResponseBase.*;
|
import static se.kb.oai.pmh.ResponseBase.*;
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.oai.pmh;
|
package se.kb.oai.pmh;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -31,7 +28,7 @@ public class SetsList extends ResponseBase {
|
||||||
|
|
||||||
private List<Set> sets;
|
private List<Set> sets;
|
||||||
|
|
||||||
public SetsList(Document document) throws PMHErrorResponseException {
|
public SetsList(Document document) throws ErrorResponseException {
|
||||||
super(document);
|
super(document);
|
||||||
|
|
||||||
this.sets = new LinkedList<Set>();
|
this.sets = new LinkedList<Set>();
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2008 National Library of Sweden
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
package se.kb.xml;
|
package se.kb.xml;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
|
|
@ -1,22 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Created on 17 Aug 2007
|
* Copyright 2008 National Library of Sweden
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Royal Library of Sweden.
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
*
|
* you may not use this file except in compliance with the License.
|
||||||
* This program is free software; you can redistribute it and/or
|
* You may obtain a copy of the License at
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
*
|
||||||
* as published by the Free Software Foundation; either version 2
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* of the License, or (at your option) any later version.
|
*
|
||||||
*
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* This program is distributed in the hope that it will be useful,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* See the License for the specific language governing permissions and
|
||||||
* GNU Lesser General Public License for more details.
|
* limitations under the License.
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.kb.xml;
|
package se.kb.xml;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
Loading…
Reference in New Issue