top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Difference between FileSystemResource and ClassPathResource?

+1 vote
530 views
Difference between FileSystemResource and ClassPathResource?
posted Jun 3, 2016 by Karthick.c

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

FileSystemResource can locate given spring bean configuration file from the specified path of the file system. Here we can pass either absolute path or relative path.

FileSystemResourceres = new FileSystemResource("src/com/example/cfgs/applicationContext.xml");

ClassPathResource can locate given spring bean configuration file from directories or jar files that are added to classpath/Build path.

ClassPathResource res = new ClassPathResource("applicationContext.xml");

Reference is here.

answer Jun 28, 2016 by Vinod Kumar K V
...