Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.LockFile.unlock()


        lf.write(out);
        if (!lf.commit()) {
          throw new IOException("Cannot commit write to " + path);
        }
      } finally {
        lf.unlock();
      }
    }
  }

  private static boolean modified(FileBasedConfig cfg) throws IOException {
View Full Code Here


      }
      if (!lf.commit()) {
        throw new IOException("Cannot commit " + dst);
      }
    } finally {
      lf.unlock();
    }
  }

  static URI toURI(String url) throws URISyntaxException {
    final URI u = new URI(url);
View Full Code Here

            }
            if (!lf.commit()) {
              throw new IOException("Cannot commit " + siteWar);
            }
          } finally {
            lf.unlock();
          }
        } finally {
          in.close();
        }
      }
View Full Code Here

    final LockFile tmp = myLock;
    requireLocked(tmp);
    try {
      writeTo(new BufferedOutputStream(tmp.getOutputStream()));
    } catch (IOException err) {
      tmp.unlock();
      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
View Full Code Here

      writeTo(new BufferedOutputStream(tmp.getOutputStream()));
    } catch (IOException err) {
      tmp.unlock();
      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
      tmp.unlock();
      throw err;
    }
View Full Code Here

      throw err;
    } catch (RuntimeException err) {
      tmp.unlock();
      throw err;
    } catch (Error err) {
      tmp.unlock();
      throw err;
    }
  }

  private void writeTo(final OutputStream os) throws IOException {
View Full Code Here

   */
  public void unlock() {
    final LockFile tmp = myLock;
    if (tmp != null) {
      myLock = null;
      tmp.unlock();
    }
  }

  /**
   * Locate the position a path's entry is at in the index.
View Full Code Here

          .getReverseEntries().toString());
      if (oldHeadId != null)
        assertEquals(oldHeadLog.toString(), db.getReflogReader(
            Constants.HEAD).getReverseEntries().toString());
    } finally {
      lockFile.unlock();
    }
  }

  private void assertExists(boolean positive, String toName) {
    assertEquals(toName + (positive ? " " : " does not ") + "exist",
View Full Code Here

          w.close();
        }
        lock.commit();
      }
    } finally {
      lock.unlock();
    }
  }

  private boolean askForIsComplete() throws TransportException {
    try {
View Full Code Here

      lf.write(Constants.encode(cfg.toText()));
      if (!lf.commit())
        throw new IOException(MessageFormat.format(IpLogText.get().cannotWrite, file));
    } finally {
      lf.unlock();
    }
  }

  private static void set(Config cfg, String section, String subsection,
      String key, String value) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.