All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.server.ServerInfo Maven / Gradle / Ivy

The newest version!
package com.enonic.xp.server;

import java.io.File;
import java.util.Properties;

import com.enonic.xp.annotation.PublicApi;

@PublicApi
public final class ServerInfo
{
    private final Properties props;

    public ServerInfo( final Properties props )
    {
        this.props = props;
    }

    public String getName()
    {
        return this.props.getProperty( "xp.name" );
    }

    public File getHomeDir()
    {
        return new File( this.props.getProperty( "xp.home" ) );
    }

    public File getInstallDir()
    {
        return new File( this.props.getProperty( "xp.install" ) );
    }

    public BuildInfo getBuildInfo()
    {
        return new BuildInfo( this.props );
    }

    public static ServerInfo get()
    {
        return new ServerInfo( System.getProperties() );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy