delete-file

How to delete a file with an empty name from S3

大兔子大兔子 提交于 2020-08-27 09:00:08
问题 Somehow, using the AWS Java API, we managed to upload a file to S3 without a name. The file is shown if we run s3cmd ls s3://myBucket/MyFolder , but is not shown in the S3 GUI. Running s3cmd del s3://myBucket/MyFolder/ give the following error: ERROR: Parameter problem: Expecting S3 URI with a filename or --recursive: s3://myBucket/MyFolder/ Running the same command without the trailing slash does nothing. How can the file be deleted? 回答1: As far as I know, it can't be done using s3cmd. It

Deleting File and Directory in JUnit

。_饼干妹妹 提交于 2020-06-24 09:46:53
问题 I'm writing a test for a method that creates a file in a directory. Here's what my JUnit test looks like: @Before public void setUp(){ objectUnderTest = new ClassUnderTest(); //assign another directory path for testing using powermock WhiteBox.setInternalState(objectUnderTest, "dirPathField", mockDirPathObject); nameOfFile = "name.txt"; textToWrite = "some text"; } @Test public void shouldCreateAFile(){ //create file and write test objectUnderTest.createFile(nameOfFile, textToWrite); /* this

Deleting File and Directory in JUnit

跟風遠走 提交于 2020-06-24 09:46:23
问题 I'm writing a test for a method that creates a file in a directory. Here's what my JUnit test looks like: @Before public void setUp(){ objectUnderTest = new ClassUnderTest(); //assign another directory path for testing using powermock WhiteBox.setInternalState(objectUnderTest, "dirPathField", mockDirPathObject); nameOfFile = "name.txt"; textToWrite = "some text"; } @Test public void shouldCreateAFile(){ //create file and write test objectUnderTest.createFile(nameOfFile, textToWrite); /* this

Script to convert .XLSX to Google Sheet and move converted file

◇◆丶佛笑我妖孽 提交于 2020-06-13 11:18:32
问题 I know it is possible to convert excel files to Google Sheets using script and drive API, but I'm looking for script to convert the excel sheet and move the converted file to a different folder. So the required steps are as follows: Convert excel (.xls/.xlsx) to Google Sheet from FolderA. Move converted file from FoldarA to FolderB. Delete original excel file from FolderA Hopefully step 3 avoids this, but avoid duplicating already converted file. The excel files are being pasted into a local

How do I delete the file of an Android Room database?

限于喜欢 提交于 2020-06-12 07:17:19
问题 I have implemented a room database which is distributed from a resource file using SQLiteAssetHelper the first time the app is started. The database contains game status data so if the Player wants to start all over again, I want to copy again the database file from the resource and overwrite the "local/internal" file. So my idea was to delete the interal db-file so that SQLiteAssetHelper will copy the Initial database from the resource again. Thank you! Kev 回答1: Here's a working example:

Unzip File Only If New in Google Apps Scripts

安稳与你 提交于 2020-04-17 20:05:13
问题 I have a folder (let's call it the source folder) on Google Drive that is updated from time to time with new zip files (underlying files are PDFs). I am trying to use Google Apps Script to unzip only the new zip files and place the underlying PDFs in another folder (let's call it the destination folder). I am currently using the following code to unzip the files in the source folder, running on a time-based trigger. My current code does not differentiate between old and new zip files so I am

Delete photo thumbnail in Gallery after manually delete the photo file

我只是一个虾纸丫 提交于 2020-04-13 17:38:19
问题 case R.id.menu_delete: File photoToDelete = new File(photoPath, photoList[gPosition]); photoToDelete.delete(); checkPhotoFolder(); galleryAdapter.notifyDataSetChanged(); Log.d("position", "" + gPosition); return true; I'm manually delete a photo file using above code. But in the system gallery the photo still show the blank thumbnail. The question is how can I delete the photo file and also the thumbnail of it in the gallery? 回答1: Try invoke the MediaScanner to refresh the gallery // Tell the