Examples of OFileClassic


Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

@Test(enabled = false)
public class OClassicFileTest extends OFileAbstractTest {
  @Override
  protected OFile getFileImpl() throws IOException {
    return new OFileClassic(FILE_NAME, "rw");
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

    filesLock.acquireWriteLock();
    try {
      initNameIdMapping();

      Long fileId = nameIdMap.get(fileName);
      OFileClassic fileClassic;
      if (fileId == null)
        fileClassic = null;
      else
        fileClassic = files.get(fileId);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

  public void openFile(String fileName, long fileId) throws IOException {
    filesLock.acquireWriteLock();
    try {
      initNameIdMapping();

      OFileClassic fileClassic;

      Long existingFileId = nameIdMap.get(fileName);

      if (existingFileId != null) {
        if (existingFileId == fileId)
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

  public void openFile(long fileId) throws IOException {
    filesLock.acquireWriteLock();
    try {
      initNameIdMapping();

      final OFileClassic fileClassic = files.get(fileId);
      if (fileClassic == null)
        throw new OStorageException("File with id " + fileId + " does not exist.");

      openFile(fileClassic);
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

  }

  public boolean exists(long fileId) {
    filesLock.acquireReadLock();
    try {
      final OFileClassic file = files.get(fileId);
      if (file == null)
        return false;

      return file.exists();
    } finally {
      filesLock.releaseReadLock();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

  }

  public boolean isOpen(long fileId) {
    filesLock.acquireReadLock();
    try {
      OFileClassic fileClassic = files.get(fileId);
      if (fileClassic != null)
        return fileClassic.isOpen();

      return false;
    } finally {
      filesLock.releaseReadLock();
    }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

      final Long fileId = nameIdMap.get(fileName);
      if (fileId == null)
        return -1;

      final OFileClassic fileClassic = files.get(fileId);
      if (fileClassic == null || !fileClassic.isOpen())
        return -1;

      return fileId;
    } finally {
      filesLock.releaseWriteLock();
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

  }

  public void setSoftlyClosed(long fileId, boolean softlyClosed) throws IOException {
    filesLock.acquireWriteLock();
    try {
      OFileClassic fileClassic = files.get(fileId);
      if (fileClassic != null && fileClassic.isOpen())
        fileClassic.setSoftlyClosed(softlyClosed);
    } finally {
      filesLock.releaseWriteLock();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

  }

  public boolean wasSoftlyClosed(long fileId) throws IOException {
    filesLock.acquireReadLock();
    try {
      OFileClassic fileClassic = files.get(fileId);
      if (fileClassic == null)
        return false;

      return fileClassic.wasSoftlyClosed();
    } finally {
      filesLock.releaseReadLock();
    }
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.storage.fs.OFileClassic

    filesLock.acquireWriteLock();
    try {
      if (!files.containsKey(fileId))
        return;

      final OFileClassic file = files.get(fileId);
      final String osFileName = file.getName();
      if (osFileName.startsWith(oldFileName)) {
        final File newFile = new File(storageLocal.getStoragePath() + File.separator + newFileName
            + osFileName.substring(osFileName.lastIndexOf(oldFileName) + oldFileName.length()));
        boolean renamed = file.renameTo(newFile);
        while (!renamed) {
          renamed = file.renameTo(newFile);
        }
      }

      nameIdMap.remove(oldFileName);
      nameIdMap.put(newFileName, fileId);
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.