mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fix AR-453 Repository bootstrap fails when performed under Thai regional settings
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2502 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,7 @@ import java.text.ParseException;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.service.cmr.repository.ContentData;
|
import org.alfresco.service.cmr.repository.ContentData;
|
||||||
import org.alfresco.service.cmr.repository.ContentReader;
|
import org.alfresco.service.cmr.repository.ContentReader;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
@@ -176,13 +177,16 @@ public class DefaultTypeConverter
|
|||||||
{
|
{
|
||||||
public Date convert(String source)
|
public Date convert(String source)
|
||||||
{
|
{
|
||||||
Date date = ISO8601DateFormat.parse(source);
|
try
|
||||||
if (date == null)
|
|
||||||
{
|
{
|
||||||
throw new TypeConversionException("Failed to parse date " + source);
|
Date date = ISO8601DateFormat.parse(source);
|
||||||
}
|
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
catch(AlfrescoRuntimeException e)
|
||||||
|
{
|
||||||
|
throw new TypeConversionException("Failed to convert date " + source + " to string", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
INSTANCE.addConverter(String.class, Duration.class, new TypeConverter.Converter<String, Duration>()
|
INSTANCE.addConverter(String.class, Duration.class, new TypeConverter.Converter<String, Duration>()
|
||||||
|
Reference in New Issue
Block a user