Find Jobs
Hire Freelancers

java code to set mimetypes on JCR files

$30-50 USD

Cancelled
Posted over 11 years ago

$30-50 USD

Paid on delivery
I need some simple java code (running in a simple JSP) to connect to a Jackrabbit JCR server to set jcr:mimetype properties for files based on file extension. It should connect to the server and loop over all files matching a specific file extension and if the mimetype does not match what it should be then set the property to the mimetype I've defined. Should display a status for each matching file, whether the mimetype was already set properly or had to be set. Simple. Only needs to do one file extension at a time. I need this script because my application was not setting mimetype for docx files. See project details for existing code sample. ## Deliverables Current code for adding and updating files looks something like this... <pre> String fullpath = relPath(path+"/"+filename); Node file; Node resource; if([login to view URL](fullpath)) { file = [login to view URL](fullpath); resource = [login to view URL]("jcr:content"); [login to view URL](); } else { file = [login to view URL](fullpath, "nt:file"); resource = [login to view URL]("jcr:content", "nt:resource"); [login to view URL]("mix:versionable"); } String mime = [login to view URL](filename); if(mime == null) { if ([login to view URL](".docx")) { mime = "application/[login to view URL]"; } else { mime = "application/octet-stream"; } } if(encoding != null) { [login to view URL]("jcr:encoding", encoding); } [login to view URL]("jcr:data", fileContents); [login to view URL]("jcr:mimeType", mime); [login to view URL]("jcr:lastModified", [login to view URL]()); </pre>
Project ID: 2785876

About the project

Remote project
Active 12 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED STATES
Chico, United States
5.0
1
Member since Jan 25, 2012

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.