X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/cb5f8b3fcd38e65d527433b760d138f1506d6ccb..68b9744a9c99f38d35a7b146cde4f4deceee68b7:/src/com/owncloud/android/utils/DisplayUtils.java diff --git a/src/com/owncloud/android/utils/DisplayUtils.java b/src/com/owncloud/android/utils/DisplayUtils.java index f95c8904..905f60b2 100644 --- a/src/com/owncloud/android/utils/DisplayUtils.java +++ b/src/com/owncloud/android/utils/DisplayUtils.java @@ -1,6 +1,10 @@ -/* ownCloud Android client application +/** + * ownCloud Android client application + * + * @author Bartek Przybylski + * @author David A. Velasco * Copyright (C) 2011 Bartek Przybylski - * Copyright (C) 2012-2013 ownCloud Inc. + * Copyright (C) 2015 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -26,6 +30,7 @@ import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Set; +import java.util.Vector; import android.annotation.TargetApi; import android.content.Context; @@ -39,9 +44,6 @@ import com.owncloud.android.datamodel.OCFile; /** * A helper class for some string operations. - * - * @author Bartek Przybylski - * @author David A. Velasco */ public class DisplayUtils { @@ -80,7 +82,8 @@ public class DisplayUtils { "msword", "vnd.openxmlformats-officedocument.wordprocessingml.document", "vnd.oasis.opendocument.text", - "rtf" + "rtf", + "javascript" }; private static Set SUBTYPES_DOCUMENT_SET = new HashSet(Arrays.asList(SUBTYPES_DOCUMENT)); private static final String[] SUBTYPES_SPREADSHEET = { @@ -221,20 +224,19 @@ public class DisplayUtils { private static String getExtension(String filename) { - String extension = filename.substring(filename.lastIndexOf(".") + 1); + String extension = filename.substring(filename.lastIndexOf(".") + 1).toLowerCase(); return extension; } /** * Converts Unix time to human readable format - * @param miliseconds that have passed since 01/01/1970 + * @param milliseconds that have passed since 01/01/1970 * @return The human readable time for the users locale */ public static String unixTimeToHumanReadable(long milliseconds) { Date date = new Date(milliseconds); DateFormat df = DateFormat.getDateTimeInstance(); - //return date.toLocaleString(); - return df.format(date); + return df.format(date); } @@ -340,4 +342,5 @@ public class DisplayUtils { } return path; } + }