Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8668951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:20:32+00:00 2026-06-12T18:20:32+00:00

My Application works with Google Drive Java API. I want to create folder in

  • 0

My Application works with Google Drive Java API.

I want to create folder in the root of the Google Drive only if it does not exist. I am using below code to creat folder.

  file = service.files().insert(body).execute();

How do i check the folder existance in the root folder. I have only the folder name ‘Myapp’, not the instance ID.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:20:35+00:00Added an answer on June 12, 2026 at 6:20 pm
    Files.List request = service.files().list().setQ(
           "mimeType='application/vnd.google-apps.folder' and trashed=false");
    FileList files = request.execute();
    

    You could now go through all folders in “files” and check if any of the folders have the searched title.

    Don’t forget to loop through all pages with:

    request.setPageToken(files.getNextPageToken());
    

    Edit:

    Maybe you could have a look at this site. You can add the title in your search criteria instead so you do not have to retrieve all the folders.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use google drive application wrote a desktop application using python and everything works
I'm currently making an Google Drive App. The application already works well, now it
Recently I've integrated Google Drive with my iOS application. Everything works fine but .ppt
Background I am currently implementing an application with Google Drive/Docs. Using the latest .NET
I'm trying to use the Google Drive API through the App Identity interface provided
Right now I'm using this code to upload files to Google Drive: https://stackoverflow.com/a/11657773/1715263 It
I'm developing a mobile application which should works like the google map navigation app.
Currently i need to make an application that can list all of Google Drive
The app was registered in the Google API console as an installed application -
I'm using Gmap3-Jquery plugin to generate Google maps in one of my web application.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.