FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(http): ensure httpcontent.toFile() creates intermediate directories by gezn · Pull Request #6451 · NativeScript/NativeScript · GitHub

fix(http): ensure httpcontent.toFile() creates intermediate directories - #6451

Merged
manoldonev merged 11 commits into
NativeScript:masterfrom
gezn:issue-3870
Mar 20, 2019
Merged

manoldonev merged 11 commits into
NativeScript:masterfrom
gezn:issue-3870

Conversation

gezn commented Oct 24, 2018 •
edited by vakrilov
Loading

Copy link
Copy Markdown
Contributor

When using the response.content.toFile the dir for the file should be created it not exists instead of throwing an error

PR Checklist

What is the current behavior?

#3870

What is the new behavior?

#3870
as described on the issue, in the new behavior it just tries to create the dir in case it doesn't exists before writing the file

Fixes #[3870].

BREAKING CHANGES:

no breaking changes

this is my first contribution

When using the response.content.toFile the dir for the file should be created it not exists instead of throwing an error
ghost added the ♥ community PR label Oct 24, 2018

radeva commented Oct 25, 2018

Copy link
Copy Markdown

Thanks @gezn for taking part in the contributors contest and making your first contribution!
The team is now a bit busy around the release of 5.0. Have in mind that it might take a bit more time to review and get back to you with comments.

ghost assigned vakrilov Nov 12, 2018

Copy link
Copy Markdown
Contributor

test

ghost added in progress and removed ♥ community PR labels Nov 12, 2018

gezn commented Nov 13, 2018

Copy link
Copy Markdown
Contributor Author

@vakrilov I have a question, What's not running correctly on jenkins tests? I tried to see the details of the build, but I can't reach the page. it says that the site can be reached or found. can you please send me the jenkins feedback so I can fix the PR, thaks in advance.

Copy link
Copy Markdown
Contributor

Hey @gezn,
We disable all the tests that are doing remote requests, because they were flaky and sometimes fail, because of networking reasons rather than bugs :)
We will check what's the status and update you if we expect anything else from your side.

gezn commented Nov 13, 2018

Copy link
Copy Markdown
Contributor Author

thanks for the quick answer @vakrilov

radeva commented Nov 19, 2018

Copy link
Copy Markdown

Hi @gezn ,

Congratulations on being one of the winners in the {N} First-time contributors contest!

You can claim your prize by contacting us at nativescriptwinners[at]progress.com not later than Nov 30th 2018 . Make sure you send us the following info: 
👉Your full name 
👉Your email 
👉Your country or residence 

Best regards,
The NativeScript Team

ghost assigned dtopuzov Nov 27, 2018

Copy link
Copy Markdown
Contributor

test

dtopuzov commented Nov 27, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

CI reports failing test.

iOS:

Test: HTTP.test_request_responseContentToFileFromUrlShouldReturnCorrectFileAndCreateDirPathIfNecesary
FAILED: result from to file should be greater than 0 in size

Android:

Test: HTTP.test_getFile 
FAILED: Cannot save file with path: /data/user/0/org.nativescript.UnitTestApp/files/logo.png.

Test: HTTP.test_getContentAsFile 
FAILED: Cannot save file with path: /data/user/0/org.nativescript.UnitTestApp/files/test.png.

Test: HTTP.test_request_responseContentToFileFromUrlShouldReturnCorrectFile 
FAILED: Test timeout.

Test: HTTP.test_request_responseContentToFileFromUrlShouldReturnCorrectFileAndCreateDirPathIfNecesary 
FAILED: Test timeout

Test: HTTP.test_request_responseContentToFileFromContentShouldReturnCorrectFile 
FAILED: Test timeout

Test: IMAGE-SOURCE.testSaveToFile 
FAILED: java.io.FileNotFoundException: 
/data/user/0/org.nativescript.UnitTestApp/files/test.png: open failed: EISDIR (Is a directory)
4677  4677 E JS      :     libcore.io.IoBridge.open(IoBridge.java:452)
4677  4677 E JS      :     java.io.FileOutputStream.<init>(FileOutputStream.java:87)
4677  4677 E JS      :     java.io.FileOutputStream.<init>(FileOutputStream.java:127)
4677  4677 E JS      :     java.io.FileOutputStream.<init>(FileOutputStream.java:116)
4677  4677 E JS      :     com.tns.Runtime.callJSMethodNative(Native Method)
4677  4677 E JS      :     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1120)
4677  4677 E JS      :     com.tns.Runtime.callJSMethodImpl(Runtime.java:1000)
4677  4677 E JS      :     com.tns.Runtime.callJSMethod(Runtime.java:987)
4677  4677 E JS      :     com.tns.Runtime.callJSMethod(Runtime.java:967)
4677  4677 E JS      :     com.tns.Runtime.callJSMethod(Runtime.java:959)
4677  4677 E JS      :     com.tns.gen.java.lang.Runnable.run(Runnable.java:15)
4677  4677 E JS      :     android.os.Handler.handleCallback(Handler.java:739)
4677  4677 E JS      :     android.os.Handler.dispatchMessage(Handler.java:95)
4677  4677 E JS      :     android.os.Looper.loop(Looper.java:148)
4677  4677 E JS      :     android.app.ActivityThread.main(ActivityThread.java:5417)
4677  4677 E JS      :     java.lang.re...

Test: IMAGE-SOURCE.testSaveToFile_WithQuality 
FAILED: java.io.FileNotFoundException: 
/data/user/0/org.nativescript.UnitTestApp/files/test.png: open failed: EISDIR (Is a directory)
4677  4677 E JS      :     libcore.io.IoBridge.open(IoBridge.java:452)
4677  4677 E JS      :     java.io.FileOutputStream.<init>(FileOutputStream.java:87)
4677  4677 E JS      :     java.io.FileOutputStream.<init>(FileOutputStream.java:127)
4677  4677 E JS      :     java.io.FileOutputStream.<init>(FileOutputStream.java:116)
4677  4677 E JS      :     com.tns.Runtime.callJSMethodNative(Native Method)
4677  4677 E JS      :     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1120)
4677  4677 E JS      :     com.tns.Runtime.callJSMethodImpl(Runtime.java:1000)
4677  4677 E JS      :     com.tns.Runtime.callJSMethod(Runtime.java:987)
4677  4677 E JS      :     com.tns.Runtime.callJSMethod(Runtime.java:967)
4677  4677 E JS      :     com.tns.Runtime.callJSMethod(Runtime.java:959)
4677  4677 E JS      :     com.tns.gen.java.lang.Runnable.run(Runnable.java:15)
4677  4677 E JS      :     android.os.Handler.handleCallback(Handler.java:739)
4677  4677 E JS      :     android.os.Handler.dispatchMessage(Handler.java:95)
4677  4677 E JS      :     android.os.Looper.loop(Looper.java:148)
4677  4677 E JS      :     android.app.ActivityThread.main(ActivityThread.java:5417)
4677  4677 E JS      :     ... 

Test: IMAGE-SOURCE.testFromFile 
FAILED: Cannot read property 'height' of null

ghost assigned manoldonev Feb 6, 2019
manoldonev changed the title feat(android-ios-http): change toFile functionality feat(http): ensure httpcontent.toFile() creates intermediate directories Mar 19, 2019

Copy link
Copy Markdown
Contributor

test

manoldonev changed the title feat(http): ensure httpcontent.toFile() creates intermediate directories fix(http): ensure httpcontent.toFile() creates intermediate directories Mar 19, 2019
manoldonev merged commit d7fb9b8 into NativeScript:master Mar 20, 2019
ghost removed the in progress label Mar 20, 2019

lock Bot commented Mar 21, 2020

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock Bot locked and limited conversation to collaborators Mar 21, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL