Where people come together to learn, code, and play. Custom-built HTTP server, site generator, and website from scratch using no external libraries. Goal is to be as minimalistic and fun as possible.
http://projectdivar.com
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
932 B
31 lines
932 B
import java.io.IOException;
|
|
import java.nio.file.FileStore;
|
|
import java.nio.file.Files;
|
|
import java.nio.file.Path;
|
|
import java.nio.file.Paths;
|
|
import java.util.AbstractMap;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.stream.Collectors;
|
|
|
|
public class sigPlace {
|
|
final static HashMap<String,String> map = new HashMap<>(Map.ofEntries(
|
|
new AbstractMap.SimpleEntry<>("$SITENAME", "SigPlace")
|
|
));
|
|
public static void main(String[] args) {
|
|
Set<Path> files = GetFilesInDir("sitefiles");
|
|
for (Path f : files) {
|
|
System.out.println(f.getFileName());
|
|
}
|
|
}
|
|
private static Set<Path> GetFilesInDir(String directory) {
|
|
Path dir = Paths.get(directory);
|
|
try {
|
|
return Files.list(dir).collect(Collectors.toSet());
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
return null;
|
|
}
|
|
} |