Search in sources :

Example 6 with FileObject

use of org.netbeans.lib.cvsclient.file.FileObject in project intellij-community by JetBrains.

the class FileStateRequestsProgressHandler method requestSent.

public void requestSent(IRequest request) {
    if (!(request instanceof AbstractFileStateRequest)) {
        return;
    }
    final AbstractFileStateRequest fileStateRequest = (AbstractFileStateRequest) request;
    final FileObject fileObject = fileStateRequest.getFileObject();
    if (!fileObjects.remove(fileObject)) {
        return;
    }
    count++;
    notifyProgress(count, maxCount, progressViewer);
}
Also used : AbstractFileStateRequest(org.netbeans.lib.cvsclient.request.AbstractFileStateRequest) FileObject(org.netbeans.lib.cvsclient.file.FileObject)

Example 7 with FileObject

use of org.netbeans.lib.cvsclient.file.FileObject in project intellij-community by JetBrains.

the class FileSystemScanner method scanDirectory.

private List<DirectoryObject> scanDirectory(DirectoryObject directoryObject, CvsFiles cvsFiles) throws IOException {
    if (!clientEnvironment.getLocalFileReader().exists(directoryObject, clientEnvironment.getCvsFileSystem())) {
        return Collections.emptyList();
    }
    cvsFiles.add(CvsFile.createCvsDirectory(directoryObject));
    final Set<String> subDirectoryNames = new HashSet<>();
    final LocalFiles localFiles = new LocalFiles(directoryObject, clientEnvironment);
    // get all the entries we know about, and process them
    final Collection<Entry> entries = clientEnvironment.getAdminReader().getEntries(directoryObject, clientEnvironment.getCvsFileSystem());
    for (final Entry entry : entries) {
        if (entry.isDirectory()) {
            subDirectoryNames.add(entry.getFileName());
        } else {
            final FileObject fileObject = FileObject.createInstance(directoryObject, entry.getFileName());
            final boolean fileExists = clientEnvironment.getLocalFileReader().exists(fileObject, clientEnvironment.getCvsFileSystem());
            cvsFiles.add(CvsFile.createCvsFileForEntry(fileObject, entry, fileExists));
            localFiles.removeFile(entry.getFileName());
        }
    }
    for (final String fileName : localFiles.getFileNames()) {
        cvsFiles.add(CvsFile.createCvsFileForExistingFile(FileObject.createInstance(directoryObject, fileName)));
    }
    final List<DirectoryObject> subDirectories = new ArrayList<>(subDirectoryNames.size());
    for (final String directoryName : subDirectoryNames) {
        subDirectories.add(DirectoryObject.createInstance(directoryObject, directoryName));
    }
    return subDirectories;
}
Also used : Entry(org.netbeans.lib.cvsclient.admin.Entry) AbstractFileObject(org.netbeans.lib.cvsclient.file.AbstractFileObject) FileObject(org.netbeans.lib.cvsclient.file.FileObject) DirectoryObject(org.netbeans.lib.cvsclient.file.DirectoryObject)

Example 8 with FileObject

use of org.netbeans.lib.cvsclient.file.FileObject in project intellij-community by JetBrains.

the class UpdateMessageParser method processUnknown.

private void processUnknown(String fileName) {
    final FileObject fileObject = cvsFileSystem.unixFileNameToFileObject(fileName);
    ensureExistingFileInfoContainer(fileObject);
    fileInfo.setType("?");
}
Also used : FileObject(org.netbeans.lib.cvsclient.file.FileObject)

Aggregations

FileObject (org.netbeans.lib.cvsclient.file.FileObject)8 AbstractFileObject (org.netbeans.lib.cvsclient.file.AbstractFileObject)3 DirectoryObject (org.netbeans.lib.cvsclient.file.DirectoryObject)3 File (java.io.File)2 Iterator (java.util.Iterator)1 Matcher (java.util.regex.Matcher)1 Entry (org.netbeans.lib.cvsclient.admin.Entry)1 AbstractFileStateRequest (org.netbeans.lib.cvsclient.request.AbstractFileStateRequest)1 DirectoryRequest (org.netbeans.lib.cvsclient.request.DirectoryRequest)1