Skip to content

Commit

Permalink
Small file handle fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Jul 15, 2024
1 parent 94b3a27 commit b812577
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ public class AssetFileHandle extends FileHandle {
public AssetFilter filter;

public static AssetFileHandle createHandle(String fileName, FileType type) {
return new AssetFileHandle(fileName, type, type);
return new AssetFileHandle(fileName, FileType.Absolute, type);
}

public static AssetFileHandle createCopyHandle(File file, FileType type) {
public static AssetFileHandle createHandle(File file, FileType type) {
return new AssetFileHandle(file, FileType.Absolute, type);
}

public static AssetFileHandle createCopyHandle(String fileName, FileType type) {
return new AssetFileHandle(fileName, FileType.Absolute, type);
}

public static AssetFileHandle createCopyHandle(String fileName, FileType type, String assetsChildDir) {
return createCopyHandle(fileName, type, assetsChildDir, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static ArrayList<Asset> copy(TeaClassLoader classloader, List<String> cl
dest.write(is, false);
String destPath = dest.path();
if(!destPath.endsWith(".js") && !destPath.endsWith(".wasm")) {
AssetFileHandle dest2 = AssetFileHandle.createCopyHandle(dest.file(), FileType.Classpath);
AssetFileHandle dest2 = AssetFileHandle.createHandle(dest.file(), FileType.Classpath);
assets.add(new Asset(dest2, getType(destPath), op));
}
is.close();
Expand Down Expand Up @@ -287,7 +287,7 @@ private static void copyDirectory(FileHandle sourceDir, FileHandle destDir, Asse
FileHandle srcFile = files[i];
FileHandle destFile1 = destDir.child(srcFile.name());
// Destination type is copied from source type
FileHandle destFile = AssetFileHandle.createCopyHandle(destFile1.file(), srcFile.type());
FileHandle destFile = AssetFileHandle.createHandle(destFile1.file(), srcFile.type());
if(srcFile.isDirectory()) {
AssetFilterOption op = new AssetFilterOption();
if(!filter.accept(destPath, true, op)) continue;
Expand Down

0 comments on commit b812577

Please sign in to comment.