diff --git a/pom.xml b/pom.xml index 6270ca8..e1b4d1d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ se.kb oai4j jar - 1.0 + 0.6-SNAPSHOT oai4j http://maven.apache.org diff --git a/src/main/java/se/kb/oai/OAIException.java b/src/main/java/se/kb/oai/OAIException.java index 20835ed..22f134e 100644 --- a/src/main/java/se/kb/oai/OAIException.java +++ b/src/main/java/se/kb/oai/OAIException.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; public class OAIException extends Exception { diff --git a/src/main/java/se/kb/oai/ore/AggregateBase.java b/src/main/java/se/kb/oai/ore/AggregateBase.java index 2268c53..5ad28fe 100644 --- a/src/main/java/se/kb/oai/ore/AggregateBase.java +++ b/src/main/java/se/kb/oai/ore/AggregateBase.java @@ -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; import java.net.URI; diff --git a/src/main/java/se/kb/oai/ore/AggregatedResource.java b/src/main/java/se/kb/oai/ore/AggregatedResource.java index a127270..07d8d7e 100644 --- a/src/main/java/se/kb/oai/ore/AggregatedResource.java +++ b/src/main/java/se/kb/oai/ore/AggregatedResource.java @@ -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; import java.io.ByteArrayOutputStream; diff --git a/src/main/java/se/kb/oai/ore/Aggregation.java b/src/main/java/se/kb/oai/ore/Aggregation.java index 901224e..6b9621e 100644 --- a/src/main/java/se/kb/oai/ore/Aggregation.java +++ b/src/main/java/se/kb/oai/ore/Aggregation.java @@ -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; import java.net.URI; diff --git a/src/main/java/se/kb/oai/ore/Metadata.java b/src/main/java/se/kb/oai/ore/Metadata.java index 46ea2ce..4296e6a 100644 --- a/src/main/java/se/kb/oai/ore/Metadata.java +++ b/src/main/java/se/kb/oai/ore/Metadata.java @@ -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; import static se.kb.oai.ore.OREConstants.*; diff --git a/src/main/java/se/kb/oai/ore/OREConstants.java b/src/main/java/se/kb/oai/ore/OREConstants.java index 5b7fbb7..9e53292 100644 --- a/src/main/java/se/kb/oai/ore/OREConstants.java +++ b/src/main/java/se/kb/oai/ore/OREConstants.java @@ -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; import org.dom4j.Namespace; diff --git a/src/main/java/se/kb/oai/ore/ResourceMap.java b/src/main/java/se/kb/oai/ore/ResourceMap.java index b82eae3..66fbaf8 100644 --- a/src/main/java/se/kb/oai/ore/ResourceMap.java +++ b/src/main/java/se/kb/oai/ore/ResourceMap.java @@ -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; import java.net.URI; diff --git a/src/main/java/se/kb/oai/ore/ResourceMapFactory.java b/src/main/java/se/kb/oai/ore/ResourceMapFactory.java index ad448d9..10a396b 100644 --- a/src/main/java/se/kb/oai/ore/ResourceMapFactory.java +++ b/src/main/java/se/kb/oai/ore/ResourceMapFactory.java @@ -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; import java.net.URI; diff --git a/src/main/java/se/kb/oai/ore/ResourceMapSerializer.java b/src/main/java/se/kb/oai/ore/ResourceMapSerializer.java index 4d33a4a..743a53d 100644 --- a/src/main/java/se/kb/oai/ore/ResourceMapSerializer.java +++ b/src/main/java/se/kb/oai/ore/ResourceMapSerializer.java @@ -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; import java.io.File; diff --git a/src/main/java/se/kb/oai/ore/Type.java b/src/main/java/se/kb/oai/ore/Type.java index 4361d43..59d12c7 100644 --- a/src/main/java/se/kb/oai/ore/Type.java +++ b/src/main/java/se/kb/oai/ore/Type.java @@ -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; public class Type { diff --git a/src/main/java/se/kb/oai/ore/impl/AtomConstants.java b/src/main/java/se/kb/oai/ore/impl/AtomConstants.java index 2c6accc..5ba0101 100644 --- a/src/main/java/se/kb/oai/ore/impl/AtomConstants.java +++ b/src/main/java/se/kb/oai/ore/impl/AtomConstants.java @@ -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; import java.text.SimpleDateFormat; diff --git a/src/main/java/se/kb/oai/ore/impl/AtomFactory.java b/src/main/java/se/kb/oai/ore/impl/AtomFactory.java index e495b48..6847df5 100644 --- a/src/main/java/se/kb/oai/ore/impl/AtomFactory.java +++ b/src/main/java/se/kb/oai/ore/impl/AtomFactory.java @@ -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; import java.util.List; diff --git a/src/main/java/se/kb/oai/ore/impl/AtomSerializer.java b/src/main/java/se/kb/oai/ore/impl/AtomSerializer.java index 82c30f0..5e75edf 100644 --- a/src/main/java/se/kb/oai/ore/impl/AtomSerializer.java +++ b/src/main/java/se/kb/oai/ore/impl/AtomSerializer.java @@ -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; import java.util.List; diff --git a/src/main/java/se/kb/oai/ore/impl/FactoryBase.java b/src/main/java/se/kb/oai/ore/impl/FactoryBase.java index b2ca50e..dfd022b 100644 --- a/src/main/java/se/kb/oai/ore/impl/FactoryBase.java +++ b/src/main/java/se/kb/oai/ore/impl/FactoryBase.java @@ -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; import java.net.URI; diff --git a/src/main/java/se/kb/oai/ore/impl/SerializerBase.java b/src/main/java/se/kb/oai/ore/impl/SerializerBase.java index 95896e2..420003e 100644 --- a/src/main/java/se/kb/oai/ore/impl/SerializerBase.java +++ b/src/main/java/se/kb/oai/ore/impl/SerializerBase.java @@ -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; import java.io.File; diff --git a/src/main/java/se/kb/oai/pmh/PMHErrorResponseException.java b/src/main/java/se/kb/oai/pmh/ErrorResponseException.java similarity index 54% rename from src/main/java/se/kb/oai/pmh/PMHErrorResponseException.java rename to src/main/java/se/kb/oai/pmh/ErrorResponseException.java index 4f0ca02..217cdd1 100644 --- a/src/main/java/se/kb/oai/pmh/PMHErrorResponseException.java +++ b/src/main/java/se/kb/oai/pmh/ErrorResponseException.java @@ -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; import se.kb.oai.OAIException; -public class PMHErrorResponseException extends OAIException { +public class ErrorResponseException extends OAIException { private static final long serialVersionUID = -2010182612617642664L; @@ -18,7 +34,7 @@ public class PMHErrorResponseException extends OAIException { private String code; private String message; - public PMHErrorResponseException(String code, String message) { + public ErrorResponseException(String code, String message) { super(); this.code = code; this.message = message; diff --git a/src/main/java/se/kb/oai/pmh/Header.java b/src/main/java/se/kb/oai/pmh/Header.java index 8db4326..bce1608 100644 --- a/src/main/java/se/kb/oai/pmh/Header.java +++ b/src/main/java/se/kb/oai/pmh/Header.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; diff --git a/src/main/java/se/kb/oai/pmh/Identification.java b/src/main/java/se/kb/oai/pmh/Identification.java index 325360f..7d89b9b 100644 --- a/src/main/java/se/kb/oai/pmh/Identification.java +++ b/src/main/java/se/kb/oai/pmh/Identification.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; import java.util.LinkedList; @@ -48,7 +45,7 @@ public class Identification extends ResponseBase { private List descriptions; private List adminEmails; - public Identification(Document document) throws PMHErrorResponseException { + public Identification(Document document) throws ErrorResponseException { super(document); this.repositoryName = xpath.valueOf(REPOSITORYNAME_XPATH); diff --git a/src/main/java/se/kb/oai/pmh/IdentifiersList.java b/src/main/java/se/kb/oai/pmh/IdentifiersList.java index bd32c95..df51b2d 100644 --- a/src/main/java/se/kb/oai/pmh/IdentifiersList.java +++ b/src/main/java/se/kb/oai/pmh/IdentifiersList.java @@ -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; import java.util.LinkedList; @@ -12,7 +28,7 @@ public class IdentifiersList extends ResponseBase { private List
headers; - public IdentifiersList(Document document) throws PMHErrorResponseException { + public IdentifiersList(Document document) throws ErrorResponseException { super(document); this.headers = new LinkedList
(); diff --git a/src/main/java/se/kb/oai/pmh/MetadataFormat.java b/src/main/java/se/kb/oai/pmh/MetadataFormat.java index d8a7792..8837968 100644 --- a/src/main/java/se/kb/oai/pmh/MetadataFormat.java +++ b/src/main/java/se/kb/oai/pmh/MetadataFormat.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; import static se.kb.oai.pmh.ResponseBase.*; diff --git a/src/main/java/se/kb/oai/pmh/MetadataFormatsList.java b/src/main/java/se/kb/oai/pmh/MetadataFormatsList.java index 95f7443..438dfb3 100644 --- a/src/main/java/se/kb/oai/pmh/MetadataFormatsList.java +++ b/src/main/java/se/kb/oai/pmh/MetadataFormatsList.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; import java.util.LinkedList; @@ -31,7 +28,7 @@ public class MetadataFormatsList extends ResponseBase { private List metadataFormats; - public MetadataFormatsList(Document document) throws PMHErrorResponseException { + public MetadataFormatsList(Document document) throws ErrorResponseException { super(document); this.metadataFormats = new LinkedList(); diff --git a/src/main/java/se/kb/oai/pmh/OaiPmhServer.java b/src/main/java/se/kb/oai/pmh/OaiPmhServer.java index 5c514b5..559e8f6 100644 --- a/src/main/java/se/kb/oai/pmh/OaiPmhServer.java +++ b/src/main/java/se/kb/oai/pmh/OaiPmhServer.java @@ -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; import java.net.URL; @@ -50,7 +66,7 @@ public class OaiPmhServer { try { GetRecord getRecord = new GetRecord(baseurl, identifier, metadataPrefix); return new Record(getRecord.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); @@ -61,7 +77,7 @@ public class OaiPmhServer { try { Identify identify = new Identify(baseurl); return new Identification(identify.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); @@ -76,7 +92,7 @@ public class OaiPmhServer { try { ListIdentifiers list = new ListIdentifiers(baseurl, from, until, set, metadataPrefix); return new IdentifiersList(list.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); @@ -87,7 +103,7 @@ public class OaiPmhServer { try { ListIdentifiers list = new ListIdentifiers(baseurl, resumptionToken.getId()); return new IdentifiersList(list.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); @@ -102,7 +118,7 @@ public class OaiPmhServer { try { ListRecords list = new ListRecords(baseurl, from, until, set, metadataPrefix); return new RecordsList(list.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); @@ -113,7 +129,7 @@ public class OaiPmhServer { try { ListRecords list = new ListRecords(baseurl, resumptionToken.getId()); return new RecordsList(list.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); @@ -128,7 +144,7 @@ public class OaiPmhServer { try { ListMetadataFormats list = new ListMetadataFormats(baseurl, identifier); return new MetadataFormatsList(list.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); @@ -139,7 +155,7 @@ public class OaiPmhServer { try { ListSets list = new ListSets(baseurl); return new SetsList(list.getDocument()); - } catch (PMHErrorResponseException e) { + } catch (ErrorResponseException e) { throw e; } catch (Exception e) { throw new OAIException(e); diff --git a/src/main/java/se/kb/oai/pmh/Record.java b/src/main/java/se/kb/oai/pmh/Record.java index 11758cb..b6a327f 100644 --- a/src/main/java/se/kb/oai/pmh/Record.java +++ b/src/main/java/se/kb/oai/pmh/Record.java @@ -39,11 +39,11 @@ public class Record extends ResponseBase { private Element metadata; private Element about; - public Record(Document document) throws PMHErrorResponseException { + public Record(Document document) throws ErrorResponseException { this(document, null); } - public Record(Document document, Node record) throws PMHErrorResponseException { + public Record(Document document, Node record) throws ErrorResponseException { super(document); if (record == null) diff --git a/src/main/java/se/kb/oai/pmh/RecordsList.java b/src/main/java/se/kb/oai/pmh/RecordsList.java index c7978b5..11c34c5 100644 --- a/src/main/java/se/kb/oai/pmh/RecordsList.java +++ b/src/main/java/se/kb/oai/pmh/RecordsList.java @@ -31,7 +31,7 @@ public class RecordsList extends ResponseBase { private List records; - public RecordsList(Document document) throws PMHErrorResponseException { + public RecordsList(Document document) throws ErrorResponseException { super(document); this.records = new LinkedList(); diff --git a/src/main/java/se/kb/oai/pmh/ResponseBase.java b/src/main/java/se/kb/oai/pmh/ResponseBase.java index ba895a3..900ecd1 100644 --- a/src/main/java/se/kb/oai/pmh/ResponseBase.java +++ b/src/main/java/se/kb/oai/pmh/ResponseBase.java @@ -40,7 +40,7 @@ public abstract class ResponseBase { protected String responseDate; protected ResumptionToken resumptionToken; - public ResponseBase(Document document) throws PMHErrorResponseException { + public ResponseBase(Document document) throws ErrorResponseException { DOMReader reader = new DOMReader(); Element root = reader.read(document).getRootElement(); @@ -54,7 +54,7 @@ public abstract class ResponseBase { Element error = xpath.selectSingleElement(ERROR_XPATH); if (error != null) { - throw new PMHErrorResponseException(error.attributeValue("code"), error.getTextTrim()); + throw new ErrorResponseException(error.attributeValue("code"), error.getTextTrim()); } } diff --git a/src/main/java/se/kb/oai/pmh/ResumptionToken.java b/src/main/java/se/kb/oai/pmh/ResumptionToken.java index d550442..a6f41e5 100644 --- a/src/main/java/se/kb/oai/pmh/ResumptionToken.java +++ b/src/main/java/se/kb/oai/pmh/ResumptionToken.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; import org.dom4j.Element; diff --git a/src/main/java/se/kb/oai/pmh/Set.java b/src/main/java/se/kb/oai/pmh/Set.java index f9e88b8..40d97c5 100644 --- a/src/main/java/se/kb/oai/pmh/Set.java +++ b/src/main/java/se/kb/oai/pmh/Set.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; import static se.kb.oai.pmh.ResponseBase.*; diff --git a/src/main/java/se/kb/oai/pmh/SetsList.java b/src/main/java/se/kb/oai/pmh/SetsList.java index 4a927f1..c6f2592 100644 --- a/src/main/java/se/kb/oai/pmh/SetsList.java +++ b/src/main/java/se/kb/oai/pmh/SetsList.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; import java.util.LinkedList; @@ -31,7 +28,7 @@ public class SetsList extends ResponseBase { private List sets; - public SetsList(Document document) throws PMHErrorResponseException { + public SetsList(Document document) throws ErrorResponseException { super(document); this.sets = new LinkedList(); diff --git a/src/main/java/se/kb/xml/XMLUtils.java b/src/main/java/se/kb/xml/XMLUtils.java index f8c4972..891eba5 100644 --- a/src/main/java/se/kb/xml/XMLUtils.java +++ b/src/main/java/se/kb/xml/XMLUtils.java @@ -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; import java.io.ByteArrayOutputStream; diff --git a/src/main/java/se/kb/xml/XPathWrapper.java b/src/main/java/se/kb/xml/XPathWrapper.java index d560ae6..0ce2668 100644 --- a/src/main/java/se/kb/xml/XPathWrapper.java +++ b/src/main/java/se/kb/xml/XPathWrapper.java @@ -1,22 +1,19 @@ /* - * Created on 17 Aug 2007 - * - * Copyright (C) 2007 Royal Library of Sweden. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * 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. + * 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; import java.util.HashMap;