Fix checkstyle issues

This commit is contained in:
vanitasvitae 2017-07-27 23:31:04 +02:00
parent 60cb777ea9
commit fec28ac7b6
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
47 changed files with 498 additions and 64 deletions

View File

@ -1,10 +1,26 @@
/**
*
* 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.jet.internal;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smackx.jet.element.JetSecurityElement;
import org.jivesoftware.smackx.jingle.components.JingleSecurity;
import org.jivesoftware.smackx.jingle.element.JingleContentSecurityInfoElement;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.components.JingleSecurity;
/**
* Created by vanitas on 22.07.17.

View File

@ -0,0 +1,22 @@
/**
*
* 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.
*/
/**
* Smack's API for XEP-XXXX: Jingle Encrypted Transfers</a>.
* Internal classes.
*/
package org.jivesoftware.smackx.jet.internal;

View File

@ -0,0 +1,22 @@
/**
*
* 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0234.html">XEP-0234: Jingle File Transfer</a>.
* Callbacks.
*/
package org.jivesoftware.smackx.jft.callback;

View File

@ -0,0 +1,22 @@
/**
*
* 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0234.html">XEP-0234: Jingle File Transfer</a>.
* Controller.
*/
package org.jivesoftware.smackx.jft.controller;

View File

@ -20,8 +20,8 @@ import java.util.Collections;
import java.util.List;
import org.jivesoftware.smackx.jft.internal.JingleFileTransfer;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionElement;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionChildElement;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionElement;
/**
* File element.

View File

@ -33,7 +33,7 @@ public class JingleOutgoingFileOffer extends AbstractJingleFileOffer<LocalFile>
@Override
public void onTransportReady(BytestreamSession bytestreamSession) {
}
@Override

View File

@ -59,7 +59,7 @@ public class LocalFile extends AbstractJingleFileTransferFile {
@Override
public String getName() {
String path = file.getAbsolutePath();
return path.substring(path.lastIndexOf(File.pathSeparatorChar)+1);
return path.substring(path.lastIndexOf(File.pathSeparatorChar) + 1);
}
@Override

View File

@ -0,0 +1,22 @@
/**
*
* 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0234.html">XEP-0234: Jingle File Transfer</a>.
* Classes that may represent files.
*/
package org.jivesoftware.smackx.jft.internal.file;

View File

@ -0,0 +1,22 @@
/**
*
* 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0234.html">XEP-0234: Jingle File Transfer</a>.
* Internal classes.
*/
package org.jivesoftware.smackx.jft.internal;

View File

@ -0,0 +1,22 @@
/**
*
* 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0234.html">XEP-0234: Jingle File Transfer</a>.
* Listeners.
*/
package org.jivesoftware.smackx.jft.listener;

View File

@ -0,0 +1,21 @@
/**
*
* 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0234.html">XEP-0234: Jingle File Transfer</a>.
*/
package org.jivesoftware.smackx.jft;

View File

@ -23,13 +23,14 @@ import org.jivesoftware.smack.provider.ExtensionElementProvider;
import org.jivesoftware.smack.util.ParserUtils;
import org.jivesoftware.smackx.hashes.element.HashElement;
import org.jivesoftware.smackx.hashes.provider.HashElementProvider;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jivesoftware.smackx.jft.element.ChecksumElement;
import org.jivesoftware.smackx.jft.element.JingleFileTransferChildElement;
import org.jivesoftware.smackx.jft.element.Range;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.xmlpull.v1.XmlPullParser;
/**
* Provider for the Checksum element.
*/

View File

@ -24,12 +24,12 @@ import java.util.ArrayList;
import org.jivesoftware.smack.util.ParserUtils;
import org.jivesoftware.smackx.hashes.element.HashElement;
import org.jivesoftware.smackx.hashes.provider.HashElementProvider;
import org.jivesoftware.smackx.jft.element.JingleFileTransferChildElement;
import org.jivesoftware.smackx.jft.element.JingleFileTransferElement;
import org.jivesoftware.smackx.jft.element.Range;
import org.jivesoftware.smackx.jft.internal.JingleFileTransfer;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionChildElement;
import org.jivesoftware.smackx.jingle.provider.JingleContentDescriptionProvider;
import org.jivesoftware.smackx.jft.element.JingleFileTransferElement;
import org.jivesoftware.smackx.jft.element.JingleFileTransferChildElement;
import org.jivesoftware.smackx.jft.element.Range;
import org.jxmpp.util.XmppDateTime;
import org.xmlpull.v1.XmlPullParser;

View File

@ -22,11 +22,11 @@ import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smack.test.util.TestUtils;
import org.jivesoftware.smackx.hashes.HashManager;
import org.jivesoftware.smackx.hashes.element.HashElement;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jivesoftware.smackx.jft.element.ChecksumElement;
import org.jivesoftware.smackx.jft.element.JingleFileTransferChildElement;
import org.jivesoftware.smackx.jft.element.Range;
import org.jivesoftware.smackx.jft.provider.ChecksumProvider;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.junit.Test;

View File

@ -23,6 +23,8 @@ import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jivesoftware.smack.Manager;
import org.jivesoftware.smack.XMPPConnection;
@ -33,13 +35,13 @@ import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.jingle.adapter.JingleDescriptionAdapter;
import org.jivesoftware.smackx.jingle.adapter.JingleSecurityAdapter;
import org.jivesoftware.smackx.jingle.adapter.JingleTransportAdapter;
import org.jivesoftware.smackx.jingle.components.JingleSession;
import org.jivesoftware.smackx.jingle.element.JingleAction;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.element.JingleReasonElement;
import org.jivesoftware.smackx.jingle.exception.UnsupportedDescriptionException;
import org.jivesoftware.smackx.jingle.exception.UnsupportedSecurityException;
import org.jivesoftware.smackx.jingle.exception.UnsupportedTransportException;
import org.jivesoftware.smackx.jingle.components.JingleSession;
import org.jivesoftware.smackx.jingle.provider.JingleContentDescriptionProvider;
import org.jivesoftware.smackx.jingle.provider.JingleContentSecurityProvider;
import org.jivesoftware.smackx.jingle.provider.JingleContentTransportProvider;
@ -51,7 +53,8 @@ import org.jxmpp.jid.FullJid;
/**
* Manager for Jingle (XEP-0166).
*/
public class JingleManager extends Manager {
public final class JingleManager extends Manager {
private static final Logger LOGGER = Logger.getLogger(JingleManager.class.getName());
private static final WeakHashMap<XMPPConnection, JingleManager> INSTANCES = new WeakHashMap<>();
private static final WeakHashMap<String, JingleContentDescriptionProvider<?>> descriptionProviders = new WeakHashMap<>();
@ -101,7 +104,7 @@ public class JingleManager extends Manager {
return JingleElement.createSessionTerminate(jingle.getFrom().asFullJidOrThrow(),
jingle.getSid(), JingleReasonElement.Reason.unsupported_transports);
} catch (UnsupportedSecurityException e) {
e.printStackTrace();
LOGGER.log(Level.SEVERE, "Unsupported Security: " + e, e);
return null;
}

View File

@ -16,8 +16,8 @@
*/
package org.jivesoftware.smackx.jingle.adapter;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionElement;
import org.jivesoftware.smackx.jingle.components.JingleDescription;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionElement;
/**
* Adapter that creates a Description object from an element.

View File

@ -16,8 +16,8 @@
*/
package org.jivesoftware.smackx.jingle.adapter;
import org.jivesoftware.smackx.jingle.element.JingleContentSecurityElement;
import org.jivesoftware.smackx.jingle.components.JingleSecurity;
import org.jivesoftware.smackx.jingle.element.JingleContentSecurityElement;
/**
* Adapter that creates a Security object from an element.

View File

@ -16,8 +16,8 @@
*/
package org.jivesoftware.smackx.jingle.adapter;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
import org.jivesoftware.smackx.jingle.components.JingleTransport;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
/**
* Adapter that creates a Transport element from an element.
@ -27,4 +27,4 @@ public interface JingleTransportAdapter<T extends JingleTransport<?>> {
T transportFromElement(JingleContentTransportElement element);
String getNamespace();
}
}

View File

@ -0,0 +1,22 @@
/**
*
* Copyright 2017 Florian Schmaus, 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0166.html">XEP-0166: Jingle</a>.
* Adapters.
*/
package org.jivesoftware.smackx.jingle.adapter;

View File

@ -1,3 +1,19 @@
/**
*
* 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.callbacks;
import org.jivesoftware.smackx.bytestreams.BytestreamSession;

View File

@ -0,0 +1,22 @@
/**
*
* Copyright 2017 Florian Schmaus, 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0166.html">XEP-0166: Jingle</a>.
* Callbacks.
*/
package org.jivesoftware.smackx.jingle.callbacks;

View File

@ -29,19 +29,19 @@ import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.bytestreams.BytestreamSession;
import org.jivesoftware.smackx.jingle.Callback;
import org.jivesoftware.smackx.jingle.JingleManager;
import org.jivesoftware.smackx.jingle.JingleTransportManager;
import org.jivesoftware.smackx.jingle.adapter.JingleDescriptionAdapter;
import org.jivesoftware.smackx.jingle.adapter.JingleSecurityAdapter;
import org.jivesoftware.smackx.jingle.adapter.JingleTransportAdapter;
import org.jivesoftware.smackx.jingle.callbacks.JingleTransportCallback;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionElement;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jivesoftware.smackx.jingle.element.JingleContentSecurityElement;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
import org.jivesoftware.smackx.jingle.Callback;
import org.jivesoftware.smackx.jingle.adapter.JingleSecurityAdapter;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.element.JingleReasonElement;
import org.jivesoftware.smackx.jingle.JingleTransportManager;
/**
* Internal class that holds the state of a content in a modifiable form.

View File

@ -423,4 +423,4 @@ public class JingleSession {
}
return map;
}
}
}

View File

@ -0,0 +1,22 @@
/**
*
* Copyright 2017 Florian Schmaus, 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0166.html">XEP-0166: Jingle</a>.
* Internal components.
*/
package org.jivesoftware.smackx.jingle.components;

View File

@ -1,3 +1,19 @@
/**
*
* 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.element;
import org.jivesoftware.smack.packet.NamedElement;

View File

@ -1,3 +1,19 @@
/**
*
* 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.exception;
/**

View File

@ -0,0 +1,22 @@
/**
*
* Copyright 2017 Florian Schmaus, 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0166.html">XEP-0166: Jingle</a>.
* Exceptions.
*/
package org.jivesoftware.smackx.jingle.exception;

View File

@ -17,7 +17,6 @@
package org.jivesoftware.smackx.jingle.provider;
import org.jivesoftware.smack.provider.ExtensionElementProvider;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionElement;
import org.xmlpull.v1.XmlPullParser;

View File

@ -1,3 +1,19 @@
/**
*
* 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.provider;
import org.jivesoftware.smack.provider.ExtensionElementProvider;

View File

@ -20,14 +20,12 @@ import java.util.logging.Logger;
import org.jivesoftware.smack.provider.IQProvider;
import org.jivesoftware.smack.util.ParserUtils;
import org.jivesoftware.smackx.jingle.element.JingleAction;
import org.jivesoftware.smackx.jingle.element.JingleContentDescriptionElement;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jivesoftware.smackx.jingle.element.JingleAction;
import org.jivesoftware.smackx.jingle.element.JingleReasonElement;
import org.jivesoftware.smackx.jingle.element.JingleReasonElement.Reason;
import org.jxmpp.jid.FullJid;
import org.xmlpull.v1.XmlPullParser;
@ -75,7 +73,7 @@ public class JingleProvider extends IQProvider<JingleElement> {
String sid = parser.nextText();
reason = new JingleReasonElement.AlternativeSession(sid);
} else {
reason = new JingleReasonElement(Reason.fromString(reasonString));
reason = new JingleReasonElement(JingleReasonElement.Reason.fromString(reasonString));
}
builder.setReason(reason);
break;

View File

@ -1,3 +1,19 @@
/**
*
* 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.transport.jingle_ibb;
import java.util.WeakHashMap;
@ -15,7 +31,7 @@ import org.jivesoftware.smackx.jingle.transport.jingle_ibb.provider.JingleIBBTra
/**
* Created by vanitas on 21.07.17.
*/
public class JingleIBBTransportManager extends Manager implements JingleTransportManager {
public final class JingleIBBTransportManager extends Manager implements JingleTransportManager {
public static final short MAX_BLOCKSIZE = 8192;
@ -62,7 +78,7 @@ public class JingleIBBTransportManager extends Manager implements JingleTranspor
}
@Override
public int compareTo(JingleTransportManager manager) {
return Integer.compare(getPriority(), manager.getPriority());
public int compareTo(JingleTransportManager other) {
return getPriority() > other.getPriority() ? 1 : -1;
}
}

View File

@ -35,13 +35,13 @@ import org.jivesoftware.smackx.bytestreams.socks5.Socks5Utils;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.jingle.JingleManager;
import org.jivesoftware.smackx.jingle.callbacks.JingleTransportCallback;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportInfoElement;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.exception.FailedTransportException;
import org.jivesoftware.smackx.jingle.components.JingleContent;
import org.jivesoftware.smackx.jingle.components.JingleSession;
import org.jivesoftware.smackx.jingle.components.JingleTransport;
import org.jivesoftware.smackx.jingle.components.JingleTransportCandidate;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportInfoElement;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.exception.FailedTransportException;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportCandidateElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportInfoElement;
@ -166,7 +166,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
try {
return ((JingleS5BTransportCandidate) c).connect(_timeout);
} catch (IOException | TimeoutException | InterruptedException | SmackException | XMPPException e) {
e.printStackTrace();
LOGGER.log(Level.WARNING, "Exception while connecting to candidate: " + e, e);
}
}

View File

@ -19,9 +19,9 @@ package org.jivesoftware.smackx.jingle.transport.jingle_s5b;
import java.util.ArrayList;
import org.jivesoftware.smackx.jingle.adapter.JingleTransportAdapter;
import org.jivesoftware.smackx.jingle.components.JingleTransportCandidate;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportCandidateElement;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
import org.jivesoftware.smackx.jingle.components.JingleTransportCandidate;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportCandidateElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportElement;

View File

@ -25,9 +25,9 @@ import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smackx.bytestreams.socks5.Socks5Client;
import org.jivesoftware.smackx.bytestreams.socks5.Socks5ClientForInitiator;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportCandidateElement;
import org.jivesoftware.smackx.jingle.components.JingleSession;
import org.jivesoftware.smackx.jingle.components.JingleTransportCandidate;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportCandidateElement;
/**
* Jingle SOCKS5Bytestream transport candidate.

View File

@ -36,19 +36,19 @@ import org.jivesoftware.smackx.bytestreams.socks5.Socks5Proxy;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.jingle.JingleManager;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.JingleTransportManager;
import org.jivesoftware.smackx.jingle.components.JingleContent;
import org.jivesoftware.smackx.jingle.components.JingleSession;
import org.jivesoftware.smackx.jingle.components.JingleTransport;
import org.jivesoftware.smackx.jingle.components.JingleTransportCandidate;
import org.jivesoftware.smackx.jingle.element.JingleAction;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jivesoftware.smackx.jingle.element.JingleElement;
import org.jivesoftware.smackx.jingle.provider.JingleContentProviderManager;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportCandidateElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportInfoElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.provider.JingleS5BTransportProvider;
import org.jivesoftware.smackx.jingle.JingleTransportManager;
import org.jivesoftware.smackx.jingle.element.JingleAction;
import org.jivesoftware.smackx.jingle.element.JingleContentElement;
import org.jxmpp.jid.Jid;
@ -240,8 +240,8 @@ public final class JingleS5BTransportManager extends Manager implements JingleTr
}
@Override
public int compareTo(JingleTransportManager manager) {
return Integer.compare(getPriority(), manager.getPriority());
public int compareTo(JingleTransportManager other) {
return getPriority() > other.getPriority() ? 1 : -1;
}
private ConnectionListener connectionListener = new ConnectionListener() {

View File

@ -1,3 +1,19 @@
/**
*
* 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.transport.jingle_s5b;
import org.jivesoftware.smackx.jingle.exception.FailedTransportException;

View File

@ -22,8 +22,8 @@ import java.util.List;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.XmlStringBuilder;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportCandidateElement;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportInfoElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.JingleS5BTransport;

View File

@ -30,12 +30,13 @@ import static org.xmlpull.v1.XmlPullParser.START_TAG;
import org.jivesoftware.smackx.jingle.element.JingleContentTransportElement;
import org.jivesoftware.smackx.jingle.provider.JingleContentTransportProvider;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.JingleS5BTransport;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportCandidateElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportInfoElement;
import org.xmlpull.v1.XmlPullParser;
/**
* Provider for JingleSocks5BytestreamTransport elements.
*/

View File

@ -0,0 +1,22 @@
/**
*
* Copyright 2017 Florian Schmaus, 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0166.html">XEP-0166: Jingle</a>.
* Jingle Transport methods.
*/
package org.jivesoftware.smackx.jingle.transport;

View File

@ -0,0 +1,22 @@
/**
*
* Copyright 2017 Florian Schmaus, 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.
*/
/**
* Smack's API for <a href="https://xmpp.org/extensions/xep-0166.html">XEP-0166: Jingle</a>.
* Small classes with no real place.
*/
package org.jivesoftware.smackx.jingle.util;

View File

@ -548,31 +548,31 @@
<iqProvider>
<elementName>jingle</elementName>
<namespace>urn:xmpp:jingle:1</namespace>
<className>org.jivesoftware.smackx.jingle3.provider.JingleProvider</className>
<className>org.jivesoftware.smackx.jingle.provider.JingleProvider</className>
</iqProvider>
<extensionProvider>
<elementName>out-of-order</elementName>
<namespace>urn:xmpp:jingle:errors:1</namespace>
<className>org.jivesoftware.smackx.jingle3.provider.JingleErrorProvider</className>
<className>org.jivesoftware.smackx.jingle.provider.JingleErrorProvider</className>
</extensionProvider>
<extensionProvider>
<elementName>unknown-session</elementName>
<namespace>urn:xmpp:jingle:errors:1</namespace>
<className>org.jivesoftware.smackx.jingle3.provider.JingleErrorProvider</className>
<className>org.jivesoftware.smackx.jingle.provider.JingleErrorProvider</className>
</extensionProvider>
<extensionProvider>
<elementName>unsupported-content</elementName>
<namespace>urn:xmpp:jingle:errors:1</namespace>
<className>org.jivesoftware.smackx.jingle3.provider.JingleErrorProvider</className>
<className>org.jivesoftware.smackx.jingle.provider.JingleErrorProvider</className>
</extensionProvider>
<extensionProvider>
<elementName>unsupported-transports</elementName>
<namespace>urn:xmpp:jingle:errors:1</namespace>
<className>org.jivesoftware.smackx.jingle3.provider.JingleErrorProvider</className>
<className>org.jivesoftware.smackx.jingle.provider.JingleErrorProvider</className>
</extensionProvider>
</smackProviders>

View File

@ -294,7 +294,7 @@ public class JingleElementTest extends SmackTestSuite {
String jingleXML =
"<jingle xmlns='urn:xmpp:jingle:1' " +
"action='transport-accept' " +
"initiator='" + romeo + "' " +
"initiator='" + juliet + "' " +
"sid='transAcc'>" +
"<content creator='initiator' name='cname'>" +
"<transport xmlns='urn:xmpp:jingle:transports:ibb:1' " +
@ -302,7 +302,7 @@ public class JingleElementTest extends SmackTestSuite {
"sid='transid'/>" +
"</content>" +
"</jingle>";
String xml = getIQXML(romeo, juliet, transportAccept.getStanzaId(), jingleXML);
String xml = getIQXML(juliet, romeo, transportAccept.getStanzaId(), jingleXML);
assertXMLEqual(xml, transportAccept.toXML().toString());
assertEquals(JingleAction.transport_accept, transportAccept.getAction());
assertEquals("transAcc", transportAccept.getSid());
@ -319,7 +319,7 @@ public class JingleElementTest extends SmackTestSuite {
String jingleXML =
"<jingle xmlns='urn:xmpp:jingle:1' " +
"action='transport-replace' " +
"initiator='" + romeo + "' " +
"initiator='" + juliet + "' " +
"sid='transAcc'>" +
"<content creator='initiator' name='cname'>" +
"<transport xmlns='urn:xmpp:jingle:transports:ibb:1' " +
@ -327,7 +327,7 @@ public class JingleElementTest extends SmackTestSuite {
"sid='transid'/>" +
"</content>" +
"</jingle>";
String xml = getIQXML(romeo, juliet, transportReplace.getStanzaId(), jingleXML);
String xml = getIQXML(juliet, romeo, transportReplace.getStanzaId(), jingleXML);
assertXMLEqual(xml, transportReplace.toXML().toString());
assertEquals(JingleAction.transport_replace, transportReplace.getAction());
assertEquals("transAcc", transportReplace.getSid());
@ -339,7 +339,6 @@ public class JingleElementTest extends SmackTestSuite {
IQ error = JingleElement.createJingleErrorMalformedRequest(j);
String xml =
"<iq " +
"to='" + romeo + "' " +
"from='" + romeo + "' " +
"id='" + j.getStanzaId() + "' " +
"type='error'>" +
@ -356,7 +355,6 @@ public class JingleElementTest extends SmackTestSuite {
IQ error = JingleElement.createJingleErrorTieBreak(j);
String xml =
"<iq " +
"to='" + romeo + "' " +
"from='" + romeo + "' " +
"id='" + j.getStanzaId() + "' " +
"type='error'>" +
@ -374,7 +372,6 @@ public class JingleElementTest extends SmackTestSuite {
IQ error = JingleElement.createJingleErrorUnknownSession(j);
String xml =
"<iq " +
"to='" + romeo + "' " +
"from='" + romeo + "' " +
"id='" + j.getStanzaId() + "' " +
"type='error'>" +
@ -392,7 +389,6 @@ public class JingleElementTest extends SmackTestSuite {
IQ error = JingleElement.createJingleErrorUnknownInitiator(j);
String xml =
"<iq " +
"to='" + romeo + "' " +
"from='" + romeo + "' " +
"id='" + j.getStanzaId() + "' " +
"type='error'>" +
@ -409,7 +405,6 @@ public class JingleElementTest extends SmackTestSuite {
IQ error = JingleElement.createJingleErrorOutOfOrder(j);
String xml =
"<iq " +
"to='" + romeo + "' " +
"from='" + romeo + "' " +
"id='" + j.getStanzaId() + "' " +
"type='error'>" +
@ -428,7 +423,6 @@ public class JingleElementTest extends SmackTestSuite {
IQ error = JingleElement.createJingleErrorUnsupportedInfo(j);
String xml =
"<iq " +
"to='" + romeo + "' " +
"from='" + romeo + "' " +
"id='" + j.getStanzaId() + "' " +
"type='error'>" +
@ -441,7 +435,7 @@ public class JingleElementTest extends SmackTestSuite {
}
public static String getIQXML(FullJid from, FullJid to, String stanzaId, String jingleXML) {
return "<iq from='" + from + "' id='" + stanzaId + "' to='" + to + "' type='set'>" +
return "<iq id='" + stanzaId + "' to='" + to + "' type='set'>" +
jingleXML +
"</iq>";
}

View File

@ -23,11 +23,10 @@ import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import org.jivesoftware.smack.test.util.SmackTestSuite;
import org.jivesoftware.smack.test.util.TestUtils;
import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportCandidateElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.element.JingleS5BTransportInfoElement;
import org.jivesoftware.smackx.jingle.transport.jingle_s5b.provider.JingleS5BTransportProvider;

View File

@ -16,6 +16,6 @@
*/
/**
* TODO describe me.
* Tests for XEP-0234 - Jingle File Transfer.
*/
package org.jivesoftware.smackx.jft;

View File

@ -0,0 +1,21 @@
/**
*
* 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.
*/
/**
* Tests for Jingle.
*/
package org.jivesoftware.smackx.jingle;

View File

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jivesoftware.smackx.jingle;
package org.jivesoftware.smackx.jingle.transport;
import static junit.framework.TestCase.fail;

View File

@ -0,0 +1,21 @@
/**
*
* 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.
*/
/**
* Tests for Tests for different Jingle transport methods.
*/
package org.jivesoftware.smackx.jingle.transport;