public JGitFileSystemProvider() {
fullHostName = DAEMON_ENABLED ? DAEMON_HOST + ":" + DAEMON_PORT : null;
final String[] repos = FILE_REPOSITORIES_ROOT.list( new FilenameFilter() {
@Override
public boolean accept( final File dir,
String name ) {
return name.endsWith( DOT_GIT_EXT );
}
} );
if ( repos != null ) {
for ( final String repo : repos ) {
final File repoDir = new File( FILE_REPOSITORIES_ROOT, repo );
if ( repoDir.isDirectory() ) {
final String name = repoDir.getName().substring( 0, repoDir.getName().indexOf( DOT_GIT_EXT ) );
final JGitFileSystem fs = new JGitFileSystem( this, fullHostName, newRepository( repoDir, true ), name, ALL, buildCredential( null ) );
fileSystems.put( name, fs );
repoIndex.put( fs.gitRepo().getRepository(), fs );
}
}
}
if ( DAEMON_ENABLED ) {
buildAndStartDaemon();
} else {
daemonService = null;
}
}