Package net.sourceforge.javautil.common.io

Examples of net.sourceforge.javautil.common.io.VirtualArtifactException


  public URL getURL() {
    try {
      return file.toURI().toURL();
    } catch (MalformedURLException e) {
      throw ThrowableManagerRegistry.caught(new VirtualArtifactException(this, e));
    }
  }
View Full Code Here


  public Directory createDirectory(String name) {
    Directory dir = null;
    IVirtualArtifact artifact = this.artifacts.get(name);
    if (artifact instanceof IVirtualFile) {
      throw new VirtualArtifactException(this, "A file already exists by this name: " + name);
    } else if (artifact != null) {
      dir = (Directory) artifact;
    } else {
      SystemDirectory system = this.getFirst(this);
     
View Full Code Here

  public void rename(String newName) {
    File newDirectory = new File(this.directory.getParentFile(), newName);
    if (this.directory.renameTo(newDirectory)) {
      this.directory = newDirectory;
    } else {
      throw new VirtualArtifactException(this, "Could not rename to: " + newName);
    }
  }
View Full Code Here

  public URL getURL() {
    try {
      return directory.toURI().toURL();
    } catch (MalformedURLException e) {
      throw ThrowableManagerRegistry.caught(new VirtualArtifactException(this, e));
    }
  }
View Full Code Here

  public boolean isFile() { return false; }

  public SystemDirectory createDirectory(String name) {
    File newdir = new File(directory, name);
    if (!newdir.exists() && !newdir.mkdirs()) throw new VirtualArtifactException(this, "Could not create directory " + name + " in " + this);
   
    return new SystemDirectory( newdir );
  }
View Full Code Here

    return new SystemDirectory( newdir );
  }

  public SystemFile createFile(String name) {
    File newFile = new File(directory, name);
    if (newFile.exists()) throw new VirtualArtifactException(this, "A file by this name already exists: " + name);
    return new SystemFile( newFile );
  }
View Full Code Here

    if (atts.isDir()) return this.getDirectoryFor(atts, name);
    return this.getFileFor(atts, name);
  }
 
  protected VirtualFile getFileFor (SftpATTRS atts, String name) {
    if (atts != null && atts.isDir()) throw new VirtualArtifactException(this, "A directory already exists by this name: " + name);
    return new SecureFTPFile((SecureFTP)location, this, path.append(name), atts);
  }
View Full Code Here

    if (atts != null && atts.isDir()) throw new VirtualArtifactException(this, "A directory already exists by this name: " + name);
    return new SecureFTPFile((SecureFTP)location, this, path.append(name), atts);
  }
 
  protected VirtualDirectory getDirectoryFor (SftpATTRS atts, String name) {
    if (atts != null && !atts.isDir()) throw new VirtualArtifactException(this, "A file already exists by this name: " + name);
    return new SecureFTPDirectory((SecureFTP)location, this, path.append(name), atts);
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.common.io.VirtualArtifactException

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.