![JAR search and dependency download from the Maven repository](/logo.png)
org.bridje.vfs.impl.VfsServiceImpl Maven / Gradle / Ivy
package org.bridje.vfs.impl;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URISyntaxException;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import org.bridje.ioc.Component;
import org.bridje.vfs.*;
@Component
class VfsServiceImpl implements VfsService
{
private static final Logger LOG = Logger.getLogger(VfsServiceImpl.class.getName());
private final VfsFolderNode root;
private final Properties mimeTypes;
public VfsServiceImpl()
{
this.root = new VfsFolderNode(null);
this.mimeTypes = new Properties();
}
@PostConstruct
public synchronized void init() throws IOException, URISyntaxException
{
VFile vfsBridje = new VFile("/vfs/bridje");
vfsBridje.mount(new CpSource("/BRIDJE-INF/vfs"));
VFile mimeTypes = new VFile(vfsBridje.getPath().join("mime-types.properties"));
try(VFileInputStream is = new VFileInputStream(mimeTypes))
{
this.mimeTypes.load(is);
}
VFile[] sources = vfsBridje.search(new GlobExpr("*-classpath-sources.properties"));
for (VFile source : sources)
{
try(VFileInputStream is = new VFileInputStream(source))
{
Properties prop = new Properties();
prop.load(is);
Set> entrySet = prop.entrySet();
for (Map.Entry
© 2015 - 2025 Weber Informatics LLC | Privacy Policy