mmb.engine.files.FileUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multimachinebuilder Show documentation
Show all versions of multimachinebuilder Show documentation
Dependency for the MultiMachineBuilder, a voxel game about building an industrial empire in a finite world.
THIS RELEASE IS NOT PLAYABLE. To play the game, donwload from >ITCH.IO LINK HERE< or >GH releases link here<
The newest version!
/**
*
*/
package mmb.engine.files;
import java.io.File;
import java.net.MalformedURLException;
import mmb.NN;
/**
* @author oskar
*
*/
public class FileUtil {
@NN public static AdvancedFile getFile(String path) throws MalformedURLException {
if(path.contains("://")) return new OnlineFile(path);
return new LocalFile(path);
}
/** Find all directories located in the given directory
* @param root target container directory
* @return array of directories
*/
public static File[] findDirectories(File root) {
return root.listFiles(File::isDirectory);
}
/** Find all files located in the given directory
* @param root target container directory
* @return array of files
*/
public static File[] findFiles(File root) {
return root.listFiles(File::isFile);
}
}