Skip to content

Commit bae9790

Browse files
committed
Adding Copyright Headers to Files.
1 parent 9ad2c02 commit bae9790

16 files changed

+272
-117
lines changed

WebContent/WEB-INF/log4j.properties

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1+
#
2+
# Copyright (c) 2016 by The President and Fellows of Harvard College
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
# See the License for the specific language governing permission and limitations under the License.
9+
#
10+
111
#------------------------------------------------------------------------------
212
#
313
# The following properties set the logging levels and log appender. The
414
# log4j.rootCategory variable defines the default log level plus one or more
5-
# appenders.
15+
# appenders.
616
#
7-
# To override the default (rootCategory) log level,
17+
# To override the default (rootCategory) log level,
818
# define a property of the form (see below for available values):
919
#
1020
# Available logger names:

WebContent/index.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<!DOCTYPE html>
2-
<html>
2+
<!--
3+
Copyright (c) 2016 by The President and Fellows of Harvard College
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License. You may obtain a copy of the License at:
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software distributed under the License is
8+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
See the License for the specific language governing permission and limitations under the License.
10+
-->
11+
<html>
312
<head>
413
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
514
<meta charset="UTF-8">

WebContent/upload.jsp

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<%--
2+
Copyright (c) 2016 by The President and Fellows of Harvard College
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
http://www.apache.org/licenses/LICENSE-2.0
6+
Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
See the License for the specific language governing permission and limitations under the License.
9+
--%>
10+
111
<%@ page language="java" contentType="text/html; charset=UTF-8"
212
pageEncoding="UTF-8"%>
313
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -16,4 +26,4 @@
1626
</form>
1727
</center>
1828
</body>
19-
</html>
29+
</html>

run-test-client.sh

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
#
2+
# Copyright (c) 2016 by The President and Fellows of Harvard College
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
# See the License for the specific language governing permission and limitations under the License.
9+
#
10+
111
# Script for running the test client from a terminal -- edu.harvard.hul.ois.fits.clients.FormFileUploaderClientApplication
212
# Be sure to include the input file parameter to a valid file location.
313

src/edu/harvard/hul/ois/fits/service/common/Constants.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.common;
212

313
public class Constants {

src/edu/harvard/hul/ois/fits/service/common/ErrorMessage.java

+30-21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.common;
212

313
import static javax.servlet.http.HttpServletResponse.*;
@@ -25,11 +35,11 @@ public class ErrorMessage {
2535

2636
public ErrorMessage() {
2737
super();
28-
}
29-
38+
}
39+
3040
/**
3141
* Full constructor
32-
*
42+
*
3343
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html for status code and reason phrase
3444
* @param statusCode - the http status code as a String
3545
* @param message - the detailed error message
@@ -45,8 +55,8 @@ public ErrorMessage(int statusCode, String message, String request, String suppo
4555

4656
/**
4757
* minimal constructor
48-
* This constructor sets the status to an internal error
49-
*
58+
* This constructor sets the status to an internal error
59+
*
5060
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html for status code and reason phrase
5161
* @param statusCode - the http status code as a String
5262
* @param reasonPhrase - the http status line reasonPhrase
@@ -58,7 +68,7 @@ public ErrorMessage(String message, String request){
5868
this.message = message;
5969
this.request = request;
6070
}
61-
71+
6272
/**
6373
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html for status code and reason phrase
6474
* @param statusCode - the http status code as a String
@@ -72,8 +82,8 @@ public ErrorMessage(int statusCode, String message, String request){
7282
}
7383

7484
/**
75-
* This constructor sets the status to an internal error
76-
*
85+
* This constructor sets the status to an internal error
86+
*
7787
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html for status code and reason phrase
7888
* @param message - the detailed error message
7989
* @param request - the request URL
@@ -86,7 +96,7 @@ public ErrorMessage(String message, String request, String support){
8696
this.support = support;
8797
}
8898

89-
99+
90100
public String getMessage() {
91101
return message;
92102
}
@@ -121,16 +131,16 @@ public String getSupport() {
121131

122132
public void setSupport(String support) {
123133
this.support = support;
124-
}
125-
126-
134+
}
135+
136+
127137
/**
128138
* @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html
129139
* @param statusCode
130140
* @return
131141
*/
132142
public String getReasonPhrase(int statusCode){
133-
switch (statusCode) {
143+
switch (statusCode) {
134144
case SC_CONTINUE : return "Continue";
135145
case SC_SWITCHING_PROTOCOLS : return "Switching Protocols";
136146
case SC_OK : return "OK";
@@ -174,9 +184,9 @@ public String getReasonPhrase(int statusCode){
174184
default: return "Internal Server Error";
175185
}
176186
}
177-
178-
179-
187+
188+
189+
180190
/**
181191
* A convenience in case jaxb marshalling is not available
182192
*/
@@ -187,17 +197,16 @@ public String toString(){
187197
.append(statusCode)
188198
.append("</statusCode>")
189199
.append("<message>")
190-
.append(message != null? message : "")
200+
.append(message != null? message : "")
191201
.append("</message>")
192202
.append("<request>")
193-
.append(request != null? request : "")
203+
.append(request != null? request : "")
194204
.append("</request>")
195205
.append("<support>")
196-
.append("[toString version]" + (support != null? support : ""))
206+
.append("[toString version]" + (support != null? support : ""))
197207
.append("</support>")
198208
.append("</error>");
199209
return sb.toString();
200210
}
201-
202-
}
203211

212+
}

src/edu/harvard/hul/ois/fits/service/common/ServletRequestContext.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.common;
212

313
import static java.lang.String.format;
@@ -109,4 +119,3 @@ public String toString() {
109119
}
110120

111121
}
112-

src/edu/harvard/hul/ois/fits/service/common/UploadContext.java

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.common;
212

313
import org.apache.commons.fileupload.RequestContext;

src/edu/harvard/hul/ois/fits/service/listeners/LoggingConfigurator.java

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.listeners;
212

313
import java.io.File;
@@ -12,11 +22,11 @@
1222
* If there is a System property that references a Log4j properties file and either that
1323
* file does not exist or results in some error, there is normally no fall-back to use
1424
* the default file supplied with the WAR file. This class remedies this shortcoming.
15-
*
25+
*
1626
* @author dan179
1727
*/
1828
public class LoggingConfigurator implements ServletContextListener {
19-
29+
2030
/*
2131
* This is the System property that the Log4j framework will use to configure its properties.
2232
* It should reference a log4j.properties file.
@@ -25,7 +35,7 @@ public class LoggingConfigurator implements ServletContextListener {
2535

2636
/**
2737
* Configure the Log4j logging framework on application initialization.
28-
*
38+
*
2939
* @param ctx - The ServletContextEvent
3040
*/
3141
@Override
@@ -50,7 +60,7 @@ public void contextInitialized(ServletContextEvent ctx) {
5060
log4jUri = null;
5161
throw new URISyntaxException(log4jSystemProp, "Not a valid file");
5262
}
53-
63+
5464
// Even if set, reset logging System property to ensure it's in a URI format
5565
// with scheme so the log4j framework can initialize.
5666
System.setProperty( LOG4J_SYSTEM_PROPERTY, log4jUri.toString());
@@ -64,7 +74,7 @@ public void contextInitialized(ServletContextEvent ctx) {
6474
}
6575
// Else no external log4j.properties file then the default file from WAR will be used.
6676
}
67-
77+
6878
@Override
6979
public void contextDestroyed(ServletContextEvent ctx) {
7080
// nothing to do here

src/edu/harvard/hul/ois/fits/service/pool/FitsWrapper.java

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.pool;
212

313
import static edu.harvard.hul.ois.fits.service.common.Constants.FITS_HOME_SYSTEM_PROP_NAME;
@@ -14,23 +24,23 @@
1424
*
1525
*/
1626
public class FitsWrapper {
17-
1827

19-
private static final String fitsHome = System.getProperty(FITS_HOME_SYSTEM_PROP_NAME);
28+
29+
private static final String fitsHome = System.getProperty(FITS_HOME_SYSTEM_PROP_NAME);
2030
private static Logger logger = Logger.getLogger(FitsWrapper.class);
2131
private Fits fits;
2232

2333
public FitsWrapper() throws ServletException {
24-
34+
2535
logger.debug("Creating new Fits wrapper");
2636
logger.info("FITS HOME: "+fitsHome);
27-
37+
2838
// This really should have been checked earlier.
2939
if (fitsHome == null) {
3040
logger.fatal(FITS_HOME_SYSTEM_PROP_NAME + " system property HAS NOT BEEN SET!!! This web application will not properly run.");
3141
throw new ServletException(FITS_HOME_SYSTEM_PROP_NAME + " system property HAS NOT BEEN SET!!! This web application will not properly run.");
3242
}
33-
43+
3444
try {
3545
this.fits = new Fits(fitsHome);
3646
} catch (FitsException fce){

src/edu/harvard/hul/ois/fits/service/pool/FitsWrapperFactory.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.pool;
212

313
import org.apache.commons.pool2.BasePooledObjectFactory;
@@ -26,4 +36,4 @@ public boolean validateObject(PooledObject<FitsWrapper> fitsWrapper){
2636
}
2737

2838

29-
}
39+
}

src/edu/harvard/hul/ois/fits/service/pool/FitsWrapperPool.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
//
2+
// Copyright (c) 2016 by The President and Fellows of Harvard College
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License. You may obtain a copy of the License at:
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software distributed under the License is
7+
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8+
// See the License for the specific language governing permission and limitations under the License.
9+
//
10+
111
package edu.harvard.hul.ois.fits.service.pool;
212

313
import org.apache.commons.pool2.PooledObjectFactory;
@@ -15,4 +25,3 @@ public FitsWrapperPool(PooledObjectFactory<FitsWrapper> factory, GenericObjectPo
1525
}
1626

1727
}
18-

0 commit comments

Comments
 (0)