1 20 21 package org.jdesktop.jdic.filetypes.internal; 22 23 import java.net.URL ; 24 import java.util.ArrayList ; 25 import java.util.List ; 26 27 30 public class WinAppAssociationReader implements AppAssociationReader { 31 32 38 public String getDescriptionByMimeType(String mimeType) { 39 String temFileExt = WinRegistryUtil.getFileExtByMimeType(mimeType); 40 if (temFileExt != null) { 41 return getDescriptionByFileExt(temFileExt); 42 } else { 43 return null; 44 } 45 } 46 47 53 public String getDescriptionByFileExt(String fileExt) { 54 return WinRegistryUtil.getDescriptionByFileExt(fileExt); 55 } 56 57 64 public String getMimeTypeByURL(URL url) { 65 return WinRegistryUtil.getMimeTypeByURL(url); 66 } 67 68 74 public List getFileExtListByMimeType(String mimeType) { 75 String fileExt = WinRegistryUtil.getFileExtByMimeType(mimeType); 76 if (fileExt != null) { 77 List fileExtList = new ArrayList (); 78 fileExtList.add(fileExt); 79 80 return fileExtList; 81 } 82 83 return null; 84 } 85 86 92 public String getMimeTypeByFileExt(String fileExt) { 93 return WinRegistryUtil.getMimeTypeByFileExt(fileExt); 94 } 95 96 102 public String getIconFileNameByMimeType(String mimeType) { 103 String temFileExt = WinRegistryUtil.getFileExtByMimeType(mimeType); 104 if (temFileExt != null) { 105 return getIconFileNameByFileExt(temFileExt); 106 } else { 107 return null; 108 } 109 } 110 111 117 public String getIconFileNameByFileExt(String fileExt) { 118 return WinRegistryUtil.getIconFileNameByFileExt(fileExt); 119 } 120 121 127 public List getActionListByMimeType(String mimeType) { 128 String temFileExt = WinRegistryUtil.getFileExtByMimeType(mimeType); 129 if (temFileExt != null) { 130 return getActionListByFileExt(temFileExt); 131 } else { 132 return null; 133 } 134 } 135 136 142 public List getActionListByFileExt(String fileExt) { 143 return WinRegistryUtil.getActionListByFileExt(fileExt); 144 } 145 146 152 public boolean isMimeTypeExist(String mimeType) { 153 return WinRegistryUtil.isMimeTypeExist(mimeType); 154 } 155 156 162 public boolean isFileExtExist(String fileExt) { 163 return WinRegistryUtil.isFileExtExist(fileExt); 164 } 165 } 166 | Popular Tags |