Search in sources :

Example 1 with MavenServerDownloadListener

use of org.jetbrains.idea.maven.server.MavenServerDownloadListener in project intellij-community by JetBrains.

the class TransferListenerAdapter method transferCompleted.

public void transferCompleted(TransferEvent event) {
    try {
        MavenServerDownloadListener listener = Maven2ServerGlobals.getDownloadListener();
        if (listener != null)
            listener.artifactDownloaded(event.getLocalFile(), event.getResource().getName());
    } catch (RemoteException e) {
        throw new RuntimeRemoteException(e);
    }
    checkCanceled();
    String resourceName = event.getResource().getName();
    DownloadData data = myDownloads.remove(resourceName);
    data.finished = true;
    updateProgress(resourceName, data);
}
Also used : MavenServerDownloadListener(org.jetbrains.idea.maven.server.MavenServerDownloadListener) RemoteException(java.rmi.RemoteException)

Example 2 with MavenServerDownloadListener

use of org.jetbrains.idea.maven.server.MavenServerDownloadListener in project intellij-community by JetBrains.

the class MavenIndicesManager method ensureInitialized.

private synchronized void ensureInitialized() {
    if (myIndices != null)
        return;
    myIndexer = MavenServerManager.getInstance().createIndexer();
    myDownloadListener = new MavenServerDownloadListener() {

        @Override
        public void artifactDownloaded(File file, String relativePath) {
            addArtifact(file, relativePath);
        }
    };
    MavenServerManager.getInstance().addDownloadListener(myDownloadListener);
    myIndices = new MavenIndices(myIndexer, getIndicesDir().toFile(), new MavenIndex.IndexListener() {

        @Override
        public void indexIsBroken(MavenIndex index) {
            scheduleUpdate(null, Collections.singletonList(index), false);
        }
    });
    loadUserArchetypes();
}
Also used : MavenServerDownloadListener(org.jetbrains.idea.maven.server.MavenServerDownloadListener) File(java.io.File)

Aggregations

MavenServerDownloadListener (org.jetbrains.idea.maven.server.MavenServerDownloadListener)2 File (java.io.File)1 RemoteException (java.rmi.RemoteException)1