Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.ModelException


    public InputStream getContents() throws CoreException {
      try {
        return this.archiveFile.getInputStream(entry);
      } catch (IOException e) {
        throw new ModelException(e, IModelStatusConstants.IO_EXCEPTION);
      }
    }
View Full Code Here


    } catch (OperationCanceledException ex) {
      Assert.isTrue(fProgressMonitor == null
          || fProgressMonitor.isCanceled());

    } catch (Exception e) {
      throw new ModelException(e, IStatus.ERROR);

    } finally {
      /* fix for missing cancel flag communication */
      if (extension != null) {
        extension.setProgressMonitor(null);
View Full Code Here

      throws ModelException {
    try {
      if (fTextFileBuffer != null)
        fTextFileBuffer.commit(progress, force);
    } catch (CoreException e) {
      throw new ModelException(e);
    }
  }
View Full Code Here

      throws ModelException {
    InputStream stream = null;
    try {
      stream = file.getContents(true);
    } catch (CoreException e) {
      throw new ModelException(e);
    }
    try {
      return org.eclipse.dltk.compiler.util.Util
          .getInputStreamAsByteArray(stream, -1);
    } catch (IOException e) {
      throw new ModelException(e, IModelStatusConstants.IO_EXCEPTION);
    } finally {
      try {
        stream.close();
      } catch (IOException e) {
        // ignore
View Full Code Here

      // non local file
      try {
        length = EFS.getStore(file.getLocationURI()).fetchInfo()
            .getLength();
      } catch (CoreException e) {
        throw new ModelException(e);
      }
    } else {
      // local file
      length = location.toFile().length();
    }

    // Get resource contents
    InputStream stream = null;
    try {
      stream = file.getContents(true);
    } catch (CoreException e) {
      throw new ModelException(e,
          IModelStatusConstants.ELEMENT_DOES_NOT_EXIST);
    }
    try {
      return org.eclipse.dltk.compiler.util.Util
          .getInputStreamAsCharArray(stream, (int) length, encoding);
    } catch (IOException e) {
      throw new ModelException(e, IModelStatusConstants.IO_EXCEPTION);
    } finally {
      try {
        stream.close();
      } catch (IOException e) {
        // ignore
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.ModelException

Copyright © 2018 www.massapicom. 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.