This repository was archived by the owner on Nov 20, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
src/Microsoft.AspNet.Http.Core
test/Microsoft.AspNet.Http.Core.Tests Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 3
3
4
4
using System ;
5
5
using System . IO ;
6
- using Microsoft . AspNet . Http ;
7
6
using Microsoft . AspNet . WebUtilities ;
8
7
9
8
namespace Microsoft . AspNet . Http . Core
@@ -16,11 +15,9 @@ public static string TempDirectory
16
15
{
17
16
get
18
17
{
19
- var temp = Environment . GetEnvironmentVariable ( "ASPNET_TEMP" ) ;
20
- if ( string . IsNullOrEmpty ( temp ) )
21
- {
22
- temp = Environment . GetEnvironmentVariable ( "TEMP" ) ;
23
- }
18
+ // Look for folders in the following order.
19
+ var temp = Environment . GetEnvironmentVariable ( "ASPNET_TEMP" ) ?? // ASPNET_TEMP - User set temporary location.
20
+ Path . GetTempPath ( ) ; // Fall back.
24
21
25
22
if ( ! Directory . Exists ( temp ) )
26
23
{
Original file line number Diff line number Diff line change
1
+ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
2
+ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
+
4
+ using System . IO ;
5
+ using Xunit ;
6
+
7
+ namespace Microsoft . AspNet . Http . Core . Tests
8
+ {
9
+ public class BufferingHelperTests
10
+ {
11
+ [ Fact ]
12
+ public void GetTempDirectory_Returns_Valid_Location ( )
13
+ {
14
+ var tempDirectory = BufferingHelper . TempDirectory ;
15
+ Assert . NotNull ( tempDirectory ) ;
16
+ Assert . True ( Directory . Exists ( tempDirectory ) ) ;
17
+ }
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments