Example #1
0
 public AssetsSound(String file) {
   this.lock = new Object();
   if (file.startsWith(assets)) {
     this.fileName = StringUtils.replace(file, assets, "");
   } else if (file.startsWith(LSystem.FS + assets)) {
     this.fileName = StringUtils.replace(file, LSystem.FS + assets, "");
   } else {
     this.fileName = file;
   }
   this.context = LSystem.screenActivity;
 }
Example #2
0
 public static File getCacheFile(String fileName) {
   final String file = LSystem.getCacheFileName();
   fileName = StringUtils.replaceIgnoreCase(fileName, "\\", "/");
   if (file != null) {
     if (fileName.startsWith("/") || fileName.startsWith("\\")) {
       fileName = fileName.substring(1, fileName.length());
     }
     if (file.endsWith("/") || file.endsWith("\\")) {
       return new File(LSystem.getCacheFileName() + fileName);
     } else {
       return new File(LSystem.getCacheFileName() + LSystem.FS + fileName);
     }
   } else {
     return new File(fileName);
   }
 }