mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-04-30 15:29:51 +00:00
Biscuit
This commit is contained in:
parent
3378042837
commit
ef5e90f4c9
8 changed files with 195 additions and 129 deletions
|
|
@ -742,34 +742,4 @@ public class VectrasApp extends Application {
|
|||
AppConfig.romsdatajson = AppConfig.maindirpath + "roms-data.json";
|
||||
AppConfig.vmFolder = AppConfig.maindirpath + "roms/";
|
||||
}
|
||||
|
||||
public static String quickScanDiskFileInFolder(String _foderpath) {
|
||||
if (!_foderpath.isEmpty()) {
|
||||
int _startRepeat = 0;
|
||||
ArrayList<String> _filelist = new ArrayList<>();
|
||||
listDir(_foderpath, _filelist);
|
||||
if (!_filelist.isEmpty()) {
|
||||
for (int _repeat = 0; _repeat < (int)(_filelist.size()); _repeat++) {
|
||||
if (_startRepeat < _filelist.size()) {
|
||||
if (isADiskFile(_filelist.get((int)(_startRepeat)))) {
|
||||
return _filelist.get((int)(_startRepeat));
|
||||
}
|
||||
}
|
||||
_startRepeat++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static boolean isADiskFile (String _filepath) {
|
||||
if (_filepath.contains(".")) {
|
||||
String _getFileName = Objects.requireNonNull(Uri.parse(_filepath).getLastPathSegment()).toLowerCase();
|
||||
String _getFileFormat = _getFileName.substring((int)(_getFileName.lastIndexOf(".") + 1), (int)(_getFileName.length()));
|
||||
if ("qcow2,img,vhd,vhdx,vdi,qcow,vmdk,vpc".contains(_getFileFormat)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue