Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.FileUtils


      }
      public void remove() {
        throw new UnsupportedOperationException();
      }
    };
    FileUtils fu = new FileUtils(new StreamLogFacility(Debug, true, System.err), RepoUtils.class);
    String srcPrefix = srcDir.getAbsolutePath();
    while (it.hasNext()) {
      File next = it.next();
      assert next.getAbsolutePath().startsWith(srcPrefix);
      String relPath = next.getAbsolutePath().substring(srcPrefix.length());
      File dest = new File(testRepoLoc, relPath);
      if (next.isDirectory()) {
        dest.mkdir();
      } else {
        fu.copy(next, dest);
        dest.setLastModified(next.lastModified());
      }
    }
    return testRepoLoc;
  }
View Full Code Here


    } catch (HgRuntimeException ex) {
      // if happens, log error and pretend there's no cache
      repo.getSessionContext().getLog().dump(getClass(), Error, ex, null);
      // FALL THROUGH
    } finally {
      new FileUtils(repo.getSessionContext().getLog(), this).closeQuietly(br);
    }
    return -1; // deliberately not lastInCache, to avoid anything but -1 when 1st line was read and there's error is in lines 2..end
  }
View Full Code Here

      fr.read(cb);
      return cb.flip().toString();
    } catch (IOException ex) {
      throw new HgInvalidControlFileException("Can't retrieve message of last commit attempt", ex, lastMessage);
    } finally {
      new FileUtils(getSessionContext().getLog(), this).closeQuietly(fr, lastMessage);
    }
  }
View Full Code Here

      repo.getSessionContext().getLog().dump(getClass(), Warn, ex, "Unexpected cancellation");
      return check.ultimatelyTheSame();
    } catch (IOException ex) {
      throw new HgInvalidFileException("File comparison failed", ex).setFileName(p);
    } finally {
      new FileUtils(repo.getSessionContext().getLog(), this).closeQuietly(is);
    }
  }
View Full Code Here

    } catch (IOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand("unbundle").setServerInfo(getLocation());
    } catch (HgIOException ex) {
      throw new HgRemoteConnectionException("Communication failure", ex).setRemoteCommand("unbundle").setServerInfo(getLocation());
    } finally {
      new FileUtils(sessionContext.getLog(), this).closeQuietly(os);
      remote.sessionEnd();
    }
  }
View Full Code Here

    }
  }
 
  private File writeBundle(InputStream is) throws IOException {
    File tf = File.createTempFile("hg4j-bundle-", null);
    new FileUtils(sessionContext.getLog(), this).write(is, tf);
    is.close();
    return tf;
  }
View Full Code Here

      } catch (IOException ex) {
        throw new HgInvalidFileException("Working copy read failed", ex, f);
      } finally {
        progress.done();
        if (fis != null) {
          new FileUtils(getRepo().getSessionContext().getLog(), this).closeQuietly(fis);
        }
      }
    } else {
      Nodeid fileRev = getWorkingCopyRevision();
      if (fileRev == null) {
View Full Code Here

      }
      assert resolveUse == null;
      assert resolveForget == null;
      try {
        resolveContent = FileUtils.createTempFile();
        new FileUtils(repo.getLog(), this).write(content, resolveContent);
      } finally {
        content.close();
      }
      // do not care deleting file in case of failure to allow analyze of the issue
    }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.internal.FileUtils

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.