Codota Logo
RepositoryFile
Code IndexAdd Codota to your IDE (free)

How to use
RepositoryFile
in
org.datacleaner.repository

Best Java code snippets using org.datacleaner.repository.RepositoryFile (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: datacleaner/DataCleaner

@SuppressWarnings("deprecation")
@Override
public OutputStream write() throws ResourceException {
  return getRepositoryFile().writeFile(false);
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  private void renameSchedule(final RepositoryFile oldScheduleFile, final String nameInput, final RepositoryFolder jobFolder) {
    final String newScheduleFilename = nameInput + SchedulingServiceImpl.EXTENSION_SCHEDULE_XML;

    final Action<OutputStream> writeScheduleAction = new Action<OutputStream>() {
      @Override
      public void run(final OutputStream out) throws Exception {
        oldScheduleFile.readFile(new Action<InputStream>() {
          @Override
          public void run(final InputStream in) throws Exception {
            FileHelper.copy(in, out);
          }
        });
      }
    };
    final RepositoryFile newScheduleFile = jobFolder.getFile(newScheduleFilename);
    if (newScheduleFile == null) {
      jobFolder.createFile(newScheduleFilename, writeScheduleAction);
    } else {
      newScheduleFile.writeFile(writeScheduleAction);
    }

    oldScheduleFile.delete();
  }
}
origin: datacleaner/DataCleaner

@Override
public long getLastModified() {
  return getRepositoryFile().getLastModified();
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  @Override
  public ExecutionIdentifier eval(final RepositoryFile file) {
    try {
      final ExecutionIdentifier result = file.readFile(
          new Func<InputStream, ExecutionIdentifier>() {
            @Override
            public ExecutionIdentifier eval(InputStream in) {
              return SaxExecutionIdentifierReader.read(in, file.getQualifiedPath());
            }
          });
      return result;
    } catch (Exception e) {
      logger.warn("The file " + file.getQualifiedPath()
          + " could not be read or parsed correctly " + e);
      return new ExecutionIdentifier("Execution failed for " + FilenameUtils.getBaseName(file
          .getQualifiedPath()));
    }
  }
});
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

private void addTimelines(List<TimelineIdentifier> result, DashboardGroup group, RepositoryFolder repositoryFolder) {
  final String extension = FileFilters.ANALYSIS_TIMELINE_XML.getExtension();
  final List<RepositoryFile> files = repositoryFolder.getFiles(null, extension);
  for (RepositoryFile file : files) {
    final String timelineName = file.getName().substring(0, file.getName().length() - extension.length());
    final TimelineIdentifier timelineIdentifier = new TimelineIdentifier(timelineName, file.getQualifiedPath(),
        group);
    result.add(timelineIdentifier);
  }
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  configurationFile.writeFile(writeAction);
} finally {
  FileHelper.safeClose(inputStream);
result.put("file_type", configurationFile.getType().toString());
result.put("filename", configurationFile.getName());
result.put("repository_path", configurationFile.getQualifiedPath());
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

final String extension = existingFile.getName().substring(jobName.length());
    newFile.writeFile(writeAction);
  } else {
    httpServletResponse.setStatus(HttpServletResponse.SC_CONFLICT);
existingFile.delete();
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

final Configuration configuration = confFile.readFile(new Func<InputStream, Configuration>() {
  @Override
  public Configuration eval(InputStream in) {
confFile.writeFile(new Action<OutputStream>() {
  @Override
  public void run(OutputStream out) throws Exception {
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  @Override
  public void run(final OutputStream out) throws Exception {
    existingFile.readFile(new Action<InputStream>() {
      @Override
      public void run(final InputStream in) throws Exception {
        FileHelper.copy(in, out);
      }
    });
  }
});
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

final ExecutionLog executionLog = oldFile.readFile(new Func<InputStream, ExecutionLog>() {
  @Override
  public ExecutionLog eval(InputStream in) {
  resultFolder.createFile(newFilename, writeAction);
} else {
  newFile.writeFile(writeAction);
oldFile.delete();
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

@Override
public List<TimelineIdentifier> getTimelines(final TenantIdentifier tenant, final DashboardGroup group) {
  final RepositoryFolder timelinesFolder = _tenantContextFactory.getContext(tenant).getTimelineFolder();
  final List<RepositoryFile> files;
  final String groupName = (group == null ? null : group.getName());
  if (group == null || groupName == null || "".equals(groupName)) {
    files = timelinesFolder.getFiles();
  } else {
    RepositoryFolder groupFolder = timelinesFolder.getFolder(groupName);
    files = groupFolder.getFiles();
  }
  final List<TimelineIdentifier> result = new ArrayList<TimelineIdentifier>();
  for (RepositoryFile file : files) {
    if (file.getType() == Type.TIMELINE_SPEC) {
      String timelineName = file.getName().substring(0,
          file.getName().length() - FileFilters.ANALYSIS_TIMELINE_XML.getExtension().length());
      TimelineIdentifier timeline = new TimelineIdentifier(timelineName, file.getQualifiedPath(), group);
      result.add(timeline);
    }
  }
  return result;
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

@Override
public TimelineIdentifier updateTimeline(TimelineIdentifier identifier, TimelineDefinition definition) {
  final RepositoryFile file = (RepositoryFile) _repository.getRepositoryNode(identifier.getPath());
  file.writeFile(new WriteTimelineAction(definition));
  logger.info("Updated timeline definition in file: {}", file);
  return new TimelineIdentifier(identifier.getName(), file.getQualifiedPath(), identifier.getGroup());
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

@Override
public String getName() {
  final int extensionLength = CustomJobEngine.EXTENSION.length();
  final String filename = _file.getName();
  return filename.substring(0, filename.length() - extensionLength);
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

/**
 * Checks if the current copy of the metadata object is recent.
 * 
 * @param metadataObject
 *            the object to look for.
 */
private void verifyJobMetadataCurrent(final Object metadataObject) {
  long lastModified = _file.getLastModified();
  if (metadataObject == null || lastModified != _lastModifiedCache) {
    synchronized (this) {
      lastModified = _file.getLastModified();
      if (_sourceDatastoreName == null || lastModified != _lastModifiedCache) {
        final DataCleanerConfiguration configuration = _tenantContext.getConfiguration();
        final AnalysisJobMetadata metadata = _file.readFile(new Func<InputStream, AnalysisJobMetadata>() {
          @Override
          public AnalysisJobMetadata eval(InputStream in) {
            final JaxbJobReader jobReader = new JaxbJobReader(configuration);
            AnalysisJobMetadata metadata = jobReader.readMetadata(in);
            return metadata;
          }
        });
        _sourceDatastoreName = metadata.getDatastoreName();
        _sourceColumnPaths = metadata.getSourceColumnPaths();
        _variables = metadata.getVariables();
      }
    }
  }
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

logger.info("File: " + path + file.getName());
zipOutput.putNextEntry(new ZipEntry(path + file.getName()));
file.readFile(new Action<InputStream>() {
  @Override
  public void run(InputStream fileInput) throws Exception {
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

/**
 * Delete file from repository
 *
 * @param instanceId
 * @return
 */
public boolean remove(String instanceId) {
  writeLock.lock();
  try {
    RepositoryFile configFile = componentsFolder.getFile(instanceId);
    if (configFile == null) {
      logger.info("Component with id: {} is not in store.", instanceId);
      return false;
    }
    configFile.delete();
    logger.info("Component {} was removed.", instanceId);
  } finally {
    writeLock.unlock();
  }
  return true;
}
origin: datacleaner/DataCleaner

/**
 * Constructs a {@link RepositoryFileResource} based on a
 * {@link RepositoryFile}.
 *
 * @param file
 */
public RepositoryFileResource(final RepositoryFile file) {
  _fileRef = new SerializableRef<>(file);
  _qualifiedPath = file.getQualifiedPath();
}
origin: datacleaner/DataCleaner

@Override
public long getSize() {
  return getRepositoryFile().getSize();
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

} else {
  jobFile = existingJob.getJobFile();
  logger.info("Overwriting job from uploaded file: {}", jobFile.getName());
  jobFile.writeFile(writeCallback);
result.put("file_type", jobFile.getType().toString());
result.put("filename", jobFile.getName());
result.put("repository_path", jobFile.getQualifiedPath());
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

final String oldFilename = existingFile.getName();
final int lastIndexOfDash = oldFilename.lastIndexOf('-');
assert lastIndexOfDash != -1;
  newFile = resultFolder.createFile(newFilename, writeAction);
} else {
  newFile.writeFile(writeAction);
existingFile.delete();
org.datacleaner.repositoryRepositoryFile

Javadoc

Represents a file in the Repository.

Most used methods

  • writeFile
    Opens up an OutputStream to write to the file.
  • delete
  • getLastModified
  • getName
  • getQualifiedPath
  • getSize
  • readFile
  • getType
  • toResource

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • putExtra (Intent)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now