Logo Search packages:      
Sourcecode: ooeclipseintegration version File versions  Download package

void org::openoffice::ide::eclipse::core::internal::model::AbstractOOo::setHome ( String  home  )  throws InvalidConfigException [inline, inherited]

Set the home directory.

Parameters:
home the absolute path to the home directory
Exceptions:
InvalidConfigException is thrown if the path doesn't match the implementation requirement for an OOo instance. The error code will be InvalidConfigException#INVALID_OOO_HOME

Implements org::openoffice::ide::eclipse::core::preferences::IOOo.

Definition at line 90 of file AbstractOOo.java.

References org::openoffice::ide::eclipse::core::preferences::IOOo::getClassesPath(), org::openoffice::ide::eclipse::core::preferences::IOOo::getServicesPath(), org::openoffice::ide::eclipse::core::preferences::IOOo::getTypesPath(), and org::openoffice::ide::eclipse::core::preferences::IOOo::getUnorcPath().

Referenced by org::openoffice::ide::eclipse::core::internal::model::AbstractOOo::AbstractOOo(), and org::openoffice::ide::eclipse::core::gui::OOoTable::openDialog().

                                                                      {

            Path homePath = new Path(aHome);
            File homeFile = homePath.toFile();
            
            /* Checks if the directory exists */
            if (!homeFile.isDirectory() || !homeFile.canRead()) {
                  mHome = null;
                  throw new InvalidConfigException(
                        Messages.getString("AbstractOOo.NoDirectoryError") +  //$NON-NLS-1$
                                    homeFile.getAbsolutePath(), 
                        InvalidConfigException.INVALID_OOO_HOME);
            }
            
            mHome = aHome;
                  
            /* Checks if URE_HOME/share/java is a directory */
            Path javaPath = new Path(getClassesPath());
            File javaDir = javaPath.toFile();
            
            if (!javaDir.isDirectory() || !javaDir.canRead()) {
                  mHome = null;
                  throw new InvalidConfigException(
                        Messages.getString("AbstractOOo.NoDirectoryError") +  //$NON-NLS-1$
                                    javaDir.getAbsolutePath(), 
                        InvalidConfigException.INVALID_OOO_HOME);
            }
            
            /* Checks if URE_HOME/share/misc/types.rdb is a readable file */
            Path typesPath = new Path(getTypesPath());
            File typesFile = typesPath.toFile();
            
            if (!typesFile.isFile() || !typesFile.canRead()) {
                  mHome = null;
                  throw new InvalidConfigException(
                        Messages.getString("AbstractOOo.NoFileError") +  //$NON-NLS-1$
                                    typesFile.getAbsolutePath(), 
                        InvalidConfigException.INVALID_OOO_HOME);
            }
            
            /* Checks if URE_HOME/share/misc/services.rdb is a readable file */
            Path servicesPath = new Path(getServicesPath());
            File servicesFile = servicesPath.toFile();
            
            if (!servicesFile.isFile() || !servicesFile.canRead()) {
                  mHome = null;
                  throw new InvalidConfigException(
                        Messages.getString("AbstractOOo.NoFileError") +  //$NON-NLS-1$
                                    typesFile.getAbsolutePath(), 
                        InvalidConfigException.INVALID_OOO_HOME);
            }
            
            /* Checks if URE_HOME/lib/unorc is a readable file */
            Path unorcPath = new Path(getUnorcPath());
            File unorcFile = unorcPath.toFile();
            
            if (!unorcFile.isFile() || !unorcFile.canRead()) {
                  mHome = null;
                  throw new InvalidConfigException(
                        Messages.getString("AbstractOOo.NoFileError") +  //$NON-NLS-1$
                                    unorcFile.getAbsolutePath(), 
                        InvalidConfigException.INVALID_OOO_HOME);
            }
      }


Generated by  Doxygen 1.6.0   Back to index