Examples of PEFileLayout


Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

        prepare();
        display();
    }
   
    private void prepare() throws ConfigException {
        final PEFileLayout layout = new PEFileLayout(dc);
        final String xmlPath      = layout.getDomainConfigFile().getAbsolutePath();
        this.sn                   = SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME;
       
        final String ver = Version.getFullVersion();
        records.add(getDomainBanner(dc.getDomainName(), ver, dc.getDomainRoot()));
        if (detailed) {
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

   
    public InplaceDomainUpgradeHandler(final DomainConfig dc) {
        if (dc == null)
            throw new IllegalArgumentException ("null arguments");
        this.dc                     = dc;
        this.domainXmlFile          = new PEFileLayout(dc).getDomainConfigFile();
        if (! domainXmlFile.exists() || ! domainXmlFile.canRead()) {
            final String msg = lsm.getString("InplaceUpgradeDomainNotReadable", dc.getDomainName(), dc.getDomainRoot());
            throw new IllegalArgumentException(msg);
        }
        this.domainConfigFolder     = domainXmlFile.getParentFile();
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

                    public InputSource resolveEntity(final String pid, final String sid)
                    throws SAXException, IOException {
                        if (sid != null) {
                            mSystemId = sid.trim();
                            final String dtdName = sid.substring(sid.lastIndexOf("/"));
                            final File dtdFile   = new File(new PEFileLayout(dc).getDtdsDir(), dtdName);
                            if (dtdFile.exists()) {
                                return new InputSource(new BufferedInputStream(new FileInputStream(dtdFile)));
                            } //else default resolution
                        } //else default resolution
                        return ( null );
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

        }
    }
   
    private Config getTemplateConfig(final String profile) throws IllegalArgumentException, ConfigException {
        final RepositoryConfig myRepos = new RepositoryConfig(); //all system properties are taken care of.
        final PEFileLayout layout = new PEFileLayout(myRepos);
        final File profileDomainXmlTemplate = layout.getPreExistingDomainXmlTemplateForProfile(profile);
        if (! profileDomainXmlTemplate.exists()) {
            final String msg = localStrings.getString("template.domain.xml.not.found",
                    profileDomainXmlTemplate.getAbsolutePath(), profile);
            throw new IllegalArgumentException(msg);
        }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

        return MASTER_PASSWORD_ALIAS.toCharArray();
    }
   
    protected void deleteMasterPasswordFile(RepositoryConfig config)
    {
        final PEFileLayout layout = getFileLayout(config);
        final File pwdFile = layout.getMasterPasswordFile();   
        pwdFile.delete();
    }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

     */   
    protected void createMasterPasswordFile(
        RepositoryConfig config, String masterPassword)
        throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File pwdFile = layout.getMasterPasswordFile();                    
        try {                   
            PasswordAdapter p = new PasswordAdapter(pwdFile.getAbsolutePath(),
                getMasterPasswordPassword(config));
            p.setPasswordForAlias(MASTER_PASSWORD_ALIAS, masterPassword.getBytes());
            chmod("600", pwdFile);
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

     * @return
     */   
    public String readMasterPasswordFile(
        RepositoryConfig config) throws RepositoryException
    {              
        final PEFileLayout layout = getFileLayout(config);
        final File pwdFile = layout.getMasterPasswordFile();       
        if (pwdFile.exists()) {           
            try {                   
                PasswordAdapter p = new PasswordAdapter(pwdFile.getAbsolutePath(),
                    getMasterPasswordPassword(config));
                return p.getPasswordForAlias(MASTER_PASSWORD_ALIAS);
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

     * Sets the permissions for the domain directory, its config directory,
     * startserv/stopserv scripts etc.
     */
    protected void setPermissions(RepositoryConfig repositoryConfig) throws RepositoryException
    {               
        final PEFileLayout layout = getFileLayout(repositoryConfig);
        final File domainDir = layout.getRepositoryDir();
        try {               
            chmod("-R 755", domainDir);                                       
        } catch (Exception e) {
            throw new RepositoryException(
                _strMgr.getString("setPermissionError"), e);
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

     * operations will be authenticated against this file realm by default.
     * @see PEFileLayout#ADMIN_KEY_FILE
     */
    protected void createAdminKeyFile(final RepositoryConfig config, final String
        user, final String clearPwd) throws RepositoryException {
        final PEFileLayout layout = getFileLayout(config);
        final File src = layout.getKeyFileTemplate();
        final File dest = layout.getAdminKeyFile();     
        try {
            FileUtils.copy(src, dest);
            modifyKeyFile(dest, user, clearPwd);
        } catch (final Exception e) {
            throw new RepositoryException(_strMgr.getString("keyFileNotCreated"), e);
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

     * Create the FileRealm kefile from the given user and password.
     */
    protected void createKeyFile(RepositoryConfig config, String user,
        String password) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File src = layout.getKeyFileTemplate();
        final File dest = layout.getKeyFile();
        try {
            FileUtils.copy(src, dest);
            /* This keyfile is simply a copy of the template as by default
               at the domain creation time, we do not add administrative user
               to it. J2EE application users will be added to this file later.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.