/**
* Full range marker.
*/
- protected static ArrayList FULL = new ArrayList();
+ protected static ArrayList<Range> FULL = new ArrayList<Range>();
// ----------------------------------------------------- Static Initializer
if (obj instanceof Resource)
oldResource = (Resource) obj;
} catch (NamingException e) {
- ;
+ // Ignore
}
// Copy data in oldRevisionContent to contentFile
cacheEntry.attributes.setMimeType(contentType);
}
- ArrayList ranges = null;
+ ArrayList<Range> ranges = null;
long contentLength = -1L;
if (cacheEntry.context != null) {
if (ranges.size() == 1) {
- Range range = (Range) ranges.get(0);
+ Range range = ranges.get(0);
response.addHeader("Content-Range", "bytes "
+ range.start
+ "-" + range.end + "/"
* @param response The servlet response we are creating
* @return Vector of ranges
*/
- protected ArrayList parseRange(HttpServletRequest request,
- HttpServletResponse response,
- ResourceAttributes resourceAttributes)
- throws IOException {
+ protected ArrayList<Range> parseRange(HttpServletRequest request,
+ HttpServletResponse response,
+ ResourceAttributes resourceAttributes) throws IOException {
// Checking If-Range
String headerValue = request.getHeader("If-Range");
try {
headerValueTime = request.getDateHeader("If-Range");
} catch (IllegalArgumentException e) {
- ;
+ // Ignore
}
String eTag = getETag(resourceAttributes);
try {
// Render the directory entries within this directory
- NamingEnumeration enumeration = resources.list(cacheEntry.name);
+ NamingEnumeration<NameClassPair> enumeration =
+ resources.list(cacheEntry.name);
// rewriteUrl(contextPath) is expensive. cache result for later reuse
String rewrittenContextPath = rewriteUrl(contextPath);
while (enumeration.hasMoreElements()) {
- NameClassPair ncPair = (NameClassPair) enumeration.nextElement();
+ NameClassPair ncPair = enumeration.nextElement();
String resourceName = ncPair.getName();
String trimmed = resourceName/*.substring(trim)*/;
if (trimmed.equalsIgnoreCase("WEB-INF") ||
try {
// Render the directory entries within this directory
- NamingEnumeration enumeration = resources.list(cacheEntry.name);
+ NamingEnumeration<NameClassPair> enumeration =
+ resources.list(cacheEntry.name);
boolean shade = false;
while (enumeration.hasMoreElements()) {
- NameClassPair ncPair = (NameClassPair) enumeration.nextElement();
+ NameClassPair ncPair = enumeration.nextElement();
String resourceName = ncPair.getName();
String trimmed = resourceName/*.substring(trim)*/;
if (trimmed.equalsIgnoreCase("WEB-INF") ||
* @exception IOException if an input/output error occurs
*/
protected void copy(CacheEntry cacheEntry, ServletOutputStream ostream,
- Iterator ranges, String contentType)
+ Iterator<Range> ranges, String contentType)
throws IOException {
IOException exception = null;
InputStream istream =
new BufferedInputStream(resourceInputStream, input);
- Range currentRange = (Range) ranges.next();
+ Range currentRange = ranges.next();
// Writing MIME header.
ostream.println();
* @exception IOException if an input/output error occurs
*/
protected void copy(CacheEntry cacheEntry, PrintWriter writer,
- Iterator ranges, String contentType)
+ Iterator<Range> ranges, String contentType)
throws IOException {
IOException exception = null;
fileEncoding);
}
- Range currentRange = (Range) ranges.next();
+ Range currentRange = ranges.next();
// Writing MIME header.
writer.println();