Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -59,14 +59,12 @@ abstract class ConversionUtils {
|
||||
// yes
|
||||
return true;
|
||||
}
|
||||
else if (sourceElementType.getType().isAssignableFrom(targetElementType.getType())) {
|
||||
if (sourceElementType.getType().isAssignableFrom(targetElementType.getType())) {
|
||||
// maybe
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
// no
|
||||
return false;
|
||||
}
|
||||
// no
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Class<?> getEnumType(Class<?> targetType) {
|
||||
|
||||
@@ -71,146 +71,146 @@ public abstract class MimeTypeUtils {
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
*/
|
||||
@Deprecated
|
||||
public final static MimeType APPLICATION_ATOM_XML;
|
||||
public static final MimeType APPLICATION_ATOM_XML;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#APPLICATION_ATOM_XML}.
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
*/
|
||||
@Deprecated
|
||||
public final static String APPLICATION_ATOM_XML_VALUE = "application/atom+xml";
|
||||
public static final String APPLICATION_ATOM_XML_VALUE = "application/atom+xml";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code application/x-www-form-urlencoded}.
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
* */
|
||||
@Deprecated
|
||||
public final static MimeType APPLICATION_FORM_URLENCODED;
|
||||
public static final MimeType APPLICATION_FORM_URLENCODED;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#APPLICATION_FORM_URLENCODED}.
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
*/
|
||||
@Deprecated
|
||||
public final static String APPLICATION_FORM_URLENCODED_VALUE = "application/x-www-form-urlencoded";
|
||||
public static final String APPLICATION_FORM_URLENCODED_VALUE = "application/x-www-form-urlencoded";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code application/json}.
|
||||
* */
|
||||
public final static MimeType APPLICATION_JSON;
|
||||
public static final MimeType APPLICATION_JSON;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#APPLICATION_JSON}.
|
||||
*/
|
||||
public final static String APPLICATION_JSON_VALUE = "application/json";
|
||||
public static final String APPLICATION_JSON_VALUE = "application/json";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code application/octet-stream}.
|
||||
* */
|
||||
public final static MimeType APPLICATION_OCTET_STREAM;
|
||||
public static final MimeType APPLICATION_OCTET_STREAM;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#APPLICATION_OCTET_STREAM}.
|
||||
*/
|
||||
public final static String APPLICATION_OCTET_STREAM_VALUE = "application/octet-stream";
|
||||
public static final String APPLICATION_OCTET_STREAM_VALUE = "application/octet-stream";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code application/xhtml+xml}.
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
*/
|
||||
@Deprecated
|
||||
public final static MimeType APPLICATION_XHTML_XML;
|
||||
public static final MimeType APPLICATION_XHTML_XML;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#APPLICATION_XHTML_XML}.
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
*/
|
||||
@Deprecated
|
||||
public final static String APPLICATION_XHTML_XML_VALUE = "application/xhtml+xml";
|
||||
public static final String APPLICATION_XHTML_XML_VALUE = "application/xhtml+xml";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code application/xml}.
|
||||
*/
|
||||
public final static MimeType APPLICATION_XML;
|
||||
public static final MimeType APPLICATION_XML;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#APPLICATION_XML}.
|
||||
*/
|
||||
public final static String APPLICATION_XML_VALUE = "application/xml";
|
||||
public static final String APPLICATION_XML_VALUE = "application/xml";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code image/gif}.
|
||||
*/
|
||||
public final static MimeType IMAGE_GIF;
|
||||
public static final MimeType IMAGE_GIF;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#IMAGE_GIF}.
|
||||
*/
|
||||
public final static String IMAGE_GIF_VALUE = "image/gif";
|
||||
public static final String IMAGE_GIF_VALUE = "image/gif";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code image/jpeg}.
|
||||
*/
|
||||
public final static MimeType IMAGE_JPEG;
|
||||
public static final MimeType IMAGE_JPEG;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#IMAGE_JPEG}.
|
||||
*/
|
||||
public final static String IMAGE_JPEG_VALUE = "image/jpeg";
|
||||
public static final String IMAGE_JPEG_VALUE = "image/jpeg";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code image/png}.
|
||||
*/
|
||||
public final static MimeType IMAGE_PNG;
|
||||
public static final MimeType IMAGE_PNG;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#IMAGE_PNG}.
|
||||
*/
|
||||
public final static String IMAGE_PNG_VALUE = "image/png";
|
||||
public static final String IMAGE_PNG_VALUE = "image/png";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code multipart/form-data}.
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
*/
|
||||
@Deprecated
|
||||
public final static MimeType MULTIPART_FORM_DATA;
|
||||
public static final MimeType MULTIPART_FORM_DATA;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#MULTIPART_FORM_DATA}.
|
||||
* @deprecated as of 4.3.6, in favor of {@code MediaType} constants
|
||||
*/
|
||||
@Deprecated
|
||||
public final static String MULTIPART_FORM_DATA_VALUE = "multipart/form-data";
|
||||
public static final String MULTIPART_FORM_DATA_VALUE = "multipart/form-data";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code text/html}.
|
||||
* */
|
||||
public final static MimeType TEXT_HTML;
|
||||
public static final MimeType TEXT_HTML;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#TEXT_HTML}.
|
||||
*/
|
||||
public final static String TEXT_HTML_VALUE = "text/html";
|
||||
public static final String TEXT_HTML_VALUE = "text/html";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code text/plain}.
|
||||
* */
|
||||
public final static MimeType TEXT_PLAIN;
|
||||
public static final MimeType TEXT_PLAIN;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#TEXT_PLAIN}.
|
||||
*/
|
||||
public final static String TEXT_PLAIN_VALUE = "text/plain";
|
||||
public static final String TEXT_PLAIN_VALUE = "text/plain";
|
||||
|
||||
/**
|
||||
* Public constant mime type for {@code text/xml}.
|
||||
* */
|
||||
public final static MimeType TEXT_XML;
|
||||
public static final MimeType TEXT_XML;
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MimeTypeUtils#TEXT_XML}.
|
||||
*/
|
||||
public final static String TEXT_XML_VALUE = "text/xml";
|
||||
public static final String TEXT_XML_VALUE = "text/xml";
|
||||
|
||||
|
||||
static {
|
||||
|
||||
@@ -638,7 +638,7 @@ public abstract class StringUtils {
|
||||
String prefix = "";
|
||||
if (prefixIndex != -1) {
|
||||
prefix = pathToUse.substring(0, prefixIndex + 1);
|
||||
if (prefix.contains("/")) {
|
||||
if (prefix.contains(FOLDER_SEPARATOR)) {
|
||||
prefix = "";
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user