X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/154bb85cf1cc5347333be1cea339907b13cc746a..a4ba6170ea7696e085b07adfef73eeb8b77cb8e2:/src/eu/alefzero/owncloud/DisplayUtils.java
diff --git a/src/eu/alefzero/owncloud/DisplayUtils.java b/src/eu/alefzero/owncloud/DisplayUtils.java
deleted file mode 100644
index bb16f596..00000000
--- a/src/eu/alefzero/owncloud/DisplayUtils.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ownCloud Android client application
- * Copyright (C) 2011 Bartek Przybylski
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-
-package eu.alefzero.owncloud;
-
-import java.util.HashMap;
-
-public class DisplayUtils {
- public static String bitsToHumanReadable(long bitsLen) {
- double result = bitsLen;
- int attachedsuff = 0;
- while (result > 1024 && attachedsuff < suffixes.length) {
- result /= 1024.;
- attachedsuff++;
- }
- result = ((int)(result * 100))/100.;
- return result+suffixes[attachedsuff];
- }
-
- public static String convertMIMEtoPrettyPrint(String mimetype) {
- if (mimeType2HUmanReadable.containsKey(mimetype)) {
- return mimeType2HUmanReadable.get(mimetype);
- }
- return mimetype.split("/")[1].toUpperCase() + " file";
- }
-
- private static final String[] suffixes = {"B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
-
- private static HashMap mimeType2HUmanReadable;
- static {
- mimeType2HUmanReadable = new HashMap();
- // images
- mimeType2HUmanReadable.put("image/jpeg", "JPEG image");
- mimeType2HUmanReadable.put("image/jpg", "JPEG image");
- mimeType2HUmanReadable.put("image/png", "PNG image");
- mimeType2HUmanReadable.put("image/bmp", "Bitmap image");
- mimeType2HUmanReadable.put("image/gif", "GIF image");
- mimeType2HUmanReadable.put("image/svg+xml", "JPEG image");
- mimeType2HUmanReadable.put("image/tiff", "TIFF image");
- // music
- mimeType2HUmanReadable.put("audio/mpeg", "MP3 music file");
- mimeType2HUmanReadable.put("application/ogg", "OGG music file");
-
- }
-}