mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 17:19:39 +02:00
Use handler to notify on finished file transfer
This commit is contained in:
parent
63d71230cc
commit
f9086439a8
14 changed files with 163 additions and 36 deletions
|
@ -1,9 +1,25 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Paul Schaub
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
/**
|
||||
* Created by vanitas on 06.07.17.
|
||||
*/
|
||||
public class JingleStreamRouter {
|
||||
public final class JingleStreamRouter {
|
||||
private static JingleStreamRouter INSTANCE;
|
||||
|
||||
private JingleStreamRouter() {
|
||||
|
|
|
@ -25,6 +25,14 @@ public class JingleContentProviderManager {
|
|||
|
||||
private static final Map<String, JingleContentTransportProvider<?>> jingleContentTransportProviders = new ConcurrentHashMap<>();
|
||||
|
||||
public static void removeJingleContentTransportProvider(String namespace) {
|
||||
jingleContentTransportProviders.remove(namespace);
|
||||
}
|
||||
|
||||
public static void removeJingleContentDescriptionProvider(String namespace) {
|
||||
jingleContentDescriptionProviders.remove(namespace);
|
||||
}
|
||||
|
||||
public static JingleContentDescriptionProvider<?> addJingleContentDescriptionProvider(String namespace,
|
||||
JingleContentDescriptionProvider<?> provider) {
|
||||
return jingleContentDescriptionProviders.put(namespace, provider);
|
||||
|
|
|
@ -35,6 +35,9 @@ public class JingleContentProviderManagerTest extends SmackTestSuite {
|
|||
|
||||
@Test
|
||||
public void transportProviderTest() {
|
||||
JingleContentProviderManager.removeJingleContentTransportProvider(JingleIBBTransport.NAMESPACE_V1);
|
||||
JingleContentProviderManager.removeJingleContentTransportProvider(JingleS5BTransport.NAMESPACE_V1);
|
||||
|
||||
assertNull(JingleContentProviderManager.getJingleContentTransportProvider(JingleIBBTransport.NAMESPACE_V1));
|
||||
assertNull(JingleContentProviderManager.getJingleContentTransportProvider(JingleS5BTransport.NAMESPACE_V1));
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ public class JingleUtilTest extends SmackTestSuite {
|
|||
String xml =
|
||||
"<iq " +
|
||||
"to='" + romeo + "' " +
|
||||
"from='" + romeo +"' " +
|
||||
"from='" + romeo + "' " +
|
||||
"id='" + j.getStanzaId() + "' " +
|
||||
"type='error'>" +
|
||||
"<error type='cancel'>" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue