apache-mina

How to get an acknowledgement for the client socket from server?

南楼画角 提交于 2019-11-30 20:56:42
问题 I have a client socket which sends messages to the server.I want to get an acknowledgement on the client side whenever the server receives the message. Is it possible to get that acknowledgement. I developed the client using apache mina. Thanks in advance. 回答1: There are no messages in TCP, only a byte stream. There is an internal ACK mechanism that tracks how much of the stream has been correctly received, but it is not available to applications. If you want an acknowledgment from the server

How to override getVirtualUserDir() in Apache Mina sshd-core version 0.14.0

限于喜欢 提交于 2019-11-30 08:50:46
问题 I used Apache Mina sshd-core version 0.10.0.Due to some issues with file uploading i had to change version into 0.14.0.In there i can not override getVirtualUserDir() method. Below is my sample code, sshd.setFileSystemFactory(new NativeFileSystemFactory() { @Override public FileSystemView createFileSystemView(final Session session) { return new NativeFileSystemView(session.getUsername(), false) { @Override public String getVirtualUserDir() { return "C:/root"; } }; }; }); I would like to know

Maven: NoClassDefFoundError in the main thread

折月煮酒 提交于 2019-11-30 04:46:30
I am currently building a little Apache-Mina Server app. I am using Maven to build it. When i try to run the jar, I get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/mina/filter/codec/ProtocolCodecFactory Caused by: java.lang.ClassNotFoundException: org.apache.mina.filter.codec.Protoc olCodecFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc

How to override getVirtualUserDir() in Apache Mina sshd-core version 0.14.0

喜你入骨 提交于 2019-11-29 08:22:08
I used Apache Mina sshd-core version 0.10.0.Due to some issues with file uploading i had to change version into 0.14.0.In there i can not override getVirtualUserDir() method. Below is my sample code, sshd.setFileSystemFactory(new NativeFileSystemFactory() { @Override public FileSystemView createFileSystemView(final Session session) { return new NativeFileSystemView(session.getUsername(), false) { @Override public String getVirtualUserDir() { return "C:/root"; } }; }; }); I would like to know that how can i overcome that problem in Apache Mina sshd-core version 0.14.0. Thanks. The purpose of

Apache MINA SFTP Example

▼魔方 西西 提交于 2019-11-29 07:53:30
I'm trying to set up an SFTP server with multiple users that each have their own home directory. I read this answer which explained how to set a virtual directory for a single user but I'm not sure how to have multiple users each with their own home directory. Can someone please tell me how to go about this? I finally got it working. Here is a working example: pom.xml <dependency> <groupId>org.apache.sshd</groupId> <artifactId>sshd-core</artifactId> <version>0.14.0</version> </dependency> Test.java import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util

Maven: NoClassDefFoundError in the main thread

余生颓废 提交于 2019-11-29 02:36:29
问题 I am currently building a little Apache-Mina Server app. I am using Maven to build it. When i try to run the jar, I get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/mina/filter/codec/ProtocolCodecFactory Caused by: java.lang.ClassNotFoundException: org.apache.mina.filter.codec.Protoc olCodecFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader

How to Set Root Directory in Apache Mina Sshd Server in Java

僤鯓⒐⒋嵵緔 提交于 2019-11-29 01:53:19
I use Apache Mina Sshd API to start up a local SFTP server in java.In SFTP client i use Jcraft jsch API to create my SFTP client.I successfully start up a server.The problem is that i want to write some unit test cases to check whether client can put some files into server's root directory. Currently my SFTP server doesn't have any root directory.So i would like to know that is there is any approach to set server's root directory. Eg: C:\sftp How can i set this path as my server root directory.so then client can read and write files to it every time connect with the server.Thank you. public

Using JAVA NIO framework in SPRING server

浪尽此生 提交于 2019-11-28 07:53:11
I'm implementing an hybrid server application that mixes a Web-Servlet and a plain Java application. The java application manages thousands of sockets for remote devices, while the Web application interacts with the user to set/read the state of any socket. Java NIO, or Apache-MINA vs Jboss-Netty , seems to be good options for the sockets application. The first question is, can I run both applications (Servlet with web interface + JAVA NIO application) in the same server? I'am using now Tomcat for the Servlet and a plain procrun daemon for the socket-application I don't know if Spring is

Apache MINA SFTP Example

情到浓时终转凉″ 提交于 2019-11-28 01:24:59
问题 I'm trying to set up an SFTP server with multiple users that each have their own home directory. I read this answer which explained how to set a virtual directory for a single user but I'm not sure how to have multiple users each with their own home directory. Can someone please tell me how to go about this? 回答1: I finally got it working. Here is a working example: pom.xml <dependency> <groupId>org.apache.sshd</groupId> <artifactId>sshd-core</artifactId> <version>0.14.0</version> </dependency

How to Set Root Directory in Apache Mina Sshd Server in Java

我的未来我决定 提交于 2019-11-27 21:45:19
问题 I use Apache Mina Sshd API to start up a local SFTP server in java.In SFTP client i use Jcraft jsch API to create my SFTP client.I successfully start up a server.The problem is that i want to write some unit test cases to check whether client can put some files into server's root directory. Currently my SFTP server doesn't have any root directory.So i would like to know that is there is any approach to set server's root directory. Eg: C:\sftp How can i set this path as my server root