Download File from SFTP server without using JSch [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Due to some policy constraint at our company, we cannot use any external Library. I couldn't find any way to do that in Java.

I can think of two ways to avoid using an external library:
Implement your own SSH File Transfer Protocol client using the standard SSLSocket class ad related classes. The specifications are linked from the Wikipedia page. A brief review of the spec suggests that the protocol is not that complicated.
Identify and install a command-line client for SFTP, then use Process and ProcessBuilder to run the client as an external process.
Before you undertake any significant coding work on this, I would advise you to estimate how much dev time it will take to code test and maintain the code. If it seems like a lot, document the estimates and take them to your line manager.
If you are faced with a significant amount of extra work, it may affect your ability to meet your deadlines. Your manager needs to know about that.
If your manager is faced with a large dev cost or schedule slippage, he or she may be prepared to argue for an exemption to this (IMO) crazy corporate policy.

Related

Passing data between C# and Java Apps [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have an API in C# .Net for uploading files whose size vary between 10 B - 100 KB. Per second, the system receives around 5 such calls. Now I want to pass this file to a JAVA process (Because it is a producer of Kafka, and we want it to be JVM based, while C# API is legacy). Both are going to reside on the same machine almost always. What is the best way of doing that?
I read about jni4net, IKVM for interacting with Java from C#. Would they be better or should I make it socket based (Web API in Java accepting the files), or should I read from the local filesystem where C# App has uploaded or any other option that I am missing?
In environment with high concurrency, reading from the local file-system might not be good idea.
You could use memory mapped files which java supports with FileChannel.
Depending on operating system, you could also use Named pipes for IPC, here is an article showing how to use pipes between .Net and Java:
http://v01ver-howto.blogspot.com/2010/04/howto-use-named-pipes-to-communicate.html
All options considered, i would go with sockets. They are portable and easy to do and will most likely meet performance requirements you have.
You may also use a message queue. You can either put a binary message, serialize the file or put the location of file on the queue if you are storing the files in the file system.
A solution with sockets and message queues will allow you to have a more distributed architecture i.e. not loading a single machine with too much work.
If you want to actually use the C# API from Java, a bridge is probably the way to go. It'll likely be more efficient than a Web API. Some bridges will also allow you to run the C# and the Java in the same process, which is more efficient still.
In addition to the bridges you mention, you might want to consider JNBridgePro. You can find more information at our website.
Disclosure -- I am affiliated with JNBridge.

How to keep a Java program secure from hacking [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I created a Java programm which works on the serverside to communicate with an Android-App over Sockets. Now I want to check wether it is secure to hacking. I also asked in the Security.SE forum but this is programming related. So what do I need to look for in my Java-program to make it heavy to be exploided?
The first thing to check would be the server it's running on. You can cerainly checkout the https://www.owasp.org/ website. It is always a good source of security threats. Then there are a lot of pentesting tools https://www.kali.org/ has many of them built in.
But the most important might be how you've designed your API, I mean you're not very specific about what you need to know but some rules that will certainly apply:
secure the communication
make sure id theft is as hard as possible
never store userpasswords yourself(use a tokenbased system like oauth)
Obfuscation via proguard makes the program harder to reverse engineer.
Obfuscation combined with Ahead-Of-Time Compilation
1) Obfuscate names and encrypt strings using the tools not relying on the application being delivered in bytecode form. Make sure to disable control/data flow obfuscations.
2) Compile the obfuscated application down to optimized native code.
see link
http://www.excelsior-usa.com/articles/java-obfuscators.html

Server side application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
for my new project I need to write server-side application that will serve some of simple requests. I have no experience of writing server-side application, so I need some advice.
The problem is that I don't know how to start; I've spent couple of hours searching google for some guidelines, but I got nowhere.
I need to write application that will ran on the server (I've installed Ubuntu server in VirtualBox and used briged connection, so I can access it from my network) and will serve some requests:
connnect to server
authorize user (check user and his pass in db)
store some data in db on connection (for example IP address)
I am not sure which language would be best to use and what do I need to know to implement that app. This is my private project, which I came up with to learn something new; until now I have always written apps that ran locally (usually in Java/C/Python).
I've seen some tutorials on PHP and Django, but I am not sure if I am going in the right direction.
Thanks in advance for all help :)
I would prefer to you meteorjs look at www.meteor.com the reason why im prefering this to you is that i was in the same position as you one month ago and i,m amaized with meteorjs. Also have a look at derbyjs. This frameworks are built on top of node.js it allows you to write only javascript end to end.
Look at install.meteor.com you will find a quick install bash file.
At the end you can do this with any of the languages you mentioned. Write with what you like the most.

Big project like hadoop [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
We’re working like hadoop big project. We’ve a problem.
We want to work on Java based CMS (Content management system). But this CMS must include Spring, hibernate, MySQL and must have Responsive interface (our library is twitter bootsrapt).
Our project usually quite big so, what can i do ?
What's your usage to hadoop? Is it just map and reduce? If so, I seriously recommend to write map-reduce part yourself. It's simple to code up as long as you have already object serialization and communication layer; and since you mention your project is big you probably have them already. Then the value of hadoop is just an interface and I am sure you can write it in more compact and adaptive way to suit your usage.
To me this is a typical case where a 3rd party lib gives you 20% of functionality you need while introducing 80% of its own rubbish. So I'd say just write your own.
BTW, if your use case is simple, you might also want to take a look at ForkJoinPool

availability of snmp agent in network device [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have list of active deviceses in lan network... by its ip address how can I know that, Is snmp agent available on that device???
please help me find the list of snmp agent enable devices's list....
I want to do it using java (snmp4j)......
The only way to test if an agent on the device is to either know it (because the documentation says it has an agent) or to try and access it. But to try and access it you need to know how to access it.
If you're using SNMPv1 and SNMPv2c then you'll need to know the community name that can be used to get to the data. Some devices default to the community string with "public" but more and more devices, fortunately, no longer do this (and they shoudn't... from a security perspective no one should have ever done this).
For SNMPv3, you'd need to know even more parameters. But SNMPv3 with USM does have a probing method where you can send an initial packet with limited information in order to discover it's engineID. Because of this, SNMPv3 actually allows discovery unless the discovery mechanisms has been disabled.
Most commercial management suites have special code for doing discovery and network mapping, but all of them require at least configuration for trying various community names or default SNMPv3 settings.
In the end, you still need to know the devices you deployed and what they're capable of.

Categories

Resources