kamesh vadam

+ Follow
since Nov 28, 2014
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kamesh vadam

Hi i want to chunk download from one-drive but i unable getting specific range .
I was used below header in xmlhttp request.

xmlhttp.setRequestHeader('Range', 'bytes=0-3000');

But if i use above tag then response is not coming else getting total file content.
What i have to do please help me.
5 years ago
private Integer space;

@OneToMany(mappedBy = "userid",cascade = CascadeType.PERSIST)
private Collection<Externalstoragecredentials> externalstoragecredentialsCollection;

this is parent entity

@JoinColumn(name = "userid", referencedColumnName = "id")
@ManyToOne(cascade = CascadeType.PERSIST)
private Dpatchuser userid;

this is child entity

can you give named query to update child table data.

5 years ago
Hi i have to know how to play all video formats(avi,mkv...) with HTML5 video player.I was using HTNL5 video tag but it is supporting ogg,mp4,webm formates.So how can i achieve this problem.My code is.

please help me.Thanks
5 years ago
Hi i was uploading file to drop-box using java.But the problem is how can i add progress bar to file upload to drop-box.I didn't use java script for it.I didn't get any of this in drop-box API. my code is.

please help me.
5 years ago
Hi i was used ServletFileUpload.But the probem is list size(items.size) is 0.But in request object i was getting file.where i have did wrong..?

my code is...

boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (isMultipart) {
System.out.println("file is available");
DiskFileItemFactory factory = new DiskFileItemFactory();
factory.setRepository(new File(System.getProperty("java.io.tmpdir")));
System.out.println("file is available1" + factory.getRepository());
ServletFileUpload upload = new ServletFileUpload(factory);
System.out.println("file is available2" + upload.getSizeMax());
List<FileItem> items = upload.parseRequest(request);
System.out.println("file is available::::" + items.size());
Iterator<FileItem> iter = items.iterator();
while (iter.hasNext()) {
FileItem item = iter.next();
System.out.println(item.getName() + ":::::" + item.getFieldName());
System.out.println("file is available");
5 years ago
So which classes i have to use.Please give me the information.
5 years ago
How to upload file to google drive using java. my java code is.

HttpTransport httpTransport = new NetHttpTransport();
JsonFactory jsonFactory = new JacksonFactory();
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
httpTransport, jsonFactory, CLIENT_ID, CLIENT_SECRET, Arrays.asList(DriveScopes.DRIVE))

String url = flow.newAuthorizationUrl().setRedirectUri(REDIRECT_URI).build();
System.out.println("Please open the following URL in your browser then type the authorization code:");
System.out.println(" " + url);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String code = br.readLine();

GoogleTokenResponse response = flow.newTokenRequest(code).setRedirectUri(REDIRECT_URI).execute();
GoogleCredential credential = new GoogleCredential().setFromTokenResponse(response);

//Create a new authorized API client
Drive service = new Drive.Builder(httpTransport, jsonFactory, credential).build();

//Insert a file
File body = new File();
body.setTitle("My document");
body.setDescription("A test document");

java.io.File fileContent = new java.io.File("document.txt");
FileContent mediaContent = new FileContent("text/plain", fileContent);

File file = service.files().insert(body, mediaContent).execute();
System.out.println("File ID: " + file.getId());

So in that file object(java.io.File fileContent = new java.io.File("document.txt");) asking complete file path.But in file upload we can get only file name not path.How to resolve the problem.please help me.
5 years ago
OK i am getting file if i give the same file name in above very first line it is showing file Not Found Exception.
so i should be store this file in temp folder in server right?
then i can give the path that file.like you mean that?
5 years ago
In my web application i want to upload file to drop-box. I am getting file name from browser.Is it possible to upload file to drop-box with only file name.

Below the drop-box upload code with java.

File inputFile = new File("New Text Document.txt");
System.out.println("inputFile.getAbsoluteFile(): " + inputFile);
FileInputStream inputStream = new FileInputStream(inputFile);
try {
DbxEntry.File uploadedFile = client.uploadFile("/magnum-opus.txt",
DbxWriteMode.add(), inputFile.length(), inputStream);
System.out.println("Uploaded: " + uploadedFile.toString());
} finally {

In the above code the place New Text Document.txt we have to provide total path of file.

please help me.Thanq
5 years ago
How to get System filepath in file upload...?
5 years ago