I have created the folder programmatically and it is appearing in google drive. Now I want to add files to the folder created. File is getting created but inside root folder. I don't want that to happen.
Thanks
Do you setParent when you create the file info? It's a ParentReference added in the file info used in the insert requests. All you need to create the parent reference is the id of the parent (the folder you created) (and maybe a flag to note whether it's the root or not).
Related
In my netbeans IDE I am creating one project.That project(Web Application) needs properties file.Since my application is having several packages.And all packages need to read this properties file in their code.So where should I place this java properties file.If I place the file out side of the packages that is under sourcepackages seperately,I am getting FilenotFound Exception.So where should I place it.
And one more doubt is if I want to change any content in the file in future where should I change the contents since it is present in Projects folder and under Files->build->classes folder also.From where should I modify it.From where the changes will be effected.
Please help.
Thank you.
Put your file under /src/resources/, then use it like below:
ResourceBundle props = ResourceBundle.getBundle("resources.config");
You may put this in any package. The point ist to read with
MyClass.getResourceAsStream("my.properties");
Read further here.
You always change in the project src folder. The build folder is only for building your app.
If you want to change the properties file on a deployed system you may put the properties into the WEB-INF folder and then access with ServletContext#getRealPath().
I put the .properties file in the same folder as the src and it works :)
Alright, so I'm working on Windows and here's my solution...
It actually doesn't matter much where you put the .properties file--but assuming you created the file in NetBeans and let it save to its default location, you can simply call the data with the full directory attached.
Just for reference, here's what I did:
SimpleDataSource sds = new SimpleDataSource("src\\simpledatasource\\mystuff.properties");
Notice you'll need to escape the backslash, so use two of them.
I have been working with SharePoint Designer, and have been creating workflows, but cannot seem to find a way to create a folder inside of another folder that already exists. Now, I have no problem creating a folder and then creating another one inside of it, but I need to be able to add the subfolder to a pre-existing folder. Can anyone help. I am using SharePoint Designer 2010. I keep getting the error that it could not create the list item and to make sure the list exists and the user has permissions to the list. I am the owner with all permissions and the list does exist. I can give you more details if you have specific questions. I have tried referencing the data several different ways, starting with the way in which I referenced it to create a folder and subfolder, but am having no luck. Please help.
Have you tried including the existing folder name? See this blog post for details: http://www.getinthesky.com/2012/08/creating-folders-and-sub-folders-using-sharepoint-2010-designer-workflow/
It involves creating the folder and subfolder in the same workflow, however, the parent folder must be created first anyway.
How can we make a nested directory in resource folder to put the xmls with same name for different folders.And how we can read it using path in iphone app programatically?
Actually i want to make like resource>a>b>some.xml
again in resource like resource>f>g>some.xml
and so on...how ever both xml is containing different data in it.and also tell me the way how we can read it in iphone application.
You cannot use the same filename, even if they resides in different folders.
Instead, as a workaround, you can name the files like:
a_b_some.xml
f_g_some.xml
you can create a folder structure on your system and then directly add the folder to your XCode Project under resources by drag-drop.
this folder must display in BLUE color (physical grouping in folder on disk) rather than YELLOW (logical grouping in project only) just like native folders on mac. like this you can put same file in different folder hierarchy without any problems.
you need to create a absolute path to your file whenever you want its access your file [NSBundle pathForResource:] will not work in this case as it does not have access to your custom folder hierarchy.
best of luck.
I registered my app to associate some filetypes. so when the file comes in the mail attachment, I use my app to open the file. My app will automatically create a "Inbox" folder inside my Documents folder, and save the file in "Inbox". This Inbox is special, because it prevents me to create a folder or move a file into it by program.
Question comes to me is:
What is the special for the "Inbox"? Can I change some setting, and
it will allow me to create a subfolder inside?
What is normal solution for this?
Thanks
Cullen
Inbox is just a link to your email stuff. You should copy the files from there to your documents directory withNSFileManager.
I'm looking for a good way to manage many image files in my app.
When the number of images to maintain gets large, it seems vital to have a directory structure to hold them.(to organize images and to support duplicate image names)
Since normal way of storing images in documents directory(by adding images to xcode's resource folder) doesn't seem to support directory structure,
I probably need to use something called bundle.
Here are questions.
It's not clear to me what's the difference between "documents
directory" and "bundle". Are they
just names to specify directory path
inside an iphone application? Since
documents directory doesn't support
directory structure, I guess it's not
a regular file path in iOS? (I'm
looking for a definition or overview
description on those two terms enough
to help answering the following
questions)
How do I create a tree structure directory to store resources?
How do I add files to the created directory?
What is the step (probably in xcode) to add new files to the
directory as project grows? note:
question 3 deals with initial set up,
4 deals with update.
What happens to files under documents directory and bundle when
user updates the app? Since many
applications store user data
somewhere, there must be a way of
updating an app without wiping out the
saved user data. ie. How does
"documents directory" and "bundle"
behave in update situation?
So called "resource bundle" refers to the "bundle" used in above
questions?
Thank you.
Your app is a "bundle". It's represented by an NSBundle object. On iOS, this is the only bundle you are allowed to use; you can't create another bundle and import it into your app.
However, you can add a subdirectory to your app's bundle. In Xcode 4, select your project in the navigator and click on the Build Phases tab. Add a new build phase (bottom right), Copy Files. Move it up just below Copy Bundle Resources, and rename it something meaningful ("copy interface images", or something). You'll notice you've got a Subpath field there - that's your directory in your bundle. Drag the files you want in that subdirectory on to this build phase, and then you can access them through the normal methods in NSBundle, UIImage, NSData and so on.
Wish it was easier? Me too.