Skip to content

CIFS/SMB based File transfer using the JCIFS library in Java

Notifications You must be signed in to change notification settings

bruce-mig/jcifs-file-transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JCIFS File Transfer

This project demonstrates how to upload files to a Windows shared folder using the JCIFS library in Java. JCIFS is a Java library that implements the CIFS/SMB networking protocol, allowing you to access shared files and directories on Windows servers.

Prerequisites

  • Java Development Kit (JDK) 8 or later
  • Maven (for dependency management)
  • Access to a Windows shared folder with the necessary permissions

Setup

Clone the Repository:

git clone https://github.com/bruce-mig/jcifs-file-transfer.git
cd jcifs-file-transfer

Add JCIFS Dependency:

Ensure that the pom.xml file includes the JCIFS dependency:

<dependency>
    <groupId>jcifs</groupId>
    <artifactId>jcifs</artifactId>
    <version>1.3.19</version>
</dependency>

Configure Access Credentials:

Update the JCIFSExample.java file with your domain, username, password, and shared folder path:

String domain = "your_domain"; // e.g., "mydomain"
String username = "your_username"; // e.g., "myuser"
String password = "your_password"; // e.g., "mypassword"
String sharedFolderPath = "smb://<host-ip>/shared_folder/"; // Path to the shared folder
String localFilePath = "/path/to/local/file.txt"; // Path to the local file to be uploaded

Usage

Compile the Project:

./mvnw clean compile

Run the App:

./mvnw spring-boot:run

About

CIFS/SMB based File transfer using the JCIFS library in Java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages