how to get information from any file extension in java
import java.util.LinkedList;
import java.io.File;
public class getFileExtention{
public static String[] getExt(File path, String extentionType) {
String [] g = path.list();
//We need to convert it into a linkedlist for
//adding whatever we want any size
//You could also do it with a number
//and iterate over it
LinkedList<String> h = new LinkedList<String>();
for(int c = 0;c < g.length;c++) {
if(g[c].endsWith(extentionType)) {
h.add(g[c]);
}
}
String[] j = new String[h.size()];
//Covert it into a array again
//but not if you made it into a linked list type method
for (int d = 0; d < h.size(); d++) {
j[d] = h.get(d);
}
return j;
}
}
Posted by: Guest
on September-29-2020
Code answers related to "file name check extention java"
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems
resetting your password contact us
Check Your Email and Click on the link sent to your email