You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2022/04/04 15:12:40 UTC
[struts] branch master updated: Drops unused class
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/struts.git
The following commit(s) were added to refs/heads/master by this push:
new b73fec4de Drops unused class
b73fec4de is described below
commit b73fec4de06e4bbd1a32a324cb989be723b7bc7a
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Mon Apr 4 17:12:33 2022 +0200
Drops unused class
---
.../org/apache/struts2/util/DateFormatter.java | 91 ----------------------
1 file changed, 91 deletions(-)
diff --git a/core/src/main/java/org/apache/struts2/util/DateFormatter.java b/core/src/main/java/org/apache/struts2/util/DateFormatter.java
deleted file mode 100644
index ad587f9ca..000000000
--- a/core/src/main/java/org/apache/struts2/util/DateFormatter.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.struts2.util;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * A bean that can be used to format dates
- *
- * FIXME: remove or use to format Dates
- */
-public class DateFormatter {
-
- Date date;
- DateFormat format;
-
- // Attributes ----------------------------------------------------
- DateFormat parser;
-
-
- // Public --------------------------------------------------------
- public DateFormatter() {
- this.parser = new SimpleDateFormat();
- this.format = new SimpleDateFormat();
- this.date = new Date();
- }
-
-
- public void setDate(String date) {
- try {
- this.date = parser.parse(date);
- } catch (ParseException e) {
- throw new IllegalArgumentException(e.getMessage());
- }
- }
-
- public void setDate(Date date) {
- this.date = (date == null) ? null : (Date)date.clone();
- }
-
- public void setDate(int date) {
- setDate(Integer.toString(date));
- }
-
- public Date getDate() {
- return this.date;
- }
-
- public void setFormat(String format) {
- this.format = new SimpleDateFormat(format);
- }
-
- public void setFormat(DateFormat format) {
- this.format = format;
- }
-
- public String getFormattedDate() {
- return format.format(date);
- }
-
- public void setParseFormat(String format) {
- this.parser = new SimpleDateFormat(format);
- }
-
- public void setParser(DateFormat parser) {
- this.parser = parser;
- }
-
- public void setTime(long time) {
- date.setTime(time);
- }
-}