mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
added url and creationdate to repository
This commit is contained in:
@@ -17,6 +17,7 @@ import java.io.Serializable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
@@ -29,7 +30,8 @@ import javax.xml.bind.annotation.XmlType;
|
||||
@XmlRootElement(name = "repositories")
|
||||
@XmlType(propOrder =
|
||||
{
|
||||
"id", "type", "name", "contact", "description", "permissions"
|
||||
"id", "type", "name", "contact", "description", "creationDate", "url",
|
||||
"permissions"
|
||||
})
|
||||
public class Repository implements Serializable
|
||||
{
|
||||
@@ -102,6 +104,17 @@ public class Repository implements Serializable
|
||||
return contact;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Date getCreationDate()
|
||||
{
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -157,6 +170,17 @@ public class Repository implements Serializable
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getUrl()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
//~--- set methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
@@ -170,6 +194,17 @@ public class Repository implements Serializable
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param creationDate
|
||||
*/
|
||||
public void setCreationDate(Date creationDate)
|
||||
{
|
||||
this.creationDate = creationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -225,11 +260,25 @@ public class Repository implements Serializable
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param url
|
||||
*/
|
||||
public void setUrl(String url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
private String contact;
|
||||
|
||||
/** Field description */
|
||||
private Date creationDate;
|
||||
|
||||
/** Field description */
|
||||
private String description;
|
||||
|
||||
@@ -244,4 +293,7 @@ public class Repository implements Serializable
|
||||
|
||||
/** Field description */
|
||||
private String type;
|
||||
|
||||
/** Field description */
|
||||
private String url;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,12 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -26,6 +31,9 @@ import java.util.logging.Logger;
|
||||
public class Util
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
public static final String DATE_PATTERN = "yyyy-MM-dd HH-mm-ss";
|
||||
|
||||
/** Field description */
|
||||
private static final Logger logger = Logger.getLogger(Util.class.getName());
|
||||
|
||||
@@ -100,6 +108,79 @@ public class Util
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param date
|
||||
* @param tz
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String formatDate(Date date, TimeZone tz)
|
||||
{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN);
|
||||
|
||||
if (tz != null)
|
||||
{
|
||||
sdf.setTimeZone(tz);
|
||||
}
|
||||
|
||||
return sdf.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param date
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String formatDate(Date date)
|
||||
{
|
||||
return formatDate(date, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param dateString
|
||||
* @param tz
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws ParseException
|
||||
*/
|
||||
public static Date parseDate(String dateString, TimeZone tz)
|
||||
throws ParseException
|
||||
{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(DATE_PATTERN);
|
||||
|
||||
if (tz != null)
|
||||
{
|
||||
sdf.setTimeZone(tz);
|
||||
}
|
||||
|
||||
return sdf.parse(dateString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param dateString
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws ParseException
|
||||
*/
|
||||
public static Date parseDate(String dateString) throws ParseException
|
||||
{
|
||||
return parseDate(dateString, null);
|
||||
}
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user