Package com.caucho.vfs

Examples of com.caucho.vfs.Path


  }

  @Override
  public Path getArchivePath()
  {
    Path path = super.getArchivePath();

    if (path != null)
      return path;

    if (_config != null) {
View Full Code Here


   * Called after the application is extracted from the repository.
   */
  protected void postExtract(boolean isExtract)
    throws IOException
  {
    Path path = getRootDirectory().lookup("META-INF/MANIFEST.MF");
    if (path.canRead()) {
      ReadStream is = path.openRead();
     
      try {
        _manifest = new Manifest(is);
      } catch (IOException e) {
        log.warning(L.l("{0} Manifest file cannot be read for '{1}'.\n  {2}",
View Full Code Here

    if (main == null)
      return;

    String classPath = main.getValue("Class-Path");

    Path pwd = null;

    if (getArchivePath() != null)
      pwd = getArchivePath().getParent();
    else
      pwd = getRootDirectory();
View Full Code Here

   * if the war is in the process of updating.
   */
  private boolean commitArchive()
  throws IOException
{
    Path archivePath = getArchivePath();

    if (archivePath == null)
      return true;

    if (! archivePath.canRead())
      return true;
   
    String hash = Long.toHexString(archivePath.getCrc64());

    CommitBuilder commit = new CommitBuilder();
    commit.stage(getAutoDeployStage());
    commit.type(getIdType());
    commit.tagKey(getIdKey());

    String commitId = commit.getId();

    RepositoryTagEntry tagEntry = _repositorySpi.getTagMap().get(commitId);

    if (tagEntry != null
        && hash.equals(tagEntry.getAttributeMap().get("archive-digest"))) {
      return true;
    }

    commit.attribute("archive-digest", hash);
    commit.message(".war added to repository from "
                   + archivePath.getNativePath());

    if (log.isLoggable(Level.FINE))
      log.fine(this + " adding archive to repository from " + archivePath);

    _repository.commitArchive(commit, archivePath);
View Full Code Here

        return false;
     
      String tag = getId();
      String treeHash = _repositorySpi.getTagContentHash(tag);
     
      Path archivePath = getArchivePath();

      if (treeHash != null && archivePath != null && archivePath.canRead()) {
        throw new ConfigException(L.l("{0} cannot be deployed from both an archive {1} and cluster deployment.",
                                      this, archivePath.getNativePath()));
      }

      if (treeHash == null) {
        tag = getAutoDeployTag();

        treeHash = _repositorySpi.getTagContentHash(tag);
      }
     
      if (treeHash == null)
        return false;
     
      if (treeHash.equals(_rootHash))
        return false;
     
      Path pwd = getRootDirectory();

      pwd.mkdirs();

      removeExpandDirectory(pwd);

      if (log.isLoggable(Level.FINE)) {
        log.fine(this + " extract from repository tag=" + tag
View Full Code Here

   * Reads the saved application root hash which is stored in META-INF, so
   * the application is not extracted twice.
   */
  private String readRootHash()
  {
    Path path = _rootDirectory.lookup(APPLICATION_HASH_PATH);
   
    ReadStream is = null;
    try {
      is = path.openRead();
     
      String rootHash = is.readLine();
     
      return rootHash;
    } catch (FileNotFoundException e) {
View Full Code Here

   * the application is not extracted twice.
   */
  private void writeRootHash(String hash)
    throws IOException
  {
    Path path = _rootDirectory.lookup(APPLICATION_HASH_PATH);
   
    WriteStream os = null;
   
    try {
      path.getParent().mkdirs();
     
      os = path.openWrite();
     
      os.println(hash);
    } finally {
      IoUtil.close(os);
    }
View Full Code Here

    DependencyContainer dependencyList = new DependencyContainer();

    WebApp webApp = (WebApp) _webApp;

    String uriRealPath = webApp.getRealPath(contextURI);
    Path contextPath = webApp.getRootDirectory().lookup(uriRealPath);

    if (! contextPath.isDirectory())
      return;

    ArrayList<String> welcomeFileList = webApp.getWelcomeFileList();
    for (int i = 0; i < welcomeFileList.size(); i++) {
      String file = welcomeFileList.get(i);

      String realPath = webApp.getRealPath(contextURI + "/" + file);

      Path path = webApp.getRootDirectory().lookup(realPath);

      dependencyList.add(new Depend(path));
    }

    dependencyList.clearModified();
View Full Code Here

    if (manager == null)
      return env.error("bam_register_service must be called from " +
                       "service manager script");

    Path path = env.getSelfDirectory().lookup(script);

    if (! path.exists())
      return env.error("script not found: " + script);

    BamPhpActor child = new BamPhpActor();
    child.setAddress(address);
    child.setScript(path);
View Full Code Here

      return env.error("bam_register_actor must be called from actor script");

    BamPhpActor child = new BamPhpActor();
    child.setAddress(address);

    Path path = env.getSelfDirectory().lookup(script);

    if (! path.exists())
      return env.error("script not found: " + script);

    child.setScript(path);

    //InjectManager container = InjectManager.getCurrent();
View Full Code Here

TOP

Related Classes of com.caucho.vfs.Path

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.