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);
}
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();
}
Aggregations