Author: arunpatidar
Date: Tue Jun 28 15:01:10 2016
New Revision: 1750532
URL:
http://svn.apache.org/viewvc?rev=1750532&view=revLog:
Applied patch from jira issue - OFBIZ-7453 - Enforce noninstantiability to WebDavUtil Class. Thanks Rishi Solanki and Rohit Koushal for your contribution.
Modified:
ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java
Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java?rev=1750532&r1=1750531&r2=1750532&view=diff==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java Tue Jun 28 15:01:10 2016
@@ -183,7 +183,7 @@ public class ICalWorker {
}
if ("getlastmodified".equals(propElement.getNodeName())) {
Date lastModified = getLastModifiedDate(request);
- Element lmElement = helper.createElementSetValue("D:getlastmodified", WebDavUtil.formatDate(WebDavUtil.RFC1123_DATE_FORMAT, lastModified));
+ Element lmElement = helper.createElementSetValue("D:getlastmodified", WebDavUtil.formatDate(WebDavUtil.getRFC1123DateFormat(), lastModified));
supportedProps.add(lmElement);
continue;
}
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java?rev=1750532&r1=1750531&r2=1750532&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java Tue Jun 28 15:01:10 2016
@@ -39,11 +39,13 @@ import org.w3c.dom.Document;
import org.xml.sax.SAXException;
/** Utility methods needed to implement a WebDAV servlet. */
-public class WebDavUtil {
+public final class WebDavUtil {
public static final String module = WebDavUtil.class.getName();
- public static final TimeZone GMT_TIMEZONE = TimeZone.getTimeZone("GMT");
- public static final String RFC1123_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz";
+ private static final TimeZone GMT_TIMEZONE = TimeZone.getTimeZone("GMT");
+ private static final String RFC1123_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz";
+
+ private WebDavUtil() {}
public static String formatDate(String formatString, Date date) {
DateFormat df = new SimpleDateFormat(formatString);
@@ -105,4 +107,8 @@ public class WebDavUtil {
result.put("login.password", password);
return result;
}
+
+ public static String getRFC1123DateFormat() {
+ return RFC1123_DATE_FORMAT;
+ }
}